var xmlHttp1;
var xmlHttp2;
function show(category)
{ 
xmlHttp1=GetXmlHttpObject();
xmlHttp2=GetXmlHttpObject();
if (xmlHttp1==null || xmlHttp2==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
 
xmlHttp1.onreadystatechange=stateChanged;
xmlHttp2.onreadystatechange=stateChanged;
xmlHttp1.open("GET","category.php?cat="+category+"",true);
xmlHttp2.open("GET","adv.php?adv="+category+"",true);
xmlHttp1.send(null);
xmlHttp2.send(null);
}

function stateChanged() 
{ 
if (xmlHttp1.readyState==4 || xmlHttp2.readyState==4)
{ 
document.getElementById("txt").innerHTML=xmlHttp1.responseText;
document.getElementById("adv").innerHTML=xmlHttp2.responseText;
}
else {
document.getElementById("txt").innerHTML="<span align='center'><img src='images/loader.gif'></span>";
} 
}

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