function displayResult()
{

    if (window.ActiveXObject)
    {
        displayResultIE();
    }else{

        var xmlRequest = new XMLHttpRequest();
        xmlRequest.open("GET", "noticias.xml", false);
        xmlRequest.send(null);
        xml= xmlRequest.responseXML;

        var xslRequest = new XMLHttpRequest();
        xslRequest.open("GET","noticias.xsl", false);
        xslRequest.send(null);
        xsl = xslRequest.responseXML;

        xsltProcessor=new XSLTProcessor();
        xsltProcessor.importStylesheet(xsl);
        resultDocument = xsltProcessor.transformToFragment(xml,document);
        document.getElementById("noticias").appendChild(resultDocument);
    }
}

function loadXMLDoc(fname)
{
    var xmlDoc;
    // code for IE
    if (window.ActiveXObject)
    {
        xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    }
    // code for Mozilla, Firefox, Opera, etc.
    else if (document.implementation && document.implementation.createDocument)
    {
        xmlDoc=document.implementation.createDocument("","",null);
    }
    else
    {
        alert('Your browser cannot handle this script');
    }
    xmlDoc.async=false;
    xmlDoc.load(fname);
    return(xmlDoc);
}

function displayResultIE()
{
    xml=loadXMLDoc("noticias.xml");
    xsl=loadXMLDoc("noticias.xsl");
    // code for IE
    if (window.ActiveXObject)
    {
        ex=xml.transformNode(xsl);
        document.getElementById("noticias").innerHTML=ex;
    }
    // code for Mozilla, Firefox, Opera, etc.
    else if (document.implementation && document.implementation.createDocument)
    {
        xsltProcessor=new XSLTProcessor();
        xsltProcessor.importStylesheet(xsl);
        resultDocument = xsltProcessor.transformToFragment(xml,document);
        document.getElementById("noticias").appendChild(resultDocument);
    }
}



function muestraCapa(idCapa, numeroPaginas)
{
    for(i=1;i<= numeroPaginas;i++){
        if(i==idCapa){
            document.getElementById("pagina"+i).style.display="block";
            document.getElementById("link"+i).style.color="#990000";
        }else{
            document.getElementById("pagina"+i).style.display="none";
            document.getElementById("link"+i).style.color="#E49603";
        }
             
    }
}

