// JavaScript DocumentjQuery(document).ready(function(){	var startDateForward = parseInt(jQuery('#forwardStartDate').val());	var daySpan = parseInt(jQuery('#defaultDaySpan').val());	var endDateStart = startDateForward + daySpan;		jQuery('#checkin').datepicker({		defaultDate: '+'+startDateForward+'d',		minDate:  	 '+'+startDateForward+'d',		maxDate:  	 '+1y',		dateFormat:  'mm/dd/y',		changeMonth: true,		changeYear:  true,		showOn: 'button',		buttonImage: 'http://secure.guestdesk.com/search/images/calendar.gif',		buttonImageOnly: true,		buttonText: 'Choose Date',		showAnim: 'fadeIn',		onClose: adjustEndDate	});		jQuery('#checkout').datepicker({		defaultDate: '+'+endDateStart+'d',		minDate:  	 '+'+startDateForward+'d',		maxDate:  	 '+1y',		dateFormat:  'mm/dd/y',		changeMonth: true,		changeYear:  true,		showOn: 'button',		buttonImage: 'http://secure.guestdesk.com/search/images/calendar.gif',		buttonImageOnly: true,		buttonText: 'Choose Date',		showAnim: 'fadeIn'	});});function adjustEndDate(){	try {		var daySpan = parseInt(jQuery('#defaultDaySpan').val());		var endDate = new Date();		endDate = jQuery('#checkin').datepicker('getDate');				endDate.setDate(endDate.getDate() + daySpan);			jQuery('#checkout').datepicker('setDate',endDate);	} catch(e) {	}}		function checkfields() { var error=0;    var now = new Date();    var curMonth = (now.getMonth()+1);    if (document.formHO.dateLeavingMonth.value < curMonth)       {theyear = now.getFullYear()+1;}    else if (document.formHO.dateLeavingMonth.value >= curMonth)       {theyear = now.getFullYear();}    if (document.formHO.dateReturningMonth.value < curMonth)       {thedepyear = now.getFullYear()+1;}    else if (document.formHO.dateReturningMonth.value >= curMonth)       {thedepyear = now.getFullYear();}	document.formHO.checkin.value=document.formHO.dateLeavingMonth.value+'/'+document.formHO.dateLeavingDay.value+'/'+theyear;	document.formHO.checkout.value=document.formHO.dateReturningMonth.value+'/'+document.formHO.dateReturningDay.value+'/'+thedepyear;	if (document.formHO.property.value == 0) {		document.formHO.submit();}	else {		//Property selected from the multiple property dropdown		URLVars='id='+document.formHO.property.value+'&checkin='+document.formHO.checkin.value+'&checkout='+document.formHO.checkout.value+'&adults='+document.formHO.adults.value+'&children='+document.formHO.children.value+'&rooms='+document.formHO.rooms.value+'&refLoc='+document.formHO.JSrefLoc.value+'&bookedOnrefLoc='+document.formHO.JSbookedOnrefLoc.value;		document.formHO.action='https://secure.guestdesk.com/reservations/?'+URLVars; document.formHO.submit(); }}function specialCodeWindow_V3() {    if (document.specCodeForm.specialsCode.value == '')       {alert('Please enter the special code'); return false; }    else       {  URLVars='id='+document.specCodeForm.siteID.value+'&specialCode='+escape(document.specCodeForm.specialsCode.value)+'&refLoc='+document.formHO.JSrefLoc.value+'&bookedOnrefLoc='+document.formHO.JSbookedOnrefLoc.value;	   document.formHO.action='https://secure.guestdesk.com/reservations/?'+URLVars+'&systemType=2'; document.formHO.submit();		return false;	   }}//new function for global search special codefunction specialCodeWindow_V4() {    if (document.specCodeForm.specialsCode.value == '')       {alert('Please enter the special code'); return false;}    else       {	   	if(document.specCodeForm.siteID.value > 0){			URLVars='id='+document.specCodeForm.siteID.value+'&specialCode='+escape(document.specCodeForm.specialsCode.value);	   		document.formHO.action='https://secure.guestdesk.com/globalSearch/specialGlobalSearch.cfm?'+URLVars; document.formHO.submit();			return false;		}		else{}					   }}/*function rePositionCal () {  var theCoodinates=checkwhere();  var coodinateArray=theCoodinates.split(":");  var Xcoodinate=parseInt(coodinateArray[0])-50;  var Ycoodinate=parseInt(coodinateArray[1])+10;  var ifr =     document.all ? document.all['iframeCal'] :       document.getElementById('iframeCal');  ifr.style.top=Ycoodinate+'px';  ifr.style.left=Xcoodinate+'px';  //ifr.style.visibility='hidden';}function checkwhere(e) {  // returns the mouse x and y coodinates to position the calendar        if (document.layers){        xCoord = e.x;        yCoord = e.y;}        else if (document.all){        xCoord = event.clientX;        yCoord = event.clientY;}        else if (document.getElementById){        xCoord = e.clientX;        yCoord = e.clientY;}   return (xCoord+':'+yCoord)}*/function rePositionCal (e) {  var theCoodinates=checkwhere(e);  var coodinateArray=theCoodinates.split(":");  var Xcoodinate=parseInt(coodinateArray[0])-5;//parseInt(document.formHO.offsetX.value  var Ycoodinate=parseInt(coodinateArray[1])+parseInt(document.formHO.offsetY.value);  var ifr =     document.all ? document.all['iframeCal'] :       document.getElementById('iframeCal');  ifr.style.top=Ycoodinate+'px';  ifr.style.left=Xcoodinate+'px';  //ifr.style.visibility='hidden';}function checkwhere(e) {  // returns the mouse x and y coodinates to position the calendar    var posx = 0;	var posy = 0;	if (!e) var e = window.event;	if (e.pageX || e.pageY) 	{		posx = e.pageX;		posy = e.pageY;	}	else if (e.clientX || e.clientY) 	{		posx = e.clientX + document.body.scrollLeft			+ document.documentElement.scrollLeft;		posy = e.clientY + document.body.scrollTop			+ document.documentElement.scrollTop;	}  return (posx+':'+posy)}function openArrivalCal(theEvent) {	window.calendar.openCal(theEvent,'HO_from','HO_cal');	adjDate(document.formHO);	rePositionCal();}function openDepartureCal(theEvent) {	window.calendar.openCal(theEvent,'HO_to','HO_cal');	b_stopBit = 1;	rePositionCal();}
