
//var xmlHttp

function getCategories(catid, subcatid, url)
{ 
	xmlHttp2=GetXmlHttpObject()
	if (xmlHttp2==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="http://"+url+"/ajax_getcategories.php"
	url=url+"?catid="+catid+"&subcatid="+subcatid
	url=url+"&sid="+Math.random()
	xmlHttp2.onreadystatechange=xmlHttp2.onreadystatechange=function() { stateChanged_category(xmlHttp2); } 
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
}



function stateChanged_category(xmlHttp2) 
{ 
	if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete") { 
		document.getElementById("subcat").innerHTML=xmlHttp2.responseText; 
	} 

}



function GetXmlHttpObject()
{
	var xmlHttp2=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
 		xmlHttp2=new XMLHttpRequest();

	}
	catch (e)
	{
		//Internet Explorer
		try
		{
  		xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP");
		}

	}
	return xmlHttp2;
}


