function checkForm_contact() {
	if (document.addcontact.name.value == "") {
		alert("請填寫名稱");
		document.addcontact.name.focus();
		return false;
	}
	
	if (document.addcontact.phone.value == "") {
		alert("請填寫聯絡電話");
		document.addcontact.phone.focus();
		return false;
	}
	
	if (document.addcontact.phone.value.length < 8) {
		alert("電話數字不能少於8個");
		document.addcontact.phone.focus();
		return false;
	}
	
	if (!isNumeric(document.addcontact.phone.value)) {
		alert("電話號碼只能是數字");
		document.addcontact.phone.focus();
		return false;
	}
	
	if (document.addcontact.email.value == "") {
		alert("請填寫電郵地址");
		document.addcontact.email.focus();
		return false;
	}
	
	if (!isEmail(document.addcontact.email.value)) {
		alert("電郵地址格式不正確");
		document.addcontact.email.focus();
		return false;
	}
	
	if (document.addcontact.enquiry.value == "") {
		alert("請填寫查詢內容");
		document.addcontact.enquiry.focus();
		return false;
	}
	
	//alert("你的資料正在傳送, 請稍候片刻");
	//alert('多謝參加一口清熱「至好味」創作比賽!\n各得獎者的分享將於2009年11月30日於本網站公佈，\n歡迎大家屆時再瀏覽得獎的「至好味」創意飲法!\n\n        ****得獎者將有電郵及專人通知領獎。****');
	//setTimeout(document.adduser.reset(), 1000);
	return true;

}

function isEmail (s) {
    var i = 1;
    var sLength = s.length;
   
    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

function isNumeric(s) {
	var strValidChars = "0123456789-";
	var strChar;
	var blnResult = true;
	
	if (s.length == 0) return false;

	//  test strString consists of valid characters listed above
	for (i = 0; i < s.length && blnResult == true; i++) {
		strChar = s.charAt(i);
		if (strValidChars.indexOf(strChar) == -1) {
			blnResult = false;
		}
	}
	return blnResult;
}

function nonSymbol(s) {
	var strValidChars = "!@#?";
	var strChar;
	var blnResult = true;

	if (s.length == 0) return false;

	//  test strString consists of valid characters listed above
	for (i = 0; i < s.length; i++) {
		strChar = s.charAt(i);
		if (strValidChars.indexOf(strChar) == -1) {
			blnResult = false;
		}
	}
	return blnResult;
}