var xmlHttp


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


// ===============   subcategory list view

function showSubCategory(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="get-subcategory.php"
url=url+"?catid="+str
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("SUBCATEGORYelement").innerHTML=xmlHttp.responseText 
 } 
}


// ===============   END subcategory list view





function subcatdropdown(str)
{ 
xmlHttp=GetXmlHttpObject()


if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="get-subcatdropdown.php"
url=url+"?mcatid="+str
xmlHttp.onreadystatechange=changedropdown 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function changedropdown() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("SubCatDropDown").innerHTML=xmlHttp.responseText 
 } 
}
function statedropdown(str)
{ 
xmlHttp=GetXmlHttpObject()


if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="get-metrodropdown1.php"
url=url+"?scatid="+str
xmlHttp.onreadystatechange=changedropdown1 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function changedropdown1() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("StateDropDown").innerHTML=xmlHttp.responseText 
 } 
}


function searchcatdropdown(str)
{ 
xmlHttp=GetXmlHttpObject()


if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="search-subcatdropdown.php"
url=url+"?mitemservice="+str
xmlHttp.onreadystatechange=changesearchdropdown 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function changesearchdropdown() 
{ 
 if (xmlHttp.readyState==1 )
 { 
 document.getElementById("SearchBoxCatList").innerHTML="<span class=error>Loading...</span>" 
 } 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("SearchBoxCatList").innerHTML=xmlHttp.responseText 
 } 
}

function searchstatedropdown(str)
{ 
xmlHttp=GetXmlHttpObject()


if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="search-subcitydropdown.php"
url=url+"?mstate="+str
xmlHttp.onreadystatechange=changesearchdropdown2 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function changesearchdropdown2() 
{ 

if (xmlHttp.readyState==1 )
 { 
 document.getElementById("SearchBoxCityList").innerHTML="<span class=error>Loading...</span>" 
 } 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("SearchBoxCityList").innerHTML=xmlHttp.responseText 
 } 
}


