﻿// JScript File

var xmlDoc;

if (window.ActiveXObject) {
    xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.async=false;
    xmlDoc.load("menu.xml");    
}
else if (document.implementation && document.implementation.createDocument)
{   
    var xmlhttp = new window.XMLHttpRequest();
    xmlhttp.open("GET","menu.xml",false);
    xmlhttp.send(null); 
    xmlDoc = xmlhttp.responseXML;//.documentElement;
    //xmlDoc = document.implementation.createDocument("","doc",null);
}
else
{
    alert('Your browser cannot handle this script'); 
}

//xmlDoc.async=false;
//xmlDoc.load("menu.xml");

////



//call/set a node:
//var x=xmlDoc.getElementsByTagName("nodename");

////

      var menuval = xmlDoc.getElementsByTagName("Menu"); 
      var results = '';    
      for (var i=0; menuval.length > i; i++)
      {
            
            var firstval = menuval[i].getElementsByTagName("First"); 
            var fv1=firstval[0].firstChild.nodeValue;                            
            var secondval = menuval[i].getElementsByTagName("Second");
            var fv2=secondval[0].firstChild.nodeValue;            
            var thirdval = menuval[i].getElementsByTagName("Third");
            var fv3=thirdval[0].firstChild.nodeValue;            
            var forthval = menuval[i].getElementsByTagName("Forth");
            var fv4=forthval[0].firstChild.nodeValue;            
            var fifthval = menuval[i].getElementsByTagName("Fifth");            
            var fv5=fifthval[0].firstChild.nodeValue;                        
      }      



