<!-- Begin
function checkDates(whichForm){
if(whichForm=='basic'){
	var a = document.basic.ArrivalDate.selectedIndex;
	// Set the Start Date Object
	var AmonthYstr =  document.basic.ArrivalDate.options[a].text;
	var AmonthYarr = AmonthYstr.split(" ");
	startDate = new Date(AmonthYarr[1] + ' ' + AmonthYarr[2]+ ' ' + AmonthYarr[3]);

	var d = document.basic.DepartureDate.selectedIndex;
	// Set the Start Date Object
	var DmonthYstr =  document.basic.DepartureDate.options[d].text;
	var DmonthYarr = DmonthYstr.split(" ");
	endDate = new Date(DmonthYarr[1] + ' ' + DmonthYarr[2]+ ' ' + DmonthYarr[3]);

	var at = document.basic.ArrivalHourMin.selectedIndex;
	var arrivalTime = document.basic.ArrivalHourMin.options[at].value;
	var dt = document.basic.DepartureHourMin.selectedIndex;
	var departureTime = document.basic.DepartureHourMin.options[dt].value;
	
	var amonth = document.basic.ArrivalDate.value;
	var dmonth = document.basic.DepartureDate.value;
	
	
} else {
	// Arrival Dates
	my = document.advanced.my.selectedIndex;
	day = document.advanced.day.selectedIndex;
	var AmonthYstr =  document.advanced.my.options[my].text;
	var AmonthYarr = AmonthYstr.split(" ");
	// Departure Dates
	r_my = document.advanced.r_my.selectedIndex;
	r_day = document.advanced.r_day.selectedIndex;
	var DmonthYstr =  document.advanced.r_my.options[r_my].text;
	var DmonthYarr = DmonthYstr.split(" ");
	
	
	
	// Set the Start Date Object
	startDate = new Date(AmonthYarr[0] + ' ' + document.advanced.day.options[day].text + ' 20' + AmonthYarr[1]);
	// Set the endDate object
	endDate = new Date(DmonthYarr[0] + ' ' + document.advanced.r_day.options[r_day].text + ' 20' + DmonthYarr[1]);

	var at = document.advanced.ArrivalHourMin.selectedIndex;
	var arrivalTime = document.advanced.ArrivalHourMin.options[at].value;
	var dt = document.advanced.DepartureHourMin.selectedIndex;
	var departureTime = document.advanced.DepartureHourMin.options[dt].value;
}

today = new Date();
today.setSeconds(0); today.setMilliseconds(0); today.setHours(0); today.setMinutes(0);

daysLeft = (endDate.getTime() - startDate.getTime()) / 86400000 ;
daysLeft = Math.round(daysLeft) ; //returns days left in the year 
var why = '';

	if (today.getTime() > startDate.getTime()){
		why = 'You cannot book BEFORE TODAY - please change your parking dates accordingly \n';
		}
	if (daysLeft<1){
		why = 'Please select a return date AFTER your arrival date \n';
	} 

	if (dmonth=="select") {
		why = why + 'Please select a return date \n';
	}
	
	if (amonth=="select") {
		why = why + 'Please select an arrival date \n';
	}


	if (departureTime=="") {
		why = why + 'Please select a return time \n';
	}
	
	if (arrivalTime=="") {
		why = why + 'Please select an arrival time \n';
	}
	
	if (why !='') {
		alert(why);
return false;
	} else {
		if (whichForm=='basic'){
			document.basic.submit();
		} else {
			document.advanced.submit();		
		}
	}
}

// To show a group of layers and hide another load:
// toggle('layer1,layer2','layer3,layer4');
// or just 1
// toggle('layer1','layer2');
function toggle(theShow,theHide){ 
	 theDivs = theShow.split(',');
	 theOthers = theHide.split(',');
	 // Show loop
	 for(var i = 0; i < theDivs.length; i++)
	 {
	 	var toshow = document.getElementById(theDivs[i]);
		 if(toshow.style.display == ""){ 
			  toshow.style.display = "block"; 
		 }else{ 
			  toshow.style.display = ""; 
		 } 	 	
	 }
	 
	 // Hide loop
	 for(var i = 0; i < theOthers.length; i++)
	 {
	 	var tohide = document.getElementById(theOthers[i]);
		 if(tohide.style.display == ""){ 
			  tohide.style.display = "none"; 
		 }else{ 
			  tohide.style.display = "none"; 
		 } 	 	
	 }	
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function popwin(aPage, aTarget, w, h, var1, var2){
// dreamweaver sucks.
	x = (640 - w)/2, y = (480 - h)/2;
    if (screen) {
        y = (screen.availHeight - h)/2;
        x = (screen.availWidth - w)/2;
    } 
    
        window.open(aPage,aTarget,'status=no,top=0,left=0,scrollbars=yes,resizable=' +((var1=='resize' || var2=='resize')? 'yes' : 'no')+ ',width='+w+',height='+h+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}

function post_quote_ref(form) 
{
	// post the form to a popup	
	var url =  'http://'+ window.location.hostname + form.action + '/?'; 
	var valid_email = (form.email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
	if (valid_email && form.name.value!=''){
		for (var i = 0; i<form.elements.length; i++) {
			  url += form.elements[i].name + '=' + escape(form.elements[i].value) + '&';
		}
		postwin = popwin(url,'postwin',300,300);
	} else {
		alert('You need to enter a valid email address and a name before submitting this form. Thanks');
	}
}
// -->