var xmlHttp
<!-- Begin Function 'showRate' Structure --> 
function showRate(str, by, supporter, checkin, checkout, night, room, extrabed, adult, child)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	
	var url="components/com_reservation/getrate.php"
	
	url=url+"?q="+str+"&by="+by+"&supporter="+supporter+"&checkin="+checkin+"&checkout="+checkout+"&night="+night+"&room="+room+"&extrabed="+extrabed+"&adult="+adult+"&child="+child
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChangedRate
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChangedRate()
{ 
	try{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById("Rate").innerHTML=xmlHttp.responseText			
		}	else	{	
			document.getElementById("Rate").innerHTML="<image src='images/others/loading1.gif' width='32' height='32'><b>Checking availability...</b>";
		}
	}
	catch(e){
		// caught an error
		alert('Response failed.');		
	}
}
<!-- End Function 'showRate' Structure --> 

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;
}
