function blockError(){return true;}
window.onerror = blockError;

function checkformhotel() {
var thefrm = document.hxhotelform;

arrivalday = thefrm.day.options[thefrm.day.selectedIndex].value;
arrivalyear = thefrm.my.options[thefrm.my.selectedIndex].value.substr(3,4);
arrivalmonth = thefrm.my.options[thefrm.my.selectedIndex].value.substr(0,3);

if(arrivalday.length < 2) {
arrivalday = "0"+arrivalday;
}

thefrm.ArrivalDate.value = arrivalday+thefrm.my.options[thefrm.my.options.selectedIndex].value;


if(arrivalmonth == "JAN") {
arrivalmonth = 1;
}

if(arrivalmonth == "FEB") {
arrivalmonth = 2;
}

if(arrivalmonth == "MAR") {
arrivalmonth = 3;
}

if(arrivalmonth == "APR") {
arrivalmonth = 4;
}

if(arrivalmonth == "MAY") {
arrivalmonth = 5;
}

if(arrivalmonth == "JUN") {
arrivalmonth = 6;
}

if(arrivalmonth == "JUL") {
arrivalmonth = 7;
}

if(arrivalmonth == "AUG") {
arrivalmonth = 8;
}

if(arrivalmonth == "SEP") {
arrivalmonth = 9;
}

if(arrivalmonth == "OCT") {
arrivalmonth = 10;
}

if(arrivalmonth == "NOV") {
arrivalmonth = 11;
}

if(arrivalmonth == "DEC") {
arrivalmonth = 12;
}


arrivaldate = new Date(arrivalyear,arrivalmonth-1,arrivalday,23,59);
thedate = new Date();
jsdate = DateAdd(thedate, 320, 0, 0);

//alert(jsdate+"\n"+arrivaldate);

theday = new Date();

if (arrivaldate < theday){
     	alert('The time/date you have chosen has now passed - please choose again'); 
	thefrm.day.focus();
        return false;
    	}


if(arrivaldate > jsdate) {
thefrm.outday.value = arrivalday;
thefrm.outdate.value = thefrm.my.options[thefrm.my.selectedIndex].value;
thefrm.profile.value = "bookairporthotels";
thefrm.airport.value = thefrm.Location.value;
thefrm.method = "get";
thefrm.action = "http://www.holidayextras.co.uk/email/bookingengine/redirect_hotel.asp";
} else {
thefrm.action = "https://secure.airportparking-deals-hotels/p/blank,holding";
thefrm.method = "post";
}
thefrm.submit();


}



