pcalcsubmitcount=0;psendsubmitcount=0;function pcalcvalidate(fob){var f=fob;var c,m,v,msg;var daysout=1;var maxlength=60;msg="The checkin date you have selected is not valid.";var cidate=CheckDate(f.date1);if(!cidate)return abort(f.date1,msg);var syyyy=cidate.getFullYear();var smm=1+cidate.getMonth();var sdd=cidate.getDate();msg="The checkout date you have selected is not valid.";var codate=CheckDate(f.date2);if(!codate)return abort(f.date2,msg);var eyyyy=codate.getFullYear();var emm=1+codate.getMonth();var edd=codate.getDate();msg="Check-in date must be at least "+daysout+" days in the future, please check it.";var startdaysout=days_in_future(syyyy,smm,sdd);if(startdaysout<daysout)return abort(f.date1,msg);msg="Check-out date must be on or after the check-in date, please check it.";var enddaysout=days_in_future(eyyyy,emm,edd);if(enddaysout<startdaysout)return abort(f.date2,msg);msg="Check out date must be within "+maxlength+" days of check in date, please check it.";if(startdaysout+maxlength<enddaysout)return abort(f.date2,msg);if(VerifyChildren(f));else return false;if(pcalcsubmitcount>0){window.alert("We are in the process of computing your rate. Please be patient. If you cannot seem to get beyond this page, please reload the page and try again.");return false;}
++pcalcsubmitcount;return true;}
function psendvalidate(fob){if(!fob)return true;var f=fob;var c,m,v;var idx,msg;msg="Please choose one of the travel packages.";var bchecked=false;if(f.hotratebutton){if(f.hotratebutton.type=="radio"){if(f.hotratebutton.checked)bchecked=true;}else if(f.hotratebutton.length){for(idx=0;idx<f.hotratebutton.length;++idx){if(f.hotratebutton[idx].checked){bchecked=true;break;}}}else if(f.hotratebutton.type=="hidden"){bchecked=true;}else{bchecked=true;}
if(!bchecked)return abort(f.hotratebutton[0],msg);}
if(c=f.First_Name){msg="Please enter your first name as the primary contact.";c.value=c.value.replace(/^\s+|\s+$/g,"");v=sval(c);if(v==""){return abort(c,msg);}
if(Check_Name_Field(c));else return false;}
if(c=f.Last_Name){msg="Please enter your last name as the primary contact.";c.value=c.value.replace(/^\s+|\s+$/g,"");v=sval(c);if(v==""){return abort(c,msg);}
if(Check_Name_Field(c));else return false;}
if(c=f.Address){c.value=c.value.replace(/^\s+|\s+$/g,"");if(Check_Address_Field(c));else return false;}
if(c=f["Client Email Address"]){msg="Please enter your contact email address so we can send you a confirmation of this booking information.";c.value=c.value.replace(/\s/g,"");v=sval(c);if(v==""){return abort(c,msg);}
if(Check_EmailAddress_Field(c));else return false;if(0==v.search(/\S+@\S+\.\S+/));else return abort(c,msg);}
if(c=f["Phone Number"]){msg="Please enter your contact phone number so we can send you about your reservation request. Please enter one or more phone numbers using digits, spaces, or dashes.";c.value=c.value.replace(/^\s+|\s+$/g,"");v=sval(c);if(v==""){return abort(c,msg);}
if(v.match(/[-0-9 ]+$/));else return abort(c,msg);}
if(c=f["Fax Number"])c.value=c.value.replace(/^\s+|\s+$/g,"");if(c=f.City)c.value=c.value.replace(/^\s+|\s+$/g,"");if(c=f.Zip)c.value=c.value.replace(/^\s+|\s+$/g,"");if(c=f.Country)c.value=c.value.replace(/^\s+|\s+$/g,"");for(idx=1;idx<=6;++idx){if(c=f["Passenger"+idx+"_Name_First"]){msg="You must enter a first name for passenger "+idx+".";if(!c.value.match(/\S/))return abort(c,msg);}
if(c=f["Passenger"+idx+"_Name_Last"]){msg="You must enter a last name for passenger "+idx+".";if(!c.value.match(/\S/))return abort(c,msg);}}
if(c=f["Passenger1_Age"]){msg="You must enter the age of the first passenger (the driver)";if(c.value.match(/^[0-9]+$/));else{var d=f["Car_Option"];if(d.value>0)return abort(c,msg);}}
if(c=f["constructionalert"]){m="You must check the box to show you have read the construction alert.";if(!c.checked)return abort(c,m);}
if(psendsubmitcount>0){window.alert("We are checking your information to be sure everything is filled out. Please be patient. If you cannot seem to get beyond this page, please reload the page and try again.");return false;}
++psendsubmitcount;return true;}