function checkformhotel() {
var thefrm = document.hxhotelform;
var y1 = "htt";
var y2 = "ps://secure.holidayextras.c";
var y3 = "o.uk/hotels/c/availability/";
var y4 = "p://www.holidayextras.c";
var y5 = "o.uk/email/bookingengine/redirect_hotel.asp";

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('Your arrival date cannot be BEFORE today'); 
	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 = "toolkithotels";
thefrm.airport.value = "MAN";
thefrm.method = "get";
thefrm.action = y1+y4+y5;
} else {
thefrm.action = y1+y2+y3;
thefrm.method = "post";
}
thefrm.submit();


}