var xmlHttp

function showcat2(brand_id, str) { 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
	  alert ("Your browser does not support AJAX!");
	  return;
	} 
	var url="shop_by_brand_sidebar_cat_2.php";
	url=url+"?brand_id="+ brand_id +"&main_cat_id="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function showinput() { 
	document.getElementById("forminput").style.display = "block";
}

function showcat3(brand_id, cat_1, cat_2) { 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
	  alert ("Your browser does not support AJAX!");
	  return;
	} 
	var url="shop_by_brand_sidebar_cat_3.php";
	url=url+"?brand_id="+brand_id+"&cat_id_1="+cat_1+"&cat_id_2="+cat_2;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged() { 
	if (xmlHttp.readyState==4) { 
		document.getElementById("sidebar2").innerHTML = xmlHttp.responseText;
	}
}

function GetXmlHttpObject() {
	document.getElementById('sidebar2').innerHTML = '<img src="images/loading.gif" />';
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;
}