// JavaScript Document
var isPost = false;
function validateForm(objForm) {
	if  ( isPost ) {
		alert("You have press the SUBMIT button already");
		return false;
	} else if ( IsEmpty(objForm.typeenquiry.value)) {
		Warning(objForm.typeenquiry ,"Please Selecte Your Type of enquiry");
		return false;
	} else if ( IsEmpty(objForm.cenquiries.value)) {
		Warning(objForm.cenquiries ,"Please specify Your Enquiry");
		return false;
	} else if ( IsEmpty(objForm.cname.value)) {
		Warning(objForm.cname , "Please specify Your Name");
		return false;		
	} else if ( IsEmpty(objForm.ccountry.value)) {
		Warning(objForm.ccountry ,"Please Selecte Your Country");
		return false;		
	} else if ( IsEmpty(objForm.cemail.value)) {
		Warning(objForm.cemail ,"Please specify Your E-mail");
		return false;
	} else if ( ! IsEmail(objForm.cemail.value)) {
		Warning(objForm.cemail ,"Please specify Your E-mail in the right format");
		return false;	
	} else if ( IsEmpty(objForm.wedding_date.value)) {
		Warning(objForm.wedding_date ,"Please Selecte Your Desired Wedding Date");
		return false;
	} else if(validHowtoknow(objForm) == false){
		Warning(objForm.howtoknow1 ,"Please specify how did you learn about us");
		return false;	
	} else if ( IsEmpty(objForm.verificationcode.value)) {
		Warning(objForm.verificationcode ,"Please specify Your characters appearing at left");
		return false;		
	} else {
		isPost = true;
		objForm.btnSubmit.disabled = true;
		return true;
	}
}
function validateForm_CN(objForm) {
	if  ( isPost ) {
		alert("You have press the SUBMIT button already");
		return false;
	} else if ( IsEmpty(objForm.cname.value)) {
		Warning(objForm.cname , "Please specify Your Name");
		return false;	
	} else if ( IsEmpty(objForm.ccountry.value)) {
		Warning(objForm.ccountry ,"Please Selecte Your Country");
		return false;
	} else if ( IsEmpty(objForm.cemail.value)) {
		Warning(objForm.cemail ,"Please specify Your E-mail");
		return false;
	} else if ( ! IsEmail(objForm.cemail.value)) {
		Warning(objForm.cemail ,"Please specify Your E-mail in the right format");
		return false;	
	} else if ( IsEmpty(objForm.wedding_date.value)) {
		Warning(objForm.wedding_date ,"Please Selecte Your Desired Wedding Date");
		return false;
	} else if ( IsEmpty(objForm.typeenquiry.value)) {
		Warning(objForm.typeenquiry ,"Please Selecte Your Type of enquiry");
		return false;
	} else if ( IsEmpty(objForm.cenquiries.value)) {
		Warning(objForm.cenquiries ,"Please specify Your Enquiry");
		return false;
	} else if(validHowtoknow(objForm) == false){
		Warning(objForm.howtoknow1 ,"Please specify how did you know about us");
		return false;	
	} else if ( IsEmpty(objForm.verificationcode.value)) {
		Warning(objForm.verificationcode ,"Please specify Your characters appearing at left");
		return false;		
	} else {
		isPost = true;
		objForm.btnSubmit.disabled = true;
		return true;
	}
}	
function validHowtoknow(objForm){
	var isHowtoknow = false;
	if (IsCheck(objForm.howtoknow1) || IsCheck(objForm.howtoknow2) || IsCheck(objForm.howtoknow3)|| IsCheck(objForm.howtoknow4)|| IsCheck(objForm.howtoknow5)|| IsCheck(objForm.howtoknow6) ) {
		isHowtoknow = true;
	}
	return isHowtoknow
}
