

// Modulo AJAX  para la guia
var oXML = false;
var txt1 = "<applet code=\"fader.class\" width=\"300\" height=\"100\"> \r\n " +
	 "<param name=\"bgcolor\" value=\"#EEEEEE\"> \r\n " +   
  "<param name=\"fontname\" value=\"Helvetica\"> \r\n " +
  "<param name=\"fontsize\" value=\"13\"> \r\n " +
  "<param name=\"fontstyle\" value=\"Bold\"> \r\n " +
  "<param name=\"fadedelay\" value=\"25\"> \r\n " +
  "<param name=\"image\" value=\"images/news.jpg\"> \r\n " ;


  
 var txt2 = " </applet>"

function AJAXCrearObjeto(){  
 var obj;
 
 if(window.XMLHttpRequest) { // no es IE  
	obj = new XMLHttpRequest();  
	if (obj.overrideMimeType) {
                obj.overrideMimeType('text/html');
                // Ver nota sobre esta linea al final
            }

 } else { // Es IE o no tiene el objeto  
  try {
               obj = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    obj = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }

 }  
 return obj;  
}


function getEl(id) {
var el;

ns4 = (document.layers)? true:false;
ie = (document.all)? true:false;
ns7 = (document.getElementById)? true:false;


	if (ns4)  el = document.layers[id];
	else if (ie)  el = document.all[id];
	else if (ns7)   el = document.getElementById(id);
return el;
}

function ver(){
    // procesar la respuesta
	  if (oXML.readyState == 4) {
          if (oXML.status == 200) {
ns4 = (document.layers)? true:false;
ie = (document.all)? true:false;
ns7 = (document.getElementById)? true:false;
var textoNoti = oXML.responseText;

    //textoNoti = textoNoti.replace("\\n", "");
	//textoNoti = textoNoti.replace("\"", "&quot;");

	if (ns4)  document.layers['news'].innerHTML =  txt1 +  textoNoti + txt2;
	else if (ie) document.all['news'].innerHTML =  txt1 + textoNoti + txt2;
	else if (ns7) document.getElementById('news').innerHTML =  txt1 +  textoNoti + txt2;
  }
}
}

function cargarNews() {
// Creamos el objeto  
oXML = AJAXCrearObjeto();  

// Preparamos la petición  
oXML.open('GET', 'http://www.guiadelcomprador.com/news.asp');  
//oXML.open('GET', 'http://fware/trescantos/news_service?dest=guia');  


 // Preparamos la recepción  
oXML.onreadystatechange = ver;
//Realizamos la petición  
oXML.send('');  
}


// Fin del modulo  