	var ajax = new Array();
	function getLocation(sel,rMode)
	{
		if(rMode==2)
		{
			var locationCode = sel;
		}//end if
		else
		{
			var locationCode = sel.options[sel.selectedIndex].value;
		}//end else
		
		document.getElementById('cmbLocation').options.length = 0;	// Empty city select box
		if(locationCode.length>0){
			var index = ajax.length;
			ajax[index] = new sack();
			
			ajax[index].requestFile = 'getlocations.php?locationCode='+locationCode;	// Specifying which file to get
			ajax[index].onCompletion = function(){ createLocations(index) };	// Specify function that will be executed after file has been found
			ajax[index].runAJAX();		// Execute AJAX function
		}
	}

	function getLocationNew(sel)
	{
		var locationCode = sel;
		document.getElementById('cmbLocation').options.length = 0;	// Empty city select box
		if(locationCode>0){
			var index = ajax.length;
			ajax[index] = new sack();
			
			ajax[index].requestFile = 'getlocations.php?locationCode='+locationCode;	// Specifying which file to get
			ajax[index].onCompletion = function(){ createLocations(index) };	// Specify function that will be executed after file has been found
			ajax[index].runAJAX();		// Execute AJAX function
		}
	}
	
	function createLocations(index)
	{
		var obj = document.getElementById('cmbLocation');
//		alert(ajax[index].response);
		eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
	}
////////////

	function getLocationSearch(sel,nLocId)
	{
		var locationCode = sel;
		document.getElementById('cmbLocation').options.length = 0;	// Empty city select box
		if(locationCode>0){
			var index = ajax.length;
			ajax[index] = new sack();
			
			ajax[index].requestFile = 'getlocations.php?locationCode='+locationCode+'&nLocId='+nLocId;	// Specifying which file to get
			ajax[index].onCompletion = function(){ createLocationsSearch(index) };	// Specify function that will be executed after file has been found
			ajax[index].runAJAX();		// Execute AJAX function
		}
	}

	function createLocationsSearch(index)
	{
		var obj = document.getElementById('cmbLocation');
		eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
	}
	
	function getHotels(sel)
	{
		var locationCode = sel.options[sel.selectedIndex].value;
		document.getElementById('cmbLocation1').options.length = 0;	// Empty hotel select box
		if(locationCode.length>0){
			var index = ajax.length;
			ajax[index] = new sack();
			
			ajax[index].requestFile = '../gethotels.php?locationCode='+locationCode;	// Specifying which file to get
			ajax[index].onCompletion = function(){ createHotels(index) };	// Specify function that will be executed after file has been found
			ajax[index].runAJAX();		// Execute AJAX function
		}
	}

	function createHotels(index)
	{ 
		var obj = document.getElementById('cmbLocation1');
//		alert(ajax[index].response);
		eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
	}


