// JavaScript Document
function CreateObject()
{
 http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }}
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
return http_request;
}
function fLocChange(locId)
{
var url = "ajaxDevelopers.asp";  
var parameters = "locId="+encodeURI(locId); 
var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) { 
	   document.getElementById("divDev").innerHTML=xmlHttp.responseText;
     }  
 }  
 xmlHttp.send(parameters); 
}
function fLocChange1(locId)
{
var url = "ajaxDevelopers1.asp";  
var parameters = "locId="+encodeURI(locId); 
var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) { 
	   document.getElementById("divDev").innerHTML=xmlHttp.responseText;
     }  
 }  
 xmlHttp.send(parameters); 
}

function SerchLoc()
{
var locid=document.getElementById("locid").value;
var devid=document.getElementById("devid").value;
var pType=document.getElementById("pType").value;
var priceRange=document.getElementById("priceRange").value;


if(locid=="" && devid=="" && pType=="" && priceRange==""){
	alert("Please Choose Location or Developer or Property type or Price Range, atleast One.");
	}
else{
	
var url = "SearchResults.asp";  
var parameters = "locid="+encodeURI(locid)+"&devid="+encodeURI(devid)+"&pType="+encodeURI(pType)+"&priceRange="+encodeURI(priceRange); 
document.location="search-results-home.asp?"+parameters
var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) { 
	  var StrSearch=xmlHttp.responseText.split("$")
	  
	   document.getElementById("resultDiv").style.visibility="visible";
	   document.getElementById("divSearch").innerHTML=StrSearch[0];
	   document.getElementById("spanTotal").innerHTML=StrSearch[1];
     }  
 }  
 xmlHttp.send(parameters); 
}}

function SerchLoc1()
{
var keyword=document.getElementById("keyword").value;
if(keyword==""){
	alert("Please Enter Project.");
	}
else{
var url = "SearchResults.asp";  
var parameters = "keyword="+encodeURI(keyword); 
document.location="search-results-home.asp?"+parameters

var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) { 
	   var StrSearch=xmlHttp.responseText.split("$")
	   document.getElementById("resultDiv").style.visibility="visible";
	   document.getElementById("divSearch").innerHTML=StrSearch[0];
	   document.getElementById("spanTotal").innerHTML=StrSearch[1];
     }  
 }  
 xmlHttp.send(parameters); 
}}
