
function getXMLHttpObject()
{
	var xmlHttp = null;
	try{
		xmlHttp = new XMLHttpRequest(); // for mozila,firefox,opera
	}
	catch(e){
		//for internet explorer
		try{
			xmlHttp = new AcctiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}


function check_count()
{
	
	//alert(ref.value)
	xmlHttp = getXMLHttpObject();
	if(xmlHttp == null)
	{
		alert("Browser Doesnot Support AJAX");
		return false;
	}
	
	url = "check_count.php";
	//alert(url)
	xmlHttp.onreadystatechange = checkcontactidChanged;
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function checkcontactidChanged()
{
	//alert(xmlHttp.readyState)
	if(xmlHttp.readyState == 4)
	{
		//alert(xmlHttp.responseText)
		
		document.getElementById("cont").value = xmlHttp.responseText;
		//alert(document.getElementById("cont").value)
	}
}


