// -----------------------
// function show sub category
// -----------------------

var xmlHttpSubCategory

function loadSubCategory(cat_id)
{ 
//alert("hello");
xmlHttpSubCategory=GetXmlHttpObjectSubCategory()
if (xmlHttpSubCategory==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="include/ajax/sub_category.php"
url=url+"?cat_id="+cat_id
url=url+"&sid="+Math.random()

xmlHttpSubCategory.onreadystatechange=stateChangedSubCategory
xmlHttpSubCategory.open("GET",url,true)
xmlHttpSubCategory.send(null)
}

function stateChangedSubCategory() 
{ 
 if (xmlHttpSubCategory.readyState==4 || xmlHttpSubCategory.readyState=="complete")
 { 
 	document.getElementById("SubCategorys").innerHTML=xmlHttpSubCategory.responseText;
 }
 else
 {
	document.getElementById("SubCategorys").innerHTML="<img src='include/ajax/ajax-loader.gif'>";
 }
}

function GetXmlHttpObjectSubCategory()
{
var xmlHttpSubCategory=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttpSubCategory=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttpSubCategory=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttpSubCategory=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttpSubCategory;
}