var xmlHttp

function showads(catid)


{

	

xmlHttp=GetXmlHttpObject()


if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
  

var url="show.php";

url=url+"?pub_id="+catid;
// alert(url); 
//

url=url+"&sid="+Math.random()


xmlHttp.onreadystatechange=stateChanged

//alert(xmlHttp.onreadystatechange);
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 


 //window.location="cars_cat.php?&cat_id="+xmlHttp.responseText;
// document.getElementById(val2).innerHTML=xmlHttp.responseText 
 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 



 document.getElementById('showads').innerHTML=xmlHttp.responseText 
//document.getElementById('showads').style.display = 'none';

 } 
 
 
}

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");
  }
 }
// alert(xmlHttp.onreadystatechange);
return xmlHttp;
}
