// JavaScript Document
var isPost = false;
function validateForm(objForm) {
	if  ( isPost ) {
		alert("You have press the SUBMIT button already");
		return false;
	} else if (objForm.prov.value==0 && IsEmpty(objForm.start_date.value) && IsEmpty(objForm.end_date.value)) {
		Warning(objForm.prov , "Please select Province or Arrive Date and Depart Date");
		return false;
	} else if ( IsEmpty(objForm.start_date.value) && !IsEmpty(objForm.end_date.value) ) {
		Warning(objForm.start_date , "Please select Arrive Date");
		return false;
	} else if ( !IsEmpty(objForm.start_date.value)  && IsEmpty(objForm.end_date.value)) {
		Warning(objForm.end_date ,"Please select Depart Date");
		return false;
	} else if ( objForm.room.value==10) {
		Warning(objForm.start_date , "If you wish to book more than 9 rooms please contact admin.");
		return false;
	} else if (parseInt(objForm.adult.value)+parseInt(objForm.childc.value) >objForm.room.value*4) {
		Warning(objForm.adult ,"The number of adults and children selected must not exceed a total of  4 per room.");
		return false;
	} else if (((Math.ceil((parseInt(objForm.adult.value))/3))-objForm.room.value)>0) {
			if (confirm("Automatic system set room to "+(Math.ceil((parseInt(objForm.adult.value))/3))))return true;
			else return false;
	} else {
		isPost = true;
		objForm.btnSubmit.disabled = true;
		return true;
	}
}	
