function AjaxFunction(cat_name)
{

var httpxml;
try
  {
  // Firefox, Opera 8.0+, Safari
  httpxml=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
		  try
   			 		{
   				 httpxml=new ActiveXObject("Msxml2.XMLHTTP");
    				}
  			catch (e)
    				{
    			try
      		{
      		httpxml=new ActiveXObject("Microsoft.XMLHTTP");
     		 }
    			catch (e)
      		{
      		alert("Your browser does not support AJAX!");
      		return false;
      		}
    		}
  }
function stateck() 
    {
    if(httpxml.readyState==4)
      {
       
	  
var myarray=eval(httpxml.responseText);
 
// Before adding new we must remove previously loaded elements
for(j=document.frmAddProperty.subcat.options.length-1;j>=0;j--)
{
document.frmAddProperty.subcat.remove(j);
}


for (i=0;i<myarray.length;i+=1)
{
var optn = document.createElement("OPTION");
optn.text = myarray[i];
optn.value = myarray[i];
document.frmAddProperty.subcat.options.add(optn);

} 
      }
    }
	var url="sub_prop_type.php";
url=url+"?cat_name="+cat_name;

url=url+"&sid="+Math.random();
httpxml.onreadystatechange=stateck;
httpxml.open("GET",url,true);
httpxml.send(null);
  }
 /*sub categories2 fuction####################################################*/
  
  function SubCat2(cat_id)
{


var httpxml;
try
  {
  // Firefox, Opera 8.0+, Safari
  httpxml=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
		  try
   			 		{
   				 httpxml=new ActiveXObject("Msxml2.XMLHTTP");
    				}
  			catch (e)
    				{
    			try
      		{
      		httpxml=new ActiveXObject("Microsoft.XMLHTTP");
     		 }
    			catch (e)
      		{
      		alert("Your browser does not support AJAX!");
      		return false;
      		}
    		}
  }
function stateck() 
    {
    if(httpxml.readyState==4)
      {

var myarray=eval(httpxml.responseText);
// Before adding new we must remove previously loaded elements
for(j=document.frmAddProperty.subcat2.options.length-1;j>=0;j--)
{

document.frmAddProperty.subcat2.remove(j);
}


for (i=0;i<myarray.length;i+=2)
{

var optn = document.createElement("OPTION");
optn.text = myarray[i];
optn.value = myarray[i+1];
document.frmAddProperty.subcat2.options.add(optn);

} 
      }
    }
	var url="dd.php";
url=url+"?cat_id="+cat_id;

url=url+"&sid="+Math.random();
httpxml.onreadystatechange=stateck;
httpxml.open("GET",url,true);
httpxml.send(null);
  }
  
  /*sub categories3 fuction####################################################*/
  
  function sub_city(city_name)
{


var httpxml;
try
  {
  // Firefox, Opera 8.0+, Safari
  httpxml=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
		  try
   			 		{
   				 httpxml=new ActiveXObject("Msxml2.XMLHTTP");
    				}
  			catch (e)
    				{
    			try
      		{
      		httpxml=new ActiveXObject("Microsoft.XMLHTTP");
     		 }
    			catch (e)
      		{
      		alert("Your browser does not support AJAX!");
      		return false;
      		}
    		}
  }
function stateck() 
    {
    if(httpxml.readyState==4)
      {

var myarray1=eval(httpxml.responseText);


// Before adding new we must remove previously loaded elements
for(j=document.frmAddProperty.location.options.length-1;j>=0;j--)
{

document.frmAddProperty.location.remove(j);
}


for (i=0;i<myarray1.length;i+=1)
{

var optn = document.createElement("OPTION");
optn.text = myarray1[i];
optn.value = myarray1[i];
document.frmAddProperty.location.options.add(optn);

} 
      }
    }
	var url="ajax_sub_city.php";
url=url+"?city_name="+city_name;

url=url+"&sid="+Math.random();
httpxml.onreadystatechange=stateck;
httpxml.open("GET",url,true);
httpxml.send(null);
  }

