       function UpdateDropOffLocation(pickUpLocationID, dropOffLocationID) {
       	if (!document.getElementById) return false;

       	// Get date textboxes
       	var ddPickUp = document.getElementById(pickUpLocationID);
       	var ddDropOff = document.getElementById(dropOffLocationID);

       	//			if ( ddDropOff.value == 0)
       	//			{
       	ddDropOff.selectedIndex = ddPickUp.selectedIndex;
       	//			}

       }

       function MoveDropOffDate(pickUpDateID, dropOffDateID, cal) {

       	// Ensure DOM scripting is available

       	//TODO: When the date is update by JS the calendar doesn't pick it up
       	// same problem on ggl

       	if (!document.getElementById) return false;

       	// Get date textboxes
       	var txtPickUpDate = document.getElementById(pickUpDateID);
       	var txtDropOffDate = document.getElementById(dropOffDateID);
       	//			var calenderAJAX = document.getElementById( cal );			

       	var pickUpDate = new Date(ConvertDateFromUsToUkStyle(txtPickUpDate.value));
       	var dropOffDate = new Date(ConvertDateFromUsToUkStyle(txtDropOffDate.value));

       	// If the dates are valid and pick up is after drop off change the drop off
       	if (dates.compare(pickUpDate, dropOffDate) == 1) {
       		var d = new Date(pickUpDate);
       		d.setDate(d.getDate() + 1);
       		txtDropOffDate.value = d.format("d/M/yyyy");
       		//				calenderAJAX.set_selectedDate = d.format("d/M/yyyy");
       	}
       }

       function MovePickUpDate(pickUpDateID, dropOffDateID) {

       	// Ensure DOM scripting is available
       	if (!document.getElementById) return false;

       	// Get date textboxes
       	var txtPickUpDate = document.getElementById(pickUpDateID);
       	var txtDropOffDate = document.getElementById(dropOffDateID);

       	var pickUpDate = new Date(ConvertDateFromUsToUkStyle(txtPickUpDate.value));
       	var dropOffDate = new Date(ConvertDateFromUsToUkStyle(txtDropOffDate.value));

       	// If the dates are valid and pick up is after drop off change the drop off
       	if (dates.compare(pickUpDate, dropOffDate) == 1) {
       		var d = new Date(dropOffDate);
       		d.setDate(d.getDate() - 1);
       		txtPickUpDate.value = d.format("d/M/yyyy");
       	}
       }


       /*----------------------
       Date Functions 
       ----------------------*/
       function ConvertDateFromUsToUkStyle(dateString) {
       	var dateAr = dateString.split('/');
       	return dateAr[1] + '/' + dateAr[0] + '/' + dateAr[2];
       }

       var dates = {
       	convert: function(d) {
       		return (
					d.constructor === Date ? d :
					d.constructor === Array ? new Date(d[0], d[1], d[2]) :
					d.constructor === Number ? new Date(d) :
					d.constructor === String ? new Date(d) :
					typeof d === "object" ? new Date(d.year, d.month, d.date) :
					NaN
				);
       	},
       	compare: function(a, b) {
       		return (
					isFinite(a = this.convert(a).valueOf()) &&
					isFinite(b = this.convert(b).valueOf()) ?
					(a > b) - (a < b) :
					NaN
				);
       	},
       	inRange: function(d, start, end) {
       		return (
					isFinite(d = this.convert(d).valueOf()) &&
					isFinite(start = this.convert(start).valueOf()) &&
					isFinite(end = this.convert(end).valueOf()) ?
					start <= d && d <= end :
					NaN
				);
       	}
       };

       $(document).ready(function() {
       	$(document).pngFix();
       });