    $(function(){
        // Datepicker
		$("#cal").datepicker({
			showOn: 'button',
			buttonImage: 'calendar.jpg',
			buttonImageOnly: true,
			dateFormat: 'd/m/yy',
			minDate: 0, 
			maxDate: '+1Y',
			onSelect: function(selectedDate) {
				var SptDate = selectedDate.split("/");				
				$("#Arrival_Day_ID").val(SptDate[0]);
				$("#Arrival_Month_ID").val(SptDate[1]);
				$("#Arrival_Year_ID").val(SptDate[2]);
				AddDays();				
			}
		});		
    });

	
function AddDays() {
	var thisform   = document.FindHotel;
	var val_day    = thisform.Arrival_Day_ID.options[thisform.Arrival_Day_ID.selectedIndex].value;
	var val_month  = thisform.Arrival_Month_ID.options[thisform.Arrival_Month_ID.selectedIndex].value;
	var val_year   = thisform.Arrival_Year_ID.options[thisform.Arrival_Year_ID.selectedIndex].value;
	
	var NNights = thisform.Nights.value;	
	var ETA = new Date();	
	ETA = new Date(val_year, val_month-1, val_day, 12, 0, 0, 0)
			
	ETA = Date.parse(ETA);
	ETA = parseInt(ETA, 10);
	ETA = ETA + NNights*(24*60*60*1000);
	Depart = new Date(ETA);
		 
	var Mn = eval(parseInt(Depart.getMonth())+1);
	var month;
	switch (Mn) {
	 case 1:
         month = 'Jan';
         break;
      case 2:
         month = 'Feb';
         break;
      case 3:
         month = 'Mar';
         break;
      case 4:
         month = 'Apr';
         break;
      case 5:
         month = 'May';
         break;
      case 6:
         month = 'Jun';
         break;
      case 7:
         month = 'Jul';
         break;
      case 8:
         month = 'Aug';
         break;
      case 9:
         month = 'Sep';
         break;
      case 10:
         month = 'Oct';
         break;
      case 11:
         month = 'Nov';
         break;
      case 12:
         month = 'Dec';
         break;
	  } 

	var PadM = (Mn < 10) ? '0' + Mn : Mn;	
	var PadD = (Depart.getDate() < 10) ? '0' + Depart.getDate() : Depart.getDate();
	thisform.Departure.value = Depart.getFullYear()+"/"+PadM+"/"+PadD;

	var DepTxt = document.getElementById("Dep");
   	DepTxt.firstChild.nodeValue= Depart.getDate()+" "+month+" "+Depart.getFullYear();

	val_month = (val_month < 10) ? '0' + val_month : val_month;
	val_day = (val_day < 10) ? '0' + val_day : val_day;	
	thisform.Arrival.value = val_year+"/"+val_month+"/"+val_day;
}

function CheckBooking(frm) {
	var thisform   = document.FindHotel;
	var val_day    = thisform.Arrival_Day_ID.options[thisform.Arrival_Day_ID.selectedIndex].value;
	var val_month  = thisform.Arrival_Month_ID.options[thisform.Arrival_Month_ID.selectedIndex].value;
	var val_year   = thisform.Arrival_Year_ID.options[thisform.Arrival_Year_ID.selectedIndex].value;	

	
	var today = new Date();
	var refDate =new Date(val_year, val_month-1, val_day, 12, 0, 0, 0);

	if (refDate.setHours(0,0,0,0) < today.setHours(0,0,0,0)) {
		alert('Please select a date in the future.')
		return false;
	}
}

	selection=0;
	option_selected=0;
	
	function change_pos(val){
		selection=val;
	}
	
	function Slide_Fetch_Regions(this_county) {
		document.getElementById('region_select').innerHTML = '<select class="area"><option>Loading Regions...<\/option><\/select>';
		try {
			displayContent.init(['hotels/ajax/fetch_regions.php?mode=text&county=' + this_county],['region_select']);
		} catch(e) {
			displayContent.init(['hotels/ajax/fetch_regions.php?mode=text&county=' + this_county],['region_select']);
		}
	}
	
	function getIndex(menu, value){
		var result = -1;
		var index = 0;
		
		var this_menu = document.getElementById(menu);
		
		while(index < this_menu.length && result == -1) {
			if(this_menu[index].value == value) {
				result = index;
			} else {
				index++;
			}
		}
		
		return result;
	}
	
	function loadCities(city) {
		// Select County
		var this_index;
		
		this_index = getIndex('county_select', city);
		
		var menu = document.getElementById('county_select');
		
		menu.selectedIndex = this_index;
		
		if(this_index > -1) {
			// Select Region
			Slide_Fetch_Regions(city);
		}
	}

	function AddFav(title, url)
	{
		if (document.all)
		{
			window.external.AddFavorite(url, title);
		}
		else if (window.sidebar)
		{
			window.sidebar.addPanel(title, url, '');
		}
	}

//-->

