function loadXMLDoc(url) {
   if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
     xmlhttp=new XMLHttpRequest();
   } else {// code for IE6, IE5
     xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
   xmlhttp.open("GET",url,false);
   xmlhttp.send(null);
   xxx=xmlhttp.responseXML;
   return xxx;
}

function displayResult(elId, sec) {
   //http://bruno.trindade.name/sand/resume.php
   xml=loadXMLDoc("resume.xml");
   xsl=loadXMLDoc("resume.php");
   // code for IE
   if (window.ActiveXObject) {
     nod=xsl.selectSingleNode("//xsl:param[@name='sec']")
     nod.setAttribute("select",sec);
     ex=xml.transformNode(xsl);
     document.getElementById("test").innerHTML=ex;
   } else if (document.implementation && document.implementation.createDocument){
     // code for Mozilla, Firefox, Opera, etc.
     xsltProcessor=new XSLTProcessor();
     xsltProcessor.importStylesheet(xsl);
     xsltProcessor.setParameter(null, "sec", sec);
     resultDocument = xsltProcessor.transformToFragment(xml,document);
     with (document.getElementById(elId)) {
        innerHTML = "";
        appendChild(resultDocument);
        var imgs = getElementsByTagName("img");
        for (var img in imgs) {
           img.src = escape(img.src);
        }
     }
  }
}
