var xmlHttp;

function checkAvailableID()
{ 
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		 alert ("Browser does not support HTTP Request");
		 return;
	 }else 
	
	var url="getcustomerid.php";
	//var url="http://www.invaterra.com";
	var str=document.getElementById("txtloginid").value;
	if (str != ""){
		
		url=url+"?q="+str;
		
		url=url+"&sid="+Math.random();
		xmlHttp.open("GET",url,true);//alert(url);
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.send(null);	
		 
	}else{
	  document.getElementById("div_txtloginid3").innerHTML = "Enter BPE id";
	  //document.getElementById("div_txtloginid3").style.display ='inline';
	}
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
	 document.getElementById("div_txtloginid").style.display= "none";
	 document.getElementById("div_txtloginid2").style.display= "none";
	 document.getElementById("div_txtloginid3").innerHTML=xmlHttp.responseText;
	 } 
}

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