function checkit(e,f) { if (e.which) Key = e.which; else Key = e.keyCode; if(Key==13) { if(f=="advhtl") sub_form(); } } function sub_form() { error_msg = ""; destination = document.getElementById("hotel_new_destination").value; hotel_name = document.getElementById("hotel_name").value; checkin = document.getElementById("hotel_checkin_day").value+"/"+document.getElementById("hotel_checkin_months").value+"/"+document.getElementById("hotel_checkin_years").value; checkout = document.getElementById("hotel_checkout_day").value+"/"+document.getElementById("hotel_checkout_months").value+"/"+document.getElementById("hotel_checkout_years").value; if(document.getElementById("hotel_checkin_months").value<10) hcm = "0"+document.getElementById("hotel_checkin_months").value; else hcm = document.getElementById("hotel_checkin_months").value; if(document.getElementById("hotel_checkin_day").value<10) hcd = "0"+document.getElementById("hotel_checkin_day").value; else hcd = document.getElementById("hotel_checkin_day").value; hcy = document.getElementById("hotel_checkin_years").value; if(document.getElementById("hotel_checkout_months").value<10) hom = "0"+document.getElementById("hotel_checkout_months").value; else hom = document.getElementById("hotel_checkout_months").value; if(document.getElementById("hotel_checkout_day").value<10) hod = "0"+document.getElementById("hotel_checkout_day").value; else hod = document.getElementById("hotel_checkout_day").value; hoy = document.getElementById("hotel_checkout_years").value; chi = hcy+hcm+hcd; cho = hoy+hom+hod; cy = eval("year_"+hcy+"["+hcm+"][1]"); if(hcd>cy) {error_msg += "