function checkLogonForm () {	var adremail = document.mainForm.mailAddress.value;	var passwd = document.mainForm.password.value;	if  (adremail == "" || !checkEmail (adremail)) {alert (msgEmailNotValid); return false;}	if  (passwd == "") {alert (msgEmpty); document.mainForm.password.focus (); return false;}}/* -------------------------------------------------------------- * Called from the day, month, year popup menus. * Check first if the date is valid, and then check if the date * is not in the past, then check if the date is not more than * one year. * ------------------------------------------------------------*/function obligeValidDate (popUpMenuDay, popUpMenuMonth, popUpMenuYear) {/*	var msgDatePassed 			= "Error: You cannot search for a date that starts before today's date.";*//*	var msgDateMoreThanOneYear	= "Error: You cannot search for a date that is more than one year from now.";*//*	*//*	// oblige valid date*//*	if (obligeValidDay (popUpMenuDay, popUpMenuMonth, popUpMenuYear)){return true};*//**//*	// oblige no past dates*//*	var dateDay		= parseInt (popUpMenuDay.options[popUpMenuDay.selectedIndex].value);*//*	var dateMonth	= parseInt (popUpMenuMonth.options[popUpMenuMonth.selectedIndex].value);*//*	var dateYear	= popUpMenuYear.options[popUpMenuYear.selectedIndex].value;*//*	if (dateYear.length != 4) {dateYear = "20" + dateYear}*//*	var thisDate	= new Date (dateYear, dateMonth - 1, dateDay);*//*	*//*	var now 		= new Date ();*//*	var nowYear		= parseInt (now.getFullYear ());*//*	var nowMonth	= now.getMonth ();*//*	var nowDay 		= now.getDate ();*//*	now 			= new Date (nowYear, nowMonth, nowDay)*//*	*//*	function setPopUp () {*//*		popUpMenuDay.options.selectedIndex		= nowDay - 1;*//*		popUpMenuMonth.options.selectedIndex	= nowMonth;*//*		popUpMenuYear.options.selectedIndex		= 0;*//*	}*//*	*//*	if ( now.getTime () > thisDate.getTime ()) {*//*		alert (msgDatePassed);*//*		setPopUp ()*//*		return true;*//*	}*//*	*//*	// oblige no date that is more than one year from now.*//*	if (!isLessThanOneYear (thisDate)) {alert (msgDateMoreThanOneYear); setPopUp ()}*/		return true}/* -------------------------------------------------------------- *  * ------------------------------------------------------------*/function userSite () {/*	return true*/	var mainForm = document.mainForm;		// length of stay	var lengthOfStay = mainForm.lengthOfStay.value; 	if (lengthOfStay == 0 || lengthOfStay == "") {alert (msgLengthOfStay); lengthOfStay = 1; return false;}	if (!isInt (lengthOfStay)) {alert (msgLengthOfStay); mainForm.lengthOfStay.value = 1; return false;}		// num of rooms	var numberOfRooms = mainForm.numberOfRooms.value;	if (numberOfRooms == 0 || numberOfRooms == "") {alert (msgNumOfRooms); numberOfRooms = 1; return false;}	if (!isInt (numberOfRooms)) {alert (msgNumOfRooms); mainForm.numberOfRooms.value = 1; return false;}			// num of adults	var numberOfAdults = mainForm.numberOfAdults.value;	if (numberOfAdults == 0 || numberOfAdults == "") {alert (msgNumOfAdults); numberOfAdults = 1; return false;}	if (!isInt (numberOfAdults)) {alert (msgNumOfAdults); mainForm.numberOfAdults.value = 1; return false;}		// currency	if (mainForm.currency.selectedIndex == 0) {alert (msgChooseCurrency); return false;}			return true;} /* -------------------------------------------------------------- *  * ------------------------------------------------------------*/function makeHotelInfoWindow (hotelID) {	var myUrl = "http://www.hotelclearinghouse.com/mimarghera/hotelInfoPLF?" + hotelID;	var newWin = "";	newWin = window.open (myUrl,'hotelInfoWindow', winConfig);	newWin.focus ();	}/* -------------------------------------------------------------- *  * ------------------------------------------------------------*///var msgEmailNotValid	= "Error: This is not a valid email address:";	function checkThisEmail (s) {	if  (s == "" || !checkEmail (s)) {alert (msgEmailNotValid); return false;}	return true;}/* -------------------------------------------------------------- * check the GIF fields * --------------------------------------------------------------*/function gifSite () {var mainForm = document.mainForm;if (!checkThisEmail (mainForm.email.value)) {return false}return true;}/* -------------------------------------------------------------- * check the Confirm Request page * --------------------------------------------------------------*/var hasClickedSubmitButton 	= false;function confirmRequest () {	hasClickedSubmitButton = false; // if we came back		var mainForm			= document.mainForm;//	var msgPleaseWait		= "Please do not press the submit button more than once.";//	var msgEmpty			= "Error: This required field is empty: ";//	var msgNotValidNum		= "Error: This is not a valid number: ";//	var msgChooseCountry	= "Error: You have to pick a country.";		// check for empty fields	if (!alertEmptyField (mainForm.nameLast, msgEmpty + nameLast + ".")) {return false;}	if (!alertEmptyField (mainForm.nameFirst, msgEmpty + nameFirst + ".")) {return false;}	if (!alertEmptyField (mainForm.email, msgEmpty + email + ".")) {return false;}	if (!alertEmptyField (mainForm.city, msgEmpty + city + ".")) {return false;}	//	if (!alertEmptyField (mainForm.nameLast, msgEmpty + "Last Name.")) {return false;}//	if (!alertEmptyField (mainForm.nameFirst, msgEmpty + "First Name.")) {return false;}//	if (!alertEmptyField (mainForm.email, msgEmpty + "e-mail Address.")) {return false;}//	if (!alertEmptyField (mainForm.city, msgEmpty + "City.")) {return false;}		// check for a valid email	if (!checkThisEmail (mainForm.email.value)) {return false;}		// check for the accompagning children	var childrenField 	= "Field Number of Accompaning Children.";	if (!isInteger (mainForm.numOfAccChildren.value, msgEmpty + childrenField, msgNotValidNum + childrenField)){		mainForm.numOfAccChildren.value = "0"; return false;}		//window.status = mainForm.country.selectedIndex;		if (mainForm.country.selectedIndex < 1) {alert (msgChooseCountry); return false;}		if (hasClickedSubmitButton) {		alert (msgPleaseWait);		return false;	} else {		hasClickedSubmitButton = true;	}	return true;}/* -------------------------------------------------------------- * set today's date if var setDate is true (will be in the calling page * --------------------------------------------------------------*/function setTodayDate () {	if (typeof setDate != "undefined") {		if (setDate) {			var d = new Date ()			var thisDate = d.getDate ()			var thisMonth = d.getMonth ()			var thisYear = d.getFullYear ()			if (thisYear == 2000) {				thisYear = 0;			} else {				thisYear = 1;			}			document.mainForm.dateMonthFrom.options[thisMonth].selected = true			document.mainForm.dateDayFrom.options[thisDate - 1].selected = true			document.mainForm.dateYearFrom.options[thisYear].selected = true		}	}	return true}function transit () {	// can't have named form element here (see protocol shopla)	var mainForm = document.mainForm;	var elem_lt = mainForm.elements.length;		// will catch every checkbox that are unchecked		for (i = 0; i < elem_lt; i++) {		if (mainForm.elements[i].type == "checkbox" && mainForm.elements[i].checked == false) {			alert (msgNeedToAgreeBeforeProceed);			return false;		}	}			return true;}