//this controls the calendars associated with the pick up and drop off date fields. 

	Calendar.setup(
	{
	inputField : "pickUpDateHidden", // ID of the input field
	ifFormat : "%d %b %Y", // the date format
	button : "pickUpDateSelector", // ID of the button
	weekNumbers : false, //don't show week numbers
	onUpdate : updatePickUpDates,
	electric: false,
	cache: true
	}
	);
	
	Calendar.setup(
	{
	inputField : "dropOffDateHidden", // ID of the input field
	ifFormat : "%d %b %Y", // the date format
	button : "dropOffDateSelector", // ID of the button
	weekNumbers : false, //don't show week numbers
	onUpdate : updateDropOffDates,
	electric: false,
	cache: true
	}
	);
	
	function updatePickUpDates(cal) {
		if (cal.date <= new Date()) {
			//don't allow a date earlier than tomorrow
			adjustDates();
			return;
		}
		 
		dayValue = cal.date.getDate();
		if (dayValue < '10') {	
			dayValue = "0" + dayValue;
		}
		
		//set the "day" part			
		pickUpDay = document.whereWhenForm.pickUpDay;
		pickUpDay.value = dayValue;
		
		//set the "month and year" part
		pickUpMonth = document.whereWhenForm.pickUpMonth;
		pickUpMonth.value = document.whereWhenForm.pickUpDateHidden.value.substr(3);

		//this will cause the function to be called to check if the drop off date needs moving forward		
		adjustDateEntry(pickUpDay,pickUpMonth,document.whereWhenForm.pickUpHour,document.whereWhenForm.pickUpMinute,
			document.whereWhenForm.dropOffDay,document.whereWhenForm.dropOffMonth,document.whereWhenForm.dropOffHour,
			document.whereWhenForm.dropOffMinute,1,document.whereWhenForm.pickUpDateHidden, document.whereWhenForm.dropOffDateHidden);
	}

	function updateDropOffDates(cal) {
		
		if (cal.date <= new Date()) {
			//don't allow a date earlier than tomorrow
			adjustDates();
			return;
		}
		 
		dayValue = cal.date.getDate();
		if (dayValue < '10') {	
			dayValue = "0" + dayValue;
		}
		
		//set the "day" part			
		document.whereWhenForm.dropOffDay.value = dayValue;
		
		//set the "month and year" part
		document.whereWhenForm.dropOffMonth.value = document.whereWhenForm.dropOffDateHidden.value.substr(3);
	}
