﻿function IsNumber(string,sign)
{
	var number;
	if (string==null) return false;
	if ((sign!=null) && (sign!='-') && (sign!='+'))
	{
		alert('IsNumber(string,sign)的參數出錯：\nsign為null或"-"或"+"');
		return false;
	}
		number = new Number(string);
	if (isNaN(number))
	{
		return false;
	}
	else if ((sign==null) || (sign=='-' && number<0) || (sign=='+' && number>0))
	{
		return true;
	}
	else return false;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function check(got) {

if (got.name.value=="") {
	alert("Please input your contact name!!");
	got.name.focus();
	return false;
}

if (got.phoneA.value=="") {
	alert("Please input your area code!!"); 
	got.phoneA.focus();
	return false;
}

if (got.phoneB.value=="") {
	alert("Please input your telephone!!");
	got.phoneB.focus();
	return false;
}

if (got.email.value=="") {
	alert("Please input your E-mail!!");
	got.email.focus();
	return false;
}

if ((!got.email.value == "" && got.email.value.indexOf('@',0) == -1) || (!got.email.value == "" && got.email.value.indexOf('.',0) == -1))
{
	alert("Please input the correct E-mail!!");
	got.email.focus();
	return false;
}

if (got.f_code.value=="") {
	alert("Please input your verify code!!");
	got.f_code.focus();
	return false;
}

if (got.f_code.value!=got.codeing.value) {
	alert("Wrong verify code!!");
	got.f_code.focus();
	return false;
}

return true;
}
