var xmlHttp

// For all scripts running on AJAX online dynamically.somesh
function dynshowHint(str,sitename,geturl,element_name) {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	document.getElementById(element_name).innerHTML="<center><img src=\"/images-pi/loading.gif\"></center>";
	
	var url=sitename+geturl;
	url=url+"&q="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=
	function dynstateChanged() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
			document.getElementById(element_name).innerHTML=xmlHttp.responseText;
		} 
	};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null)
}

// For all scripts running on AJAX online.somesh
// Start
function showHint(str,sitename,geturl) {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url=sitename+geturl;
	url=url+"&q="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null)
}
// End


function stateChanged() { 
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
		
		document.getElementById('txtHint').style.display = 'block'; 
	} 
}

// For all scripts running on AJAX online if and only if AJAX to runned more than once in a same form.somesh
// Start
function showHint1(str,sitename,geturl) {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url=sitename+geturl;
	url=url+"&q1="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged1;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null)
}
// End


function stateChanged1() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		
		document.getElementById("txtHint1").innerHTML=xmlHttp.responseText;
		
		document.getElementById('txtHint1').style.display = 'block'; 
	} 
}

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


function changeshow(id1) {
	
	var myarray = id1.split("^"); 
	
	if(myarray[0]=='IN')  {
		
		document.getElementById("showstate").style.display='';
		document.getElementById("stateid").style.display='none';
	}
	else{
		
		document.getElementById("showstate").style.display='none';
		
	}
}
	
function getRequest(id1){
	
	
	var myarray = id1.split("^"); 
	
	document.getElementById("ph_ccode").value=myarray[1];
} 



function changeshow1() {
		
	if(document.getElementById("bus_ty").value=='x')  {
		
		document.getElementById("classified").style.display='none';
	}
	else {
		
		document.getElementById("classified").style.display='';
	}
}
