            /*
                 Initialize and render the MenuBar when its elements are ready 
                 to be scripted.
            */

            YAHOO.util.Event.onContentReady("nav", function () {

                /*
                     Instantiate a MenuBar:  The first argument passed to the 
                     constructor is the id of the element in the page 
                     representing the MenuBar; the second is an object literal 
                     of configuration properties.
                */

                var oMenuBar = new YAHOO.widget.MenuBar("nav", { 
                                                            autosubmenudisplay: true, 
                                                            hidedelay: 100, 
                                                            lazyload: true });

                /*
                     Define an array of object literals, each containing 
                     the data necessary to create a submenu.
                */
//BEGIN extracting XML data and converting to JSON format
var url = "../xml/navigation.xml";
var xml = new JKL.ParseXML( url );
var data = xml.parse();
var x;
var i;
var n;
var e = "";
var xcontent = 'var aSubmenuData = [';
for ( x in data.menu.menu ) {
	e += data.menu.menu[x].name + "\n";
	xcontent += '{id: "' + data.menu.menu[x].name + '", itemdata: [';
		for ( i in data.menu.menu[x].item ) {
			if ( data.menu.menu[x].item[i].name != undefined ) {
				xcontent += '{ text: "' + data.menu.menu[x].item[i].name + '", url: "' + data.menu.menu[x].item[i].url +'"}';
				if ( i != ( data.menu.menu[x].item.length - 1 ) ) { xcontent += ','; }
			}
		}
		xcontent += ']}';
		if ( x != (data.menu.menu.length - 1) ) { xcontent += ','; }
		//else { xcontent += '];'; }
};
xcontent += '];';
//document.write(xcontent);
eval(xcontent);


//END XML to JSON
/* old menu data
                var aSubmenuData = [
                
                    {
                        id: "projectOverview", 
                        itemdata: [ 
                            { text: "Fast Facts", url: "Secondary.aspx?id=46" },
                            { text: "Location", url: "Secondary.aspx?id=64" },
                            { text: "Downloads", url: "Secondary.aspx?id=116" },
                        ]
                    },

                    {
                        id: "sitePlan", 
                        itemdata: [
                  
                        ]    
                    },
                    
                    {
                        id: "propertyListings", 
                        itemdata: [
						             
                        ] 
                    },
					
					{
                        id: "interactiveMap", 
                        itemdata: [
   
                        ] 
                    },
					
					{
                        id: "logisticsProfile", 
                        itemdata: [
						    { text: "Drayage", url: "Secondary.aspx?id=90" },
                            { text: "Highways", url: "Secondary.aspx?id=92" }, 
							{ text: "Rail", url: "Secondary.aspx?id=94" }, 
							{ text: "Air", url: "Secondary.aspx?id=96" }, 
							{ text: "Ports", url: "Secondary.aspx?id=98" },         
                        ] 
                    },
										
					{
                        id: "marketAnalysis", 
                        itemdata: [
						    { text: "Labor", url: "Secondary.aspx?id=102" },
                            { text: "Real Estate Costs", url: "Secondary.aspx?id=104" }, 
							{ text: "Cost of Living", url: "Secondary.aspx?id=106" },       
                        ] 
                    },
                    			{
                        id: "ittcMedia", 
                        itemdata: [
						    { text: "News Articles", url: "Secondary.aspx?id=110" },
                            { text: "Press Releases", url: "Secondary.aspx?id=112" }, 
							{ text: "Videos", url: "Secondary.aspx?id=114" },         
                        ] 
                    },
	
                    {
                        id: "Contact Us",
                        itemdata: [
                          
                        ]
                    } 
			     
                ];

*/
                /*
                     Subscribe to the "beforerender" event, adding a submenu 
                     to each of the items in the MenuBar instance.
                */

                oMenuBar.subscribe("beforeRender", function () {

                    if (this.getRoot() == this) {

                        this.getItem(0).cfg.setProperty("submenu", aSubmenuData[0]);
                        this.getItem(1).cfg.setProperty("submenu", aSubmenuData[1]);
                        this.getItem(2).cfg.setProperty("submenu", aSubmenuData[2]);
                        this.getItem(3).cfg.setProperty("submenu", aSubmenuData[3]);
						this.getItem(4).cfg.setProperty("submenu", aSubmenuData[4]);
						this.getItem(5).cfg.setProperty("submenu", aSubmenuData[5]);
						this.getItem(6).cfg.setProperty("submenu", aSubmenuData[6]);
						this.getItem(7).cfg.setProperty("submenu", aSubmenuData[7]);
						this.subscribe("beforeShow", onMenuBeforeShow);
						this.subscribe("show", onMenuShow);
                    }

                });


                /*
                     Call the "render" method with no arguments since the 
                     markup for this MenuBar instance is already exists in 
                     the page.
                */

                oMenuBar.render();         
            
            });