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

function checkform() {
	var theForm = document.hxparkform;
	var arrival = theForm.ArrivalHourMin.value;
	var depart = theForm.DepartureHourMin.value;
	
	arrivalyear = theForm.my.options[theForm.my.selectedIndex].value.substr(3,4);
	arrivalmonth = theForm.my.options[theForm.my.selectedIndex].value.substr(0,3);

	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;
	}
	

	arrivalday = theForm.day.options[theForm.day.selectedIndex].value;
	arrivalhour = theForm.ArrivalHourMin.options[theForm.ArrivalHourMin.selectedIndex].value.substr(0,2);
	arrivalmin = theForm.ArrivalHourMin.options[theForm.ArrivalHourMin.selectedIndex].value.substr(3,2);

	departyear = theForm.r_my.options[theForm.r_my.selectedIndex].value.substr(3,4);
	departmonth = theForm.r_my.options[theForm.r_my.selectedIndex].value.substr(0,3);
	
	
	if(departmonth == "JAN") {
	departmonth = 1;
	}
	
	if(departmonth == "FEB") {
	departmonth = 2;
	}
	
	if(departmonth == "MAR") {
	departmonth = 3;
	}
	
	if(departmonth == "APR") {
	departmonth = 4;
	}
	
	if(departmonth == "MAY") {
	departmonth = 5;
	}
	
	if(departmonth == "JUN") {
	departmonth = 6;
	}
	
	if(departmonth == "JUL") {
	departmonth = 7;
	}
	
	if(departmonth == "AUG") {
	departmonth = 8;
	}
	
	if(departmonth == "SEP") {
	departmonth = 9;
	}
	
	if(departmonth == "OCT") {
	departmonth = 10;
	}
	
	if(departmonth == "NOV") {
	departmonth = 11;
	}
	
	if(departmonth == "DEC") {
	departmonth = 12;
	}
	

	departday = theForm.r_day.options[theForm.r_day.selectedIndex].value;

	departhour = theForm.DepartureHourMin.options[theForm.DepartureHourMin.selectedIndex].value.substr(0,2);
	departmin = theForm.DepartureHourMin.options[theForm.DepartureHourMin.selectedIndex].value.substr(3,2);
	
	arrivaldate = new Date(arrivalyear,arrivalmonth-1,arrivalday,arrivalhour,arrivalmin);
	departdate = new Date(departyear,departmonth-1,departday, departhour, departmin);
	theday = new Date();

	if ((arrival == 'select' || depart == 'select')){
     	alert('Please enter your approximate arrival and departure time'); 
	theForm.ArrivalHourMin.focus();
        return false;
    	}
	if (departdate < arrivaldate){
     	alert('Your return date is before your arrival date'); 
	theForm.my.focus();
        return false;
    	}
	if (arrivaldate < theday){
     	alert('The time/date you have chosen has now passed - please re-select'); 
	theForm.r_my.focus();
        return false;
    	}
	  
    return true;
}





