	var submitcount = 0;
	function validForm() {
	
		var msg = "";
	
		if (document.form1.depDate.value <= document.form1.arrDate.value) {msg = msg + "Your departure date must be at least 1 day later than your arrival date.\n";}
		if (document.form1.guestAdult.value == "0" && document.form1.guestChild.value == "0") {msg = msg + "You have to book for at least 1 guest.\n";}
		
		document.form1.start_date.value = document.form1.arrivalDate.value;
		document.form1.check_in_date.value = document.form1.arrivalDate.value;
		document.form1.check_out_date.value = document.form1.departureDate.value;
		document.form1.number_adults.value = document.form1.guestAdult.value;
		document.form1.number_children.value = document.form1.guestChild.value;
		
		if (msg != "") {
			alert(msg);
			return false;
		}
		if (submitcount == 0) {
			submitcount++;
			$('#bookingbutton').hide();
			$('#invisible').show();
			_gaq.push(['_trackEvent', 'Book', 'Bookingbar', 'Clicked on booking button',85]);
			_gaq.push(['_trackPageview', '/BookingEngine']);
			return true;
		}
	}