////////////
	function getDateObject(dateString,dateSeperator)
	{
		//This function return a date object after accepting 
		//a date string ans dateseparator as arguments
		var curValue=dateString;
		var sepChar=dateSeperator;
		var curPos=0;
		var cDate,cMonth,cYear;
	
		//extract day portion
		curPos=dateString.indexOf(sepChar);
		cDate=dateString.substring(0,curPos);
		//extract month portion				
		endPos=dateString.indexOf(sepChar,curPos+1);			
		cMonth=dateString.substring(curPos+1,endPos);
	
		//extract year portion				
		curPos=endPos;
		endPos=curPos+5;
		cYear=curValue.substring(curPos+1,endPos);
		//Create Date Object
		dtObject=new Date(cYear,cMonth,cDate);
		return dtObject;
	}


	function emptyCheck(){

		var frm = window.document.frmSearch;
		var seldate = frm.txtEdate.value;
		splitstring = seldate.split("-");
		
		curPos	=	seldate.indexOf("-");
		cMonth	=	seldate.substring(0,curPos);

		endPos	=	seldate.indexOf("-",curPos+1);
		cDate	=	seldate.substring(curPos+1,endPos);
/*
		curPos=seldate.indexOf("-");
		cDate=seldate.substring(0,curPos);

		endPos=seldate.indexOf("-",curPos+1);
		cMonth=seldate.substring(curPos+1,endPos);
*/
		cDate = cDate + "-";
		cMonth= cMonth - 1 ;
		cMonth = "0"+cMonth + "-";
		seldate = cDate + cMonth + splitstring[2];
		dt1	=	getDateObject(seldate,"-");

		var now = new Date();
		var todaysdate = now.getDate() + "-" + now.getMonth() + "-" + now.getFullYear();
		dt2	=	getDateObject(todaysdate,"-");
		if(frm.cmbDestination.value == ""){
			alert('Please select a destination');
			frm.cmbDestination.focus();
			return false;
			exit();
		}else if(frm.cmbLocation.value == "0"){
			alert('Please select a location');
			frm.cmbLocation.focus();
			return false;
			exit();
		}else if(frm.txtEdate.value == ""){
			alert('Please select arrival date');
			return false;
			exit();
		}else if(frm.txtNights.value == ""){
			alert('Please enter no. of nights');
			frm.txtNights.focus();
			return false;
			exit();
		}else if(dt1 < dt2){
			alert("Please select a future date");
			frm.txtEdate.focus();
			return false;
			exit();
		}else{
			scroll(0,300);
			document.getElementById("animation").style.display='block';
			var frm = window.document.frmSearch;
			frm.postback.value = "search";
			frm.action ="searchresult.php";
			//ajaxFileUpload();
			//setTimeout("document.forms[0].submit();", 3000);
			//return false;
		}
	}

	//for admin
	function emptyCheckAdmin(){

		var frm = window.document.frmSearch;
		var seldate = frm.txtEdate.value;
		splitstring = seldate.split("-");
		
		curPos	=	seldate.indexOf("-");
		cMonth	=	seldate.substring(0,curPos);

		endPos	=	seldate.indexOf("-",curPos+1);
		cDate	=	seldate.substring(curPos+1,endPos);
		cDate = cDate + "-";
		cMonth= cMonth - 1 ;
		cMonth = "0"+cMonth + "-";
		seldate = cDate + cMonth + splitstring[2];
		dt1	=	getDateObject(seldate,"-");

		var now = new Date();
		var todaysdate = now.getDate() + "-" + now.getMonth() + "-" + now.getFullYear();
		dt2	=	getDateObject(todaysdate,"-");
		if(frm.cmbDestination.value == ""){
			alert('Please select a destination');
			frm.cmbDestination.focus();
			return false;
			exit();
		}else if(frm.cmbLocation.value == "0"){
			alert('Please select a location');
			frm.cmbLocation.focus();
			return false;
			exit();
		}else if(frm.txtEdate.value == ""){
			alert('Please select arrival date');
			return false;
			exit();
		}else if(frm.txtNights.value == ""){
			alert('Please enter no. of nights');
			frm.txtNights.focus();
			return false;
			exit();
		}else if(dt1 < dt2){
			alert("Please select a future date");
			frm.txtEdate.focus();
			return false;
			exit();
		}else{
			scroll(0,300);
			document.getElementById("animation").style.display='block';
			var frm = window.document.frmSearch;
			frm.postback.value = "search";
			frm.action ="searchresult.php";
			frm.submit();
			return true;
		}
	}

/*	function animate()
	{
		sec = 80000;
		delay = sec*1000;
		//document.getElementById("animation").style.display='block';
		setTimeout(submitform(),delay);
	}
	function submitform()
	{
		var frm = window.document.frmSearch;
		frm.postback.value = "search";
		frm.action ="searchresult.php";
		return true;
	}
function showPrograsBar()
{
	FreezePage();
	document.getElementById('uploadimageloader').style.display='inline';
	
		//PrograsBar =window.open("prograssbar.php",'welcome','resizable=no,width=0,height=0,screenX=150,screenY=150,top=150,left=150');

}
function closePrograsBar(){
		if (PrograsBar && PrograsBar.open && !PrograsBar.closed) PrograsBar.close();
}

function UploadFile(){
      showPrograsBar();
}
function FreezePage()
{
	document.getElementById("parentDiv").style.width = window.screen.width;
	document.getElementById("parentDiv").style.height = window.screen.height*20;
	document.getElementById("parentDiv").style.display = 'inline';

	ShowIndicator();
}

function ShowIndicator()

{
	document.getElementById("waitIndicatorDiv").style.display = 'block';
	animate();
}
*/
function checkNumber(t) {
		if(t.value == 0)
			t.value="";	
		if(t.value.length == 0 ||  isNaN(t.value) || t.value.substr(0,1) == " " || parseInt(t.value) < 0) {
			t.value="";
		}
	}


