// JavaScript Document
var xmlHttp

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

function showRev(str,hid)
{ 
	if(hid>0)
	{
		hidediv('txtHint');
	}
	showdiv('busy');
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
 	{
		 alert ("Review is not available")
		 return
 	}
	
	var url="require/get_review.php"
	url=url+"?q="+str+"&h="+hid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function()
	{
		
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			hidediv('busy');
			showdiv('txtHint');
			document.getElementById("txtHint").innerHTML=xmlHttp.responseText 		
		} 
		
	}
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}


function showSchedule(HotelId,Arrival,Departure,Nights,Rooms,Children,Adults,Forex,Agent,Allow)
{ 
	if(HotelId>0)
	{
		hidediv('txtHintS');
	}
	showdiv('busyS');
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
 	{
		 alert ("Could not process request")
		 return
 	}
	
	var url="require/get_schedule_MultiSpecial1.php"
	
	url=url+"?Hotel="+HotelId+"&Arrival="+Arrival+"&Departure="+Departure+"&Nights="+Nights+"&Rooms="+Rooms+"&Children="+Children+"&Adults="+Adults+"&Forex="+Forex+"&Agent="+Agent+"&Allow="+Allow
	url=url+"&sid="+Math.random()
	
	
	xmlHttp.onreadystatechange=function()
	{
		
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			hidediv('busyS');
			showdiv('txtHintS');
			document.getElementById("txtHintS").innerHTML=xmlHttp.responseText 		
		} 
		
	}
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
