// JavaScript Document
// @author Ashutosh K Tripathi

var http ; // global variable for ajax xmlhttp request
var lastPriceRow ; // global variable to check what last row was for price/rent details

//function createRequestObject
// @iparam void
// @oparam xmlhttpRequest Object
//function to actually create global xmlhttpRequest Object 
function createRequestObject()
        {
	      var xmlhttp=false;
	      try 
	       {
	 	    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	       }catch (e) 
	        {try 
		     {
			   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	  		 }catch (E) 
		      {
		       xmlhttp = false;
	  	      }
	       }
	     if (!xmlhttp && typeof XMLHttpRequest!='undefined') 
	      {
		   try 
		   {
			xmlhttp = new XMLHttpRequest();
	       }catch (e) 
		    {
			 xmlhttp=false;
		    }
	     }
	    if (!xmlhttp && window.createRequest) 
	    {
		try 
		 {
			xmlhttp = window.createRequest();
		 }catch (e) 
		  {
			xmlhttp=false;
		  }
	  }	
	return xmlhttp;
   } 
function getPropType(colr)
{
	
  http=createRequestObject();
  http.onreadystatechange = function(){getSubCatResponse();};
  http.open("GET", "asphp/SearchProcess.php?culr="+colr, true);
  http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
  http.send(null);
  }

//function getStateByCountryResponse
// @iparam void
// @oparam xmlhttpRequest Object
//response function to get States for a given country using ajax
function getSubCatResponse()
{
	 if(http.readyState==4){	  
	  if(http.status==200){		
	   
	    var response = http.responseText ;
		
		var pro=document.getElementById('ptype');
			pro.innerHTML=response;
	   }
	 }
}

