/////////////////////////
// Menus
/////////////////////////
YAHOO.util.Event.onContentReady("tabs", function () {
	var oMenuBar = new YAHOO.widget.MenuBar("tabs", { 
	                                                  hidedelay: 250, 
													  showdelay: 0,
													  zindex: 100,
													  shadow: true,
													  autosubmenudisplay: true,
	                                                  lazyload: false 
													});
    var aSubmenuData = [
        {
            id: "services", 
            itemdata: [ 
                { text: "Data Center Solutions", url: "/services/datacenter",
                  submenu: {
                	id: 'datacenter',
                	itemdata: [
                	    { text: 'Colocation', url: '/services/colocation' },
                	    { text: 'Managed Services', url: '/services/managed' },
                	    { text: 'Network Monitoring', url: '/services/monitoring' }
                	]
                  }
                },
                { text: "Network Consulting", url: "/services/network",
                  submenu: {
                	id: 'network',
                	itemdata: [
                	    { text: 'Assessment', url: '/services/assessment' },
                	    { text: 'Integration', url: '/services/integration' },
                	    { text: 'Documentation', url: '/services/document' }
                	]
                  }
                },
                { text: "Design and Development", url: "/services/devdesign",
                  submenu: {
                	id: 'devdesign',
                	itemdata: [
                	    { text: 'Development', url: '/services/development' },
                	    { text: 'Website Design', url: '/services/design' }
                	]
                  }
                }
            ]
        },
        {
            id: "data", 
            itemdata: [ 
                { text: "Network Map", url: "/data/map" },
                { text: "Network Infrastructure", url: "/data/network" },
                { text: "Data Center Services", url: "/services/datacenter" }
            ]
        },
        {
            id: "about", 
            itemdata: [
                { text: "Overview", url: "/about" },
                { text: "Our Partners", url: "/about/partners" },
                { text: "Company News", url: "/about/news" }                   
            ]    
        }                    
    ];


    /*
    * 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(1).cfg.setProperty("submenu", aSubmenuData[0]);
            this.getItem(2).cfg.setProperty("submenu", aSubmenuData[1]);
            this.getItem(3).cfg.setProperty("submenu", aSubmenuData[2]);
        }

    });
	oMenuBar.render();
});