var xmlHttp

function MuestraContenido(str) {
   xmlHttp = GetXmlHttpObjectContenido()
   if (xmlHttp==null) {
      alert ("El navegador no soporta HTTP Request");
      return;
   }
   var url = str;
   xmlHttp.onreadystatechange = stateChangedContenido
   xmlHttp.open("GET",url,true)
   xmlHttp.send(null)
}   

function stateChangedContenido() { 
   if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
      document.getElementById("textos").innerHTML = xmlHttp.responseText 
   } else {
      document.getElementById("textos").innerHTML = '<div><table width="100%"><tr><td align="center"><img src="images/cargador.gif"></td></tr></table></div>' 
   }
}

function GetXmlHttpObjectContenido() {
   var xmlHttp = null;
   try {
      xmlHttp = new XMLHttpRequest();
   }
   catch (e) {
      try {
         xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
      }
      catch (e) {
         xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
   }
   return xmlHttp;
}
