var xmlHttp;
function funPopulate(str){ 
	//	alert(" WITHIN AJAX CODE ");		
	//var str=str123.value;
	//alert(str);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return;
	} 
	var url= "/ipru/Ajax_search.jsp";
	var data = "password="+str;
	//alert("url==="+url);
	

    var browserName=navigator.appName;        // For Internet Explorer
//alert(browserName);
	xmlHttp.onreadystatechange=stateChange;
	if(browserName=="Netscape")
    { 
	//alert("inside if true");
	xmlHttp.open("POST",url,false);
	//alert("stateChange--->"+xmlHttp.readyState+"----->"+xmlHttp.responseText);
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		respString = xmlHttp.responseText;
		//alert("stateChange--->"+respString);
	     document.form1.password.value = respString;
	 }

    }
    else
    {
	//alert("inside else false");
		xmlHttp.open("POST",url,false);
  }
   // 	xmlHttp.open("GET",url,true);
	
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	
	xmlHttp.send(data);
	
}

function GetXmlHttpObject(){
    var xhr; 
	if (window.XMLHttpRequest)     // Object of the current windows
	{ 
    		xhr = new XMLHttpRequest();     // Firefox, Safari, ...
	} 
	else if (window.ActiveXObject)   // ActiveX version
 	{
    		xhr = new ActiveXObject("Microsoft.XMLHTTP");  // Internet Explorer 
 	} 
	return xhr;
    }
    //xhr.onreadystatechange=stateChange;
	

  function stateChange() 
{
	//alert("inserting stateChange--->"+xmlHttp.readyState);

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		respString = xmlHttp.responseText;
		//alert("stateChange--->"+respString);
	     document.form1.password.value = respString;
	     
	} 
}