/**
 * Main menu.
 * 
 * @param context
 * @param isUserLoggedIn
 */
function menu(context, isUserLoggedIn)
{
	YAHOO.util.Event.onDOMReady(function () 
	{
	    var oMenu = new YAHOO.widget.MenuBar("gamenu");
	 
	    if (!isUserLoggedIn)
	    {
	    	oMenu.addItems
	    	([
	            { text: "Home", url: context+"news" },
	            { text: "Login",  url:  context + "login" },
	            { text: "Register",  url:  context + "timekeeper/new" },
	            { text: "Calendar",  url:  context + "event" },
	            { text: "Help", submenu:
            	{  id: "help", itemdata: 
            		[
            		 	{ text: "How to Search For Events",      url: "http://www.youtube.com/watch?v=fqAbiUDMSe8" },
            		 	{ text: "How to Add Places to an Event", url: "http://www.youtube.com/watch?v=XOamDKBilw8" },
            	    ]
            	}
	        },
	        ]);
	    }
	    else
	    {
	    	oMenu.addItems
	    	([
	            { text: "Home", url: context+"news" },
	            { text: "Logout",  url:  context + "logout" },
	            { text: "Calendar",  url:  context + "event" },
	            { text: "Create",  url:  context + "event/new" },
	            { text: "Affiliates", submenu:
	            	{  id: "affiliates", itemdata: 
	            		[
	            		 	{ text: "Cross Register", url: context+"timekeeper/crossRegister" },
	            	    ]
	            	}
	            },
	            { text: "Help", submenu:
            	{  id: "help", itemdata: 
            		[
            		 	{ text: "How to Search For Events", url: "http://www.youtube.com/watch?v=fqAbiUDMSe8" },
            		 	{ text: "How to Add Places to an Event", url: "http://www.youtube.com/watch?v=XOamDKBilw8" },
            	    ]
            	}
            },
	        ]);
	    }
	    
	    oMenu.render("menu");
	    oMenu.show();
	});
}
