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)
	  {
		try
	    {
	      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    catch (e)
	    {
	      //alert("Your browser does not support AJAX!");
	      return false;
	    }
	  }
	}
	return xmlHttp;
}

function showAdText(ad,id)
{
	//alert ("Mostrando anuncio");
	var xmlHttp=GetXmlHttpObject();
	var url="http://www.dipost.es/adserver/print.php?ad=" + ad;
	//alert(url);
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
	} 
	xmlHttp.onreadystatechange=function() 
	{ 
		if (xmlHttp.readyState==4)
		{
		  if (xmlHttp.status==200)
	      {
	      	//alert (xmlHttp.responseText);
	       	document.getElementById(id).innerHTML = xmlHttp.responseText;
	      }
		}
	}
	//alert(xmlHttp.readyState + " -" + url);
	xmlHttp.open("GET",url,true);
	//alert(xmlHttp.readyState);
	xmlHttp.send(null);
}

function showAdTextId(id)
{
	//alert ("Mostrando anuncio");
	var xmlHttp=GetXmlHttpObject();
	var url="http://www.dipost.es/adserver/print.php?id=" + id;
	//alert(url);
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
	} 
	xmlHttp.onreadystatechange=function() 
	{ 
		if (xmlHttp.readyState==4)
		{
		  if (xmlHttp.status==200)
	      {
	      	//alert (xmlHttp.responseText);
	       	document.getElementById(id).innerHTML = xmlHttp.responseText;
	      }
		}
	}
	//alert(xmlHttp.readyState + " -" + url);
	xmlHttp.open("GET",url,true);
	//alert(xmlHttp.readyState);
	xmlHttp.send(null);
}