// Filename:	udsmenu.js
// Author:		Jason McBride
// Date:		Nov 16 2009
// Note:		Javascript for Yahoo UI Menu

   /*
     Initialize and render the MenuBar when its elements are ready 
     to be scripted.
*/

YAHOO.util.Event.onContentReady("mymenubar", 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("mymenubar", { 
                                                autosubmenudisplay: true, 
                                                hidedelay: 750, 
                                                lazyload: true });
	
	
	/*
     Define an array of object literals, each containing 
     the data necessary to create a submenu.
*/

var aSubmenuData = [

    {
        id: "services", 
        itemdata: [ 
            { text: "Managed Services", submenu:{
			id: "managedservicestopics",
			itemdata: [
            { text: "Network Management", url: "networkmanagement.html" },
            { text: "Systems Management", url: "systemsmanagement.html" },
            { text: "User Management", url: "usermanagement.html" },
            { text: "Data Management", url: "datamanagement.html" }              
        ]    }
			},
			{ text: "Security", submenu:{
			id: "securitytopics",
			itemdata: [
            { text: "Intrusion Prevention", url: "intrusionprevention.html" },
            { text: "Gateway Antivirus", url: "gatewayantivirus.html" },
            { text: "Secure Remote Access", url: "secureremoteaccess.html" },
            { text: "Data Encryption", url: "dataencryption.html" }                  
        ]    }
			},
            { text: "Remote Support", url: "remotesupport.html" },           
			
			
        ]
    },

    {
        id: "security", 
        itemdata: [
            { text: "Intrusion Prevention", url: "intrustionprevention.html" },
            { text: "Gateway Antivirus", url: "#" },
            { text: "Secure Remote Access", url: "secureremoteaccess.html" },
            { text: "Data Encryption", url: "dataencryption.html" }                  
        ]    
    },
    
    {
        id: "goinggreen", 
        itemdata: [
            { text: "Server Virtualization", url: "servervirtualization.html" },
            { text: "Small Form Factor PCs", url: "sffpc.html" },
			{ text: "Thin Clients", url: "thinclients.html" },
            { text: "Document Management", url: "documentmanagement.html" }       
        ] 
    },
    
   /* {
        id: "development",
        itemdata: [
          
            { text: "Portfolio", url: "portfolio.html" }
        ]
    } ,*/
	 {
        id: "theadds",
        itemdata: [
            { text: "Clear I.T. solutions", url: "marchad.html" },
            { text: "Whats with the fish?", url: "aprilad.html" },
            { text: "It's time to go green", url: "junead.html" },	
			{ text: "Let's talk security", url: "julyad.html" },
			{ text: "Out of your element?", url: "augustad.html" },
			{ text: "What happened to you guys?", url: "septemberad.html" },
			{ text: "It's here Windows 7", url: "octoberad.html" },
			{ text: "Jump into I.T.", url: "novemberad.html" },
			{ text: "Happy Holidays", url: "decemberad.html" },
			{ text: "Is your I.T. bloated?", url: "januaryad.html" },
			{ text: "2010 Teamwork leads to I.T.", url: "februaryad.html" },
        ]
    } ,
	{
	  id: "aboutus",
	  itemdata:[
			//	{text: "News",url:"news.html"},
				//{text: "History",url:"history.html"},
				{text: "Community",url:"community.html"},
				{text: "What's with the fish?",url:"thefish.html"},
				//{text: "Contact Us",url:"contactus.html"}
				]
	}
];


/*
     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) {

       //services this.getItem(1).cfg.setProperty("submenu", aSubmenuData[0]);
        //this.getItem(2).cfg.setProperty("submenu", aSubmenuData[1]);
        this.getItem(3).cfg.setProperty("submenu", aSubmenuData[2]);
        this.getItem(5).cfg.setProperty("submenu", aSubmenuData[3]);
		//this.getItem(5).cfg.setProperty("submenu", aSubmenuData[4]);
		this.getItem(7).cfg.setProperty("submenu", aSubmenuData[5]);
    }

});


/*
     Call the "render" method with no arguments since the 
     markup for this MenuBar instance is already exists in 
     the page.
*/

oMenuBar.render();    


	

});
