function onLoad() {
    window.onResize = onLoad;
    loadMenus();
}

function LoadMenus()
{
 
//**** Main Menu ****

//Loads each menu element from its array specified in DownloadsMenu.js this allows for BUECU Menu to be edited easily in a text editor.

    window.DimmersMenu = new Menu("Dimmers");	//Create Menu object
    for(n=0;n < Dimmers.length;n=n+2)		//for every second value
	{
		DimmersMenu.addMenuItem(Dimmers[n],"document.location='"+Dimmers[n+1]+"'");	//Add item to menu as specified in the array.
	}
   
    window.ConsolesMenu = new Menu("Consoles");
    for(n=0;n < Consoles.length;n=n+2)
	{
		ConsolesMenu.addMenuItem(Consoles[n],"document.location='"+Consoles[n+1]+"'");
	}
	
	window.SoftwareMenu = new Menu("Software");
    for(n=0;n < Software.length;n=n+2)
	{
		SoftwareMenu.addMenuItem(Software[n],"document.location='"+Software[n+1]+"'");
	}
    
    window.DMXMenu = new Menu("DMX");
    for(n=0;n < DMX.length;n=n+2)
	{
		DMXMenu.addMenuItem(DMX[n],"document.location='"+DMX[n+1]+"'");
	}
	
	window.SupportMenu = new Menu("Support");
    for(n=0;n < Support.length;n=n+2)
	{
		SupportMenu.addMenuItem(Support[n],"document.location='"+Support[n+1]+"'");
	}
	
	window.LinksMenu = new Menu("Links");
    for(n=0;n < Links.length;n=n+2)
	{
		LinksMenu.addMenuItem(Links[n],"document.location='"+Links[n+1]+"'");
	}
    
//**** Set Properties ****
    
    LinksMenu.fontSize = 10;
	//ApplicationsMenu.fontWeight = "bold";
	LinksMenu.fontFamily = "Verdana";
	LinksMenu.fontColor = "white";
	LinksMenu.bgColor = "black";
	LinksMenu.menuBorder = 0;
	LinksMenu.menuItemBorder = 2;
	LinksMenu.menuItemIndent = 15;
	LinksMenu.menuItemBgColor = "darkblue";
	LinksMenu.menuBorderBgColor = "darkblue";
	LinksMenu.menuHiliteBgColor = "lightblue";
	LinksMenu.menuContainerBgColor = "darkblue";
	LinksMenu.prototypeStyles = LinksMenu;
	
	LinksMenu.writeMenus();
}

function showMenuInFrame(menuLabel, x, y) {
	if (!top.window.frames[1]) {
		return;
	}
	if (window.pageXOffset > -1) {
		x = x || top.window.frames[1].pageXOffset + window.pageX;
		y = y + top.window.frames[1].pageYOffset;	// increment if you want to move menu down page.
	} else if (document.body.scrollLeft > -1) {
		x = x|| top.window.frames[1].document.body.scrollLeft + window.pageX;
		y = y+ top.window.frames[1].document.body.scrollTop;	// increment if you want to move menu down page.
	}
	if (top.window.frames[1].showMenu) {
		top.window.frames[1].showMenu (menuLabel, x, y);
	}
}

function mouseTracker(e) {
	e = e || window.Event || window.event;
	window.pageX = e.pageX || e.clientX;
	window.pageY = e.pageY || e.clientY;
}

if (window.captureEvents) {
    window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);
	window.onmousemove = mouseTracker;
} else {
	document.onmousemove = mouseTracker;
}
