
function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
else
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
}

function initPage()
{
xml=loadXMLDoc("muhurthas2010.xml");
xsl=loadXMLDoc("muhursort.xsl");
// code for IE
if (window.ActiveXObject)
  {
  ex=xml.transformNode(xsl);
  document.getElementById("muhurtable").innerHTML=ex;
  }
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
  {
  xsltProcessor=new XSLTProcessor();
  xsltProcessor.importStylesheet(xsl);
    xsltProcessor.setParameter(null, "sortCrit", document.evaluate("//" + 'MonthNo',xml,null,XPathResult.UNORDERED_NODE_ITERATOR_TYPE,null));
    xsltProcessor.setParameter(null, "ordCrit", "ascending");
    xsltProcessor.setParameter(null, "dataType", 'number');

  resultDocument = xsltProcessor.transformToFragment(xml,document);
  ocument.getElementById("muhurtable").appendChild(resultDocument);
  }
}
