var xmlHttp

function showprj()
{
	str=document.searchprojectname.searchprjname.value;
	//alert(str);
	if(document.searchprojectname.searchprjname.value=='')
	{
	document.getElementById("tablediv").style.display="none";
	document.getElementById("a").innerHTML=" ";
	}	
	else
	{
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
  		{
  			alert ("Browser does not support HTTP Request")
  			return
  		} 
	
		var url="outputproj.php"
		url=url+"?strloc="+str
		xmlHttp.onreadystatechange=addprj
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)		
		document.getElementById("tablediv").style.display="block";
	}
}

function addprj(a)
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("tablediv").innerHTML=xmlHttp.responseText
 	} 
	else
	document.getElementById("tablediv").innerHTML="<img src='images/123.gif' />";
}

function citychange1(id)
{
	//id=document.form1.state.value;
	
	//alert(id);
	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request")
  		return
  	} 
	
var url="outputcity.php"
url=url+"?stateid="+id
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("ajcity1").innerHTML=xmlHttp.responseText
		
 	} 
	else
	document.getElementById("ajcity1").innerHTML="<img src='images/123.gif' />";
}
////////////////////////////////////////////////////////////////////////////////////////
function locationchange(id)
{
	//id=document.searchform.city.value;	
	//alert(id);	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request")
  		return
  	} 	
var url="outputlocation.php"
url=url+"?locationid="+id
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=cityChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 
function cityChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("ajlocation").innerHTML=xmlHttp.responseText
		
 	} 
	else
	document.getElementById("ajlocation").innerHTML="<img src='images/123.gif' />";
	
}

//////////////////////////////////////////////////////////////////////////////////////////////////


/*function showloc()
{
	city=document.searchform.city.value;
	str=document.searchform.location.value;
	if(document.searchform.location.value=='')
	{
	document.getElementById("tablediv").style.display="none";
	document.getElementById("a").innerHTML=" ";
	}	
	else
	{
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
  		{
  			alert ("Browser does not support HTTP Request")
  			return
  		} 
	
		var url="outputloc.php"
		url=url+"?strloc="+str
		url=url+"&city="+city
		url=url+"&sid="+Math.random()
		xmlHttp.onreadystatechange=stateC
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)		
		document.getElementById("tablediv").style.display="block";
	}
}*/

/////////////////////////Requirment Location//////////
function locationchangereq(id)
{

	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request")
  		return
  	} 
	
var url="outputlocation_req.php"
url=url+"?locationid="+id
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=cityChangedr
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 
function cityChangedr() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("ajlocationreq").innerHTML=xmlHttp.responseText
		
 	} 
	else
	document.getElementById("ajlocationreq").innerHTML="<img src='images/123.gif' />";
	
}

//////////////////////////////////////////////////////////////////////////////////////////////////


function showloc()
{
	city=document.searchform.city.value;
	str=document.searchform.location.value;
	if(document.searchform.location.value=='')
	{
	document.getElementById("tablediv").style.display="none";
	document.getElementById("a").innerHTML=" ";
	}	
	else
	{
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
  		{
  			alert ("Browser does not support HTTP Request")
  			return
  		} 
	
		var url="outputloc.php"
		url=url+"?strloc="+str
		url=url+"&city="+city
		url=url+"&sid="+Math.random()
		xmlHttp.onreadystatechange=stateC
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)		
		document.getElementById("tablediv").style.display="block";
	}
}


function stateC() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("tablediv").innerHTML=xmlHttp.responseText
 	} 
	else
	document.getElementById("tablediv").innerHTML="<img src='images/123.gif' />";
}

////////////////////////////////////////////////////////////////////////////////////////

function ajaxfilter()
{
	
	id=document.form1.filterproperty.value;
	ptype=document.form1.hidswhat.value;
	//alert(id);
	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request")
  		return
  	} 
	
var url="outputfilter.php"
url=url+"?property="+id+"&ptype="+ptype
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=statefilter 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function statefilter() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("filterdiv").innerHTML=xmlHttp.responseText
 	}
	else
	document.getElementById("filterdiv").innerHTML="<img src='images/123.gif' />";
}

//////////////////////////////////////////////////////////////////////////////////////////////
function citychange(id)
{
	//alert(id);
	//id=document.form1.state.value;
	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request")
  		return
  	} 
	
var url="outputcity.php"
url=url+"?stateid="+id
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateCity
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 
function stateCity() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("ajcity").innerHTML=xmlHttp.responseText		
 	} 
	else
	document.getElementById("ajcity").innerHTML="<img src='images/123.gif' />";
}

/////////Start Requirment city /////
function citychangereq(id)
{
	
	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request")
  		return
  	} 
	
var url="outputcityreq.php"
url=url+"?stateid="+id
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateCityreq
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 
function stateCityreq() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("ajcityreq").innerHTML=xmlHttp.responseText		
 	} 
	else
	document.getElementById("ajcityreq").innerHTML="<img src='images/123.gif' />";
}

/////////End Requirment city //////////
///////////////////////////////////////////////////////////////////////////////////////////////

function addloc(a)
{
	document.searchform.location.value=document.getElementById(a).innerHTML;	
	document.getElementById("tablediv").style.display="none";	
}
///////////////////////////////////////////////////////////////////////////////////////////////
function displayprop(id)
{
	//alert(id);
	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request")
  		return
  	} 
	
	var url="outputproject.php"
	url=url+"?id="+id
	url=url+"&sid="+Math.random()
	//alert(url);
	xmlHttp.onreadystatechange=stateProject
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateProject() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("properties").innerHTML=xmlHttp.responseText		
 	} 
	else
	document.getElementById("properties").innerHTML="<img src='images/123.gif' />";
}


//////////////////////////////////////////////////////////////////////////////////////////////

function countrychange(id)
{
	//alert(id);
	//id=document.form1.state.value;
	
	//alert(id);
	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request")
  		return
  	} 
	
var url="outputstate.php"
url=url+"?countryid="+id
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateState
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 
function stateState() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("ajstate").innerHTML=xmlHttp.responseText		
 	}
	else
	document.getElementById("ajstate").innerHTML="<img src='images/123.gif' />";
}

///////////////////////////////////////////////////////////////////////////////////////////////

function showproperty()
{
	str=document.searchp.searchprod.value;
	if(document.searchp.searchprod.value=='')
	{
		document.getElementById("tablediv").style.display="none";
		document.getElementById("a").innerHTML=" ";
	}	
	else
	{
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
  		{
  			alert ("Browser does not support HTTP Request")
  			return
  		} 
	
		var url="outputloc.php"
		url=url+"?strloc="+str
		xmlHttp.onreadystatechange=stateC
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)		
		document.getElementById("tablediv").style.display="block";
	}
}

function stateC() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("tablediv").innerHTML=xmlHttp.responseText
 	} 
	else
	document.getElementById("tablediv").innerHTML="<img src='images/123.gif' />";
}

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