var xmlHttp_nw

function getstate(str,page,id)
{ 

	xmlHttp_nw=GetXmlHttpObject()
	if (xmlHttp_nw==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

	var url=page;	
	url=url+"?q="+str+"&page="+id;
	//url=url+"&sid="+(Math.random()/0.1)
	xmlHttp_nw.open("GET",url,true)
	xmlHttp_nw.send(null)
	xmlHttp_nw.onreadystatechange=stateChanged_nwq 
}

function stateChanged_nwq() 
{ 
	if (xmlHttp_nw.readyState==4 || xmlHttp_nw.readyState=="complete")
	{ 
		document.getElementById("state").innerHTML=xmlHttp_nw.responseText 
	} 
}

function GetXmlHttpObject()
{
	var xmlHttp_nw=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp_nw=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp_nw=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp_nw=new ActiveXObject("Microsoft.XMLHTTP");
		}
}
return xmlHttp_nw;
}
