/*
 * 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["Bands"] = [
		["", "The Mezzanines - Quintet", "mezzanines.html"],
		["", "TresMambo Big Band", "TMBB.html"]
		];
	MENU_Menus["Media"] = [
		["Child1", "Photos", "#"],
		["", "Audio Recordings Mezzanines", "audioMezzanines.html"],
		["", "Audio Recordings TresMambo", "audioTMBB.html"],
		["", "Band Biographies", "Bios.html"],
		["", "Testimonials", "Testimonials.html"]
		];
	MENU_Menus["Child1"] = [
		["", "The Mezzanines", "mezzaninesPhotos.html"],
		["", "TresMambo Big Band", "TMBBPhotos.html"]
		];
	MENU_Menus["SetList"] = [
		["", "Set List - The Mezzanines", "setlist.html"]
	];
	




// 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;
}

