/*
 * Coresoft006/js/menu-config.js
 *
 * 13-MAR-2006	
 *
 */
 
if (window.attachEvent)
	window.attachEvent("onload", menuLoadHandler);				// IE
else if (window.addEventListener)
	window.addEventListener("load", menuLoadHandler, false);	// Gecko

function menuLoadHandler()
{
	// Don't init menus if there are none
	if (document.getElementById("top_nav") == null)
		return;
	MENU_ROOT_DX = -5;				// Fine-tune root menu X position.
	MENU_ROOT_DY = 2;				// Fine-tune root menu Y position.
	MENU_ITEM_DX = -1;				// Fine-tune submenu X position.
	MENU_ITEM_DY = -1;				// Fine-tune submenu Y position.
	MENU_POSITION_DYNAMIC = true;	// Position dynamically
	// Menu parameters: MENU_Menus[menu_id] = [[submenu_id, caption, href, target], ...];
	// Note: _ALL_ ids are case sensitive. Parameter target is optional
	MENU_Menus["About"] = [
		["", "About Us", "about.html"],
		["", "Conductor", "Conductor.html"],
		["", "Contact Us", "contact.html"]
		];
	MENU_Menus["Concerts"] = [
		["", "28 March 2010", "ConcertMarch10.html"],
		["", "20 June 2010", "ConcertJune10.html"],
		["", "4 September 2010", "ConcertSeptember10.html"],
		["", "12 December 2010", "ConcertDecember10.html"],
		["", "Subscriptions", "subscriptions.html"],
		["Child1", "Soloists", "#"]
		//["", "Guest Conductor", "Conductor.html"]
		];
	MENU_Menus["Child1"] = [
		["", "Wendy Kong, violin", "WendyKong.html"],
		["Child1.1", "Recent Soloists", "#"]
		];
	MENU_Menus["Child1.1"] = [
		["", "Monique Irik, violin", "MoniqueIrik2.html"],
		["", "Marc Isaacs", "MarcIsaacs.html"],
		["", "Judy Glen, soprano", "JudyGlen.html"],
		["", "Mark Pinner, basoon", "MarkPinner.html"],
		["", "Benjamin Loomes, tenor", "BenLoomes.html"]
		//["", "Helen Zerefos, soprano", "#"],
		//["", "Jason Xanthoudakis , saxophone", "#"],
		//["", "David Greco, baritone", "#"],
		//["", "Gregory van der Struik, trombone", "#"],
		//["", "Mirabai Paert, violin", "#"],
		//["", "Beth Moloney, flute", "#"],
		//["", "The Mark Isaacs Trio", "#"]
		];
		
	MENU_Menus["Media"] = [
		["Child2", "Media Releases", "#"],
		//["", "Newsletter", "#"],
		["", "Music Hire", "musicHire.html"]
		];
	
	MENU_Menus["Child2"] = [
		["", "December 2008", "SSSO Dec_08_FIN.pdf"],
		["", "September 2009", "mediaRelease/SSSO Sept 09_FINAL.pdf"],
		["", "December 2009", "mediaRelease/SSSODec09_FIN.pdf"],
		["", "December 2009", "mediaRelease/SSSOsubs2010MR_FIN.pdf"],		
		["", "June 2010", "mediaRelease/SSSOMRJune2010_FIN.pdf"]
		];





// Build the defined menus and attach to the document by appending to the document body's innerHTML
	// This is necessary for IE6 as it won't apply styles (and possibly event handlers) if we appendChild.
	MENU_BuildMenus();
	// Associate menubar items with root menus. Set menubar item event handlers and position root menus.
	MENU_InitMenuBar("top_nav");
	// This allows some variation in style between IE6 and FF
	// DON'T DO THIS AS TTS ALREADY USES THIS FOR SOMETHING ELSE
	//document.body.className = navigator.userAgent.replace(/.*(MSIE|Gecko).*/, "$1");
	// This hides the menus when you click outside any menu or resize the window
	MENU_AddEventListener(document, "mousedown", MENU_HideAllMenus);
	MENU_AddEventListener(window, "resize", MENU_HideAllMenus);
	// Now we're ready to rock and/or roll!
}

function MENU_OnShowRootMenu(menu)
{
	if (menu.id == "Contact")
	{
		// right-justify the MyStuff menu
		var a = MENU_MenuBarIndex["Contact"];
		var x = 0;
		for (var c = a; c != null; c = c.offsetParent)
			x += c.offsetLeft;
		menu.style.left = (x + a.offsetWidth - menu.offsetWidth) + "px";
	}
	return menu;
}
