// JavaScript Document
var isPost = false;
function validateForm(objForm) {
	if  ( isPost ) {
		//define('JS_ALERT_ERROR_1', 'You have press the SUBMIT button already');
		alert(JS_ALERT_ERROR_1);
		return false;	
	} else if ( IsEmpty(objForm.lhc_no.value)) {
		if(objForm.booking_type[0].checked){
			//define('JS_ALERT_ERROR_2', 'Please Select Your LHC membership number');
			Warning(objForm.lhc_no ,JS_ALERT_ERROR_2);
		}
		if(objForm.booking_type[1].checked){
			//define('JS_ALERT_ERROR_3', 'Please Select Your Voucher number');
			Warning(objForm.lhc_no ,JS_ALERT_ERROR_3);
		}
		return false;		
	} else if ( IsEmpty(objForm.member_name.value)) {
		//define('JS_ALERT_ERROR_4', 'Please Enter the Member\'s Full Name');
		if(objForm.booking_type[0].checked){
			//define('JS_ALERT_ERROR_2', 'Please Select Your LHC membership number');
			Warning(objForm.member_name ,JS_ALERT_ERROR_41);
		}
		if(objForm.booking_type[1].checked){
			//define('JS_ALERT_ERROR_3', 'Please Select Your Voucher number');
			Warning(objForm.member_name ,JS_ALERT_ERROR_4);
		}
		return false;
	} else if (IsEmpty(objForm.checkin_name.value) && document.getElementById('tr_tag_guest_full_name').style.display!='none') {
		//define('JS_ALERT_ERROR_5', 'Please Select the check-in Guest\'s Name');
		Warning(objForm.checkin_name ,JS_ALERT_ERROR_5);
		return false;
	} else if ( IsEmpty(objForm.tel.value)) {
		//define('JS_ALERT_ERROR_6', 'Please Select Your Tel');
		Warning(objForm.tel ,JS_ALERT_ERROR_6);
		return false;		
	} else if ( IsEmpty(objForm.email.value)) {
		//define('JS_ALERT_ERROR_7', 'Please specify Your Email');
		Warning(objForm.email ,JS_ALERT_ERROR_7);
		return false;
	} else if ( ! IsEmail(objForm.email.value)) {
		//define('JS_ALERT_ERROR_8', 'Please specify Your Email in the right format');
		Warning(objForm.email ,JS_ALERT_ERROR_8);
		return false;	
	} else if ( IsEmpty(objForm.resort_location_1st.value)) {
		//define('JS_ALERT_ERROR_9', 'Please Select Your 1st Choice Resort location');
		Warning(objForm.resort_location_1st ,JS_ALERT_ERROR_9);
		return false;	
	} else if ( IsEmpty(objForm.lhcr_checkin_date_1st.value)) {
		Warning(objForm.lhcr_checkin_date_1st ,JS_ALERT_ERROR_12);
		return false;	
	} else if ( IsEmpty(objForm.lhcr_number_of_night.value)  ) {
		Warning(objForm.lhcr_number_of_night ,JS_ALERT_ERROR_25);
		return false;
	} else if ( objForm.lhcr_number_of_night.value<2) {
		Warning(objForm.lhcr_number_of_night ,JS_ALERT_ERROR_26);
		return false;		
	} else if (!IsNum(objForm.lhcr_number_of_night.value)) {
		Warning(objForm.lhcr_number_of_night ,JS_ALERT_ERROR_25);
		return false;		
	//} else if(objForm.lhcr_number_of_night.value<2){
	//	Warning(objForm.lhcr_number_of_night ,JS_ALERT_ERROR_26);	
	//	return false;
	//} else if ( IsEmpty(objForm.lhcr_checkout_date_1st.value)) {
	//	//define('JS_ALERT_ERROR_15', 'Please Select Your 1st Choice Check-out date');
	//	Warning(objForm.lhcr_checkout_date_1st ,JS_ALERT_ERROR_15);
	//	return false;			
	//} else if (IsEmpty(objForm.resort_location_2nd.value)) {
	//	Warning(objForm.resort_location_2nd ,JS_ALERT_ERROR_10);
	//	return false;		
	//} else if ( IsEmpty(objForm.lhcr_checkin_date_1st.value)) {
	//		Warning(objForm.lhcr_checkin_date_1st ,JS_ALERT_ERROR_12);
	//	return false;		
	//} else if ( IsEmpty(objForm.lhcr_checkin_date_2nd.value)) {
	//	//define('JS_ALERT_ERROR_13', 'Please Select Your 2nd Choice Check-in date');
	//	Warning(objForm.lhcr_checkin_date_2nd ,JS_ALERT_ERROR_13);
	//	return false;		
	//} else if ( IsEmpty(objForm.lhcr_checkout_date_2nd.value)) {
	//	//define('JS_ALERT_ERROR_16', 'Please Select Your 2nd Choice Check-out date');
	//	Warning(objForm.lhcr_checkout_date_2nd ,JS_ALERT_ERROR_16);
	//	return false;		
	} else if ( IsEmpty(objForm.room_type_1st.value)) {
		//define('JS_ALERT_ERROR_18', 'Please Select Your 1st Choice Room Type');
		Warning(objForm.room_type_1st ,JS_ALERT_ERROR_18);
		return false;		
	//} else if ( IsEmpty(objForm.room_type_2nd.value)) {
	//	//define('JS_ALERT_ERROR_19', 'Please Select Your 2nd Choice Room Type');
	//	Warning(objForm.room_type_2nd ,JS_ALERT_ERROR_19);
	//	return false;		
	} else if (objForm.rdoResortLocation[1].checked && IsEmpty(objForm.resort_location_2nd.value)) {
		Warning(objForm.resort_location_2nd ,JS_ALERT_ERROR_10);
		return false;
	} else if (objForm.check_in_date[1].checked && IsEmpty(objForm.lhcr_checkin_date_2nd.value)) {
		Warning(objForm.lhcr_checkin_date_2nd ,JS_ALERT_ERROR_13);
		return false;
	} else if (objForm.check_in_date[1].checked && IsEmpty(objForm.lhcr_checkout_date_2nd.value)) {
		Warning(objForm.lhcr_checkout_date_2nd ,JS_ALERT_ERROR_16);
		return false;	
	} else if (objForm.check_in_date[1].checked && objForm.lhcr_checkin_date_2nd.value == objForm.lhcr_checkout_date_2nd.value && objForm.lhcr_checkin_date_2nd.value == objForm.lhcr_checkin_date_1st.value) {
		Warning(objForm.lhcr_checkin_date_2nd ,JS_ALERT_ERROR_27);
		return false;
	} else if ( IsEmpty(objForm.number_adults.value)) {
		Warning(objForm.number_adults ,JS_ALERT_ERROR_21);
		return false;		
	} else if ( IsEmpty(objForm.number_children.value)) {
		//define('JS_ALERT_ERROR_22', 'Please Select Your Number of persons (Children (Age 3 - 12))');
		Warning(objForm.number_children ,JS_ALERT_ERROR_22);
		return false;		
	} else if ( IsEmpty(objForm.number_infants.value)) {
		//define('JS_ALERT_ERROR_23', 'Please Select Your Number of persons (Infants (Age 3 and Below))');
		Warning(objForm.number_infants ,JS_ALERT_ERROR_23);
		return false;		
	} else if ( IsEmpty(objForm.verificationcode.value)) {
		//define('JS_ALERT_ERROR_24', 'Please specify Your characters appearing at left');
		Warning(objForm.verificationcode ,JS_ALERT_ERROR_24);
		return false;		
	} else {
		isPost = true;
		objForm.btnSubmit.disabled = true;
		return true;
	}
}
function validateForm2(objForm) {
	if  ( isPost ) {
		alert("You have press the SUBMIT button already");
		return false;	
	} else if ( IsEmpty(objForm.lhc_no.value)) {
		if(objForm.booking_type[0].checked){
			Warning(objForm.lhc_no ,"Please Select Your LHC membership number");
		}
		if(objForm.booking_type[1].checked){
			Warning(objForm.lhc_no ,"Please Select Your Voucher number");
		}
		return false;		
	} else if ( IsEmpty(objForm.member_name.value)) {
		Warning(objForm.member_name ,"Please Enter the Member's Full Name");
		return false;
	} else if (IsEmpty(objForm.checkin_name.value) && document.getElementById('tr_tag_guest_full_name').style.display!='none') {
		Warning(objForm.checkin_name ,"Please Select the check-in Guest's Name");
		return false;
	} else if ( IsEmpty(objForm.tel.value)) {
		Warning(objForm.tel ,"Please Select Your Tel");
		return false;		
	} else if ( IsEmpty(objForm.email.value)) {
		Warning(objForm.email ,"Please specify Your Email");
		return false;
	} else if ( ! IsEmail(objForm.email.value)) {
		Warning(objForm.email ,"Please specify Your Email in the right format");
		return false;	
	} else if ( IsEmpty(objForm.resort_location_1st.value)) {
		Warning(objForm.resort_location_1st ,"Please Select Your 1st Choice Resort location");
		return false;		
	} else if ( IsEmpty(objForm.resort_location_2nd.value)) {
		Warning(objForm.resort_location_2nd ,"Please Select Your 2nd Choice Resort location");
		return false;		
	} else if ( IsEmpty(objForm.resort_location_3rd.value)) {
		Warning(objForm.resort_location_3rd ,"Please Select Your 3rd Choice Resort location");
		return false;		
	} else if ( IsEmpty(objForm.lhcr_checkin_date_1st.value)) {
		Warning(objForm.lhcr_checkin_date_1st ,"Please Select Your 1st Choice Check-in date");
		return false;		
	} else if ( IsEmpty(objForm.lhcr_checkin_date_2nd.value)) {
		Warning(objForm.lhcr_checkin_date_2nd ,"Please Select Your 2nd Choice Check-in date");
		return false;		
	} else if ( IsEmpty(objForm.lhcr_checkin_date_3rd.value)) {
		Warning(objForm.lhcr_checkin_date_3rd ,"Please Select Your 3rd Choice Check-in date");
		return false;	
	} else if ( IsEmpty(objForm.lhcr_checkout_date_1st.value)) {
		Warning(objForm.lhcr_checkout_date_1st ,"Please Select Your 1st Choice Check-out date");
		return false;		
	} else if ( IsEmpty(objForm.lhcr_checkout_date_2nd.value)) {
		Warning(objForm.lhcr_checkout_date_2nd ,"Please Select Your 2nd Choice Check-out date");
		return false;		
	} else if ( IsEmpty(objForm.lhcr_checkout_date_3rd.value)) {
		Warning(objForm.lhcr_checkout_date_3rd ,"Please Select Your 3rd Choice Check-out date");
		return false;			
	} else if ( IsEmpty(objForm.room_type_1st.value)) {
		Warning(objForm.room_type_1st ,"Please Select Your 1st Choice Room Type");
		return false;		
	} else if ( IsEmpty(objForm.room_type_2nd.value)) {
		Warning(objForm.room_type_2nd ,"Please Select Your 2nd Choice Room Type");
		return false;		
	} else if ( IsEmpty(objForm.room_type_3rd.value)) {
		Warning(objForm.room_type_3rd ,"Please Select Your 3rd Choice Room Type");
		return false;		
	} else if ( IsEmpty(objForm.number_adults.value)) {
		Warning(objForm.number_adults ,"Please Select Your Number of persons (Adults)");
		return false;		
	} else if ( IsEmpty(objForm.number_children.value)) {
		Warning(objForm.number_children ,"Please Select Your Number of persons (Children (Age 3 - 12))");
		return false;		
	} else if ( IsEmpty(objForm.number_infants.value)) {
		Warning(objForm.number_infants ,"Please Select Your Number of persons (Infants (Age 3 and Below))");
		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;
	}
}

