function createxml(xmlq)
{
        if (window.XMLHttpRequest) 
        { // Mozilla, Safari,...
            xml0 = new XMLHttpRequest();
            if (xml0.overrideMimeType) {
                xml0.overrideMimeType('text/xml');
                // Ver nota sobre esta linea al final
            }
        } else if (window.ActiveXObject) { // IE
            try {
                xml0 = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    xml0 = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        //if(navigator.appName=='Microsoft Internet Explorer')xml0 = new ActiveXObject("Microsoft.XMLHTTP");
        if (!xml0) {
            alert('Falla :( No es posible crear una instancia XMLHTTP');
            
        }else{}
        

        if(xmlq==0)xml =xml0;
        if(xmlq==1)xml1=xml0;
        if(xmlq==2)xml2=xml0;
        if(xmlq==3)xml3=xml0;
        if(xmlq==4)xml4=xml0;
        if(xmlq==5)xml5=xml0;
        if(xmlq==6)xml6=xml0;
        if(xmlq==7)xml7=xml0;
        if(xmlq==8)xml8=xml0;
        if(xmlq==9)xml9=xml0;
}


function timer()
{
d=new Date();
ho=d.getHours();
se=d.getSeconds();
mi=d.getMinutes();
di=d.getDate();
ye=d.getYear();
me=d.getMonth()+1;
if(me<10)me='0'+me;
if(di<10)di='0'+di;
if(ho<10)ho='0'+ho;
if(mi<10)mi='0'+mi;
if(se<10)se='0'+se;

return ye+'/'+me+'/'+di+' '+ho+':'+mi+':'+se;
}

function fechahora()
{
d=new Date();
ho=d.getHours();
se=d.getSeconds();
mi=d.getMinutes();
di=d.getDate();
ye=d.getFullYear();
me=d.getMonth()+1;
if(me*1<10)me='0'+(me*1)
if(di*1<10)di='0'+(di*1)
if(ho*1<10)ho='0'+(ho*1)
if(mi*1<10)mi='0'+(mi*1)



return ye+'-'+me+'-'+di+' '+ho+':'+mi;
}
loadingfl='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="30" HEIGHT="30" ALIGN=""> <PARAM NAME=movie VALUE="banners/loading.swf?'+timer()+'">  <PARAM NAME=quality VALUE=high>  <PARAM NAME=wmode VALUE=transparent> <EMBED src="banners/loading.swf?'+timer()+'" quality=high  WIDTH="30" HEIGHT="30" NAME="loading" ALIGN="" wmode=transparent TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';


    function xml_alert(url) {createxml(0);

        xml.onreadystatechange = alertContents_alert;
        xml.open('GET', url, true);
        xml.send(null);

    }
    function alertContents_alert() {
        if (xml.readyState == 4) {
            if (xml.status == 200) {
                alert(xml.responseText);
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }

    function xml_inner(url,xmlcontenedor) {createxml(0);

        xmlcontenedor.innerHTML=loadingfl;
        xml_contenedor=xmlcontenedor;
        xml.onreadystatechange = alertContents;
        xml.open('GET', url, true);
        xml.send(null);

    }
    function alertContents() {
        if (xml.readyState == 4) {
            if (xml.status == 200) {
                xml_contenedor.innerHTML=xml.responseText;
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }
///*********************************************** 1 *************************************************************************
    function xml_inner1(url1,xmlcontenedor1) {createxml(1);
        xmlcontenedor1.innerHTML=loadingfl;
        xml_contenedor1=xmlcontenedor1;
        xml1.onreadystatechange = alertContents1;
        xml1.open('GET', url1, true);
        xml1.send(null);
    }
    function alertContents1() {
        if (xml1.readyState == 4) {
            if (xml1.status == 200) {
                xml_contenedor1.innerHTML=xml1.responseText;
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }
///******************************************** 2 ****************************************************************************
    function xml_inner2(url2,xmlcontenedor2) {createxml(2);
        xmlcontenedor2.innerHTML=loadingfl;
        xml_contenedor2=xmlcontenedor2;
        xml2.onreadystatechange = alertContents2;
        xml2.open('GET', url2, true);
        xml2.send(null);
    }
    function alertContents2() {
        if (xml2.readyState == 4) {
            if (xml2.status == 200) {
                xml_contenedor2.innerHTML=xml2.responseText;
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }

///********************************************* 3 ***************************************************************************
    function xml_inner3(url3,xmlcontenedor3) {createxml(3);
        xmlcontenedor3.innerHTML=loadingfl;
        xml_contenedor3=xmlcontenedor3;
        xml3.onreadystatechange = alertContents3;
        xml3.open('GET', url3, true);
        xml3.send(null);
    }
    function alertContents3() {
        if (xml3.readyState == 4) {
            if (xml3.status == 200) {
                xml_contenedor3.innerHTML=xml3.responseText;
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }

///********************************************** 4 **************************************************************************
    function xml_inner4(url4,xmlcontenedor4) {createxml(4);
        xmlcontenedor4.innerHTML=loadingfl;
        xml_contenedor4=xmlcontenedor4;
        xml4.onreadystatechange = alertContents4;
        xml4.open('GET', url4, true);
        xml4.send(null);
    }
    function alertContents4() {
        if (xml4.readyState == 4) {
            if (xml4.status == 200) {
                xml_contenedor4.innerHTML=xml4.responseText;
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }
///*********************************************** 5 *************************************************************************
    function xml_inner5(url5,xmlcontenedor5) {createxml(5);
        xmlcontenedor5.innerHTML=loadingfl;
        xml_contenedor5=xmlcontenedor5;
        xml5.onreadystatechange = alertContents5;
        xml5.open('GET', url5, true);
        xml5.send(null);
    }
    function alertContents5() {
        if (xml5.readyState == 4) {
            if (xml5.status == 200) {
                xml_contenedor5.innerHTML=xml5.responseText;
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }
///*********************************************** 6 *************************************************************************
    function xml_inner6(url6,xmlcontenedor6) {createxml(6);
        xmlcontenedor6.innerHTML=loadingfl;
        xml_contenedor6=xmlcontenedor6;
        xml6.onreadystatechange = alertContents6;
        xml6.open('GET', url6, true);
        xml6.send(null);
    }
    function alertContents6() {
        if (xml6.readyState == 4) {
            if (xml6.status == 200) {
                xml_contenedor6.innerHTML=xml6.responseText;
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }
///*********************************************** 7 *************************************************************************
    function xml_inner7(url7,xmlcontenedor7) {createxml(7);
        xmlcontenedor7.innerHTML=loadingfl;
        xml_contenedor7=xmlcontenedor7;
        xml7.onreadystatechange = alertContents7;
        xml7.open('GET', url7, true);
        xml7.send(null);
    }
    function alertContents7() {
        if (xml7.readyState == 4) {
            if (xml7.status == 200) {
                xml_contenedor7.innerHTML=xml7.responseText;
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }
///*********************************************** 8 *************************************************************************
    function xml_inner8(url8,xmlcontenedor8) {createxml(8);
        //xmlcontenedor8.innerHTML=loadingfl;
        xml_contenedor8=xmlcontenedor8;
        xml8.onreadystatechange = alertContents8;
        xml8.open('GET', url8, true);
        xml8.send(null);
    }
    function alertContents8() {
        if (xml8.readyState == 4) {
            if (xml8.status == 200) {
                xml_contenedor8.innerHTML=xml8.responseText;
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }
///*********************************************** 9 *************************************************************************
    function xml_inner9(url9,xmlcontenedor9) {createxml(9);
        //xmlcontenedor9.innerHTML=loadingfl;
        xml_contenedor9=xmlcontenedor9;
        xml9.onreadystatechange = alertContents9;
        xml9.open('GET', url9, true);
        xml9.send(null);
    }
    function alertContents9() {
        if (xml9.readyState == 4) {
            if (xml9.status == 200) {
                xml_contenedor9.innerHTML=xml9.responseText;
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }
///*********************************************** 9 *************************************************************************
    function xml_inner_post(url9,xmlcontenedor9) {createxml(9);
        //xmlcontenedor9.innerHTML=loadingfl;
        xml_contenedor9=xmlcontenedor9;
        xml9.onreadystatechange = alertContents9;
        xml9.open('POST', url9, true);
        xml9.send(null);
    }
    function alertContents9() {
        if (xml9.readyState == 4) {
            if (xml9.status == 200) {
                xml_contenedor9.innerHTML=xml9.responseText;
                } else {
                self.status='No se pueden actualizar los mensajes enviados...';
            }
        }

    }
///*********************************************** 9 *************************************************************************


	function bprincipal(bp_url)
	{
	    
        b_principal.innerHTML=unescape(banners[bp_url]);
    }

function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}
// Example:
// alert( readCookie("myCookie") );
function readCookie(name)
{
  var cookies=document.cookie;
  
  cookies=cookies.split('; ');
  var cookieValue = "";

  for(i=0;i<=cookies.length-1;i++)
  {
  	nyv=cookies[i].split("=")
	if(nyv[0]==name)cookieValue = nyv[1];
  }
  return unescape(cookieValue);
}
