var xmlHttp
var div
function showAvailability(url,target_div){ 
		div = target_div;
		document.getElementById(div).innerHTML = "Sending Mail<BR><img src='images/loading.gif'>";
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null){
			alert ("Browser does not support HTTP Request")
			return
		} 
		xmlHttp.onreadystatechange=stateChanged 
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
}

function stateChanged(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		if(xmlHttp.responseText=="sent"){
			document.getElementById(div).innerHTML=	"Your enquiry is being sent. You will be re-directed automatically.<bR><br><a href='index.html'>Click here</a> to reach home page";	
			document.location.href="index.html";
		}else{
			document.getElementById(div).innerHTML=xmlHttp.responseText 
		}
	} 
} 

function GetXmlHttpObject(){ 
	var objXMLHttp=null
	if (window.XMLHttpRequest){
		objXMLHttp=new XMLHttpRequest()
	}else if (window.ActiveXObject){
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}