//
// menu[menuNumber][0] = new Menu(Vertical menu? (true/false), 'popout indicator', left, top,
// width, 'mouseover colour', 'background colour', 'border stylesheet', 'text stylesheet');
//
// Left and Top are measured on-the-fly relative to the top-left corner of its trigger, or
// for the root menu, the top-left corner of the page.
//
// menu[menuNumber][itemNumber] = new Item('Text', 'URL', 'target frame', length of menu item,
//  additional spacing to next menu item, number of target menu to popout);
//
// If no target menu (popout) is desired, set it to 0. Likewise, if your site does not use
// frames, pass an empty string as a frame target.
//
// Something that needs explaining - the Vertical Menu setup. You can see most menus below
// are 'true', that is they are vertical, except for the first root menu. The 'length' and
// 'width' of an item depends on its orientation -- length is how long the item runs for in
// the direction of the menu, and width is the lateral dimension of the menu. Just look at
// the examples and tweak the numbers, they'll make sense eventually :).

var menu = new Array();

// Default colours passed to most menu constructors (just passed to functions, not
// a global variable - makes things easier to change later in bulk).

var defmOver = '#5A8278', defmBack = '#5A8278'; //colors of the top menu
var defOver = '#D7E4E1', defBack = '#D7E4E1';   //colors for the submenus


// Default 'length' of menu items - item height if menu is vertical, width if horizontal.

var defLength = 22;

// Menu 0 is the special, 'root' menu from which everything else arises.
menu[0] = new Array();
// A non-vertical menu with a few different colours and no popout indicator, as an example.
// *** MOVE ROOT MENU AROUND HERE ***  it's positioned at (225, 38) and is 22px high.

menu[0][0] = new Menu(false, '', 225, 38, 22, defmOver, defmBack);

// Notice how the targets are all set to nonzero values...
// The 'length' of each of this item is 40, and there is spacing of 10 to the next item.
// Most of the links are set to '#' hashes, make sure you change them to actual files.
// menu[0][1] = new Item('Home', '', 'default.asp', 'default', 40, 10, 0);

menu[0][1] = new Item('Home', 'default.asp', 'default', 50, 10, 0);
menu[0][2] = new Item('About Us', 'aboutus.asp', 'aboutus', 70, 10, 0);
menu[0][3] = new Item('Products', 'products.asp', 'products', 70, 10, 1);
menu[0][4] = new Item('Order Form', 'orderform.asp', 'orderform', 90, 10, 0);
//menu[0][5] = new Item('Literature', 'batterylit.asp', 'batterylit', 90, 25, 2);
menu[0][5] = new Item('FAQ', 'faq.asp', 'faq', 35, 10, 0);
menu[0][6] = new Item('Contact Us', 'contactus.asp', 'contactus', 85, 0, 0);
//menu[0][7] = new Item('Test', '#', 'Test', 50, 0, 0);

// Products menu
menu[1] = new Array();
menu[1][0] = new Menu(true, '<img src="images/rightarrow.gif">', 0, defLength, 90, defOver, defBack);
menu[1][1] = new Item('Chemistry', 'prodByChem.asp', 'products:chemistry', defLength, 0, 3);
menu[1][2] = new Item('Applications', 'prodByApps.asp', 'products:applications', defLength, 0, 4);
//menu[1][3] = new Item('Construction', 'prodByConst.asp', 'products:construction', defLength, 0, 5);

// BatteryLiterature menu
menu[2] = new Array();
menu[2][0] = new Menu(true, '', 0, defLength, 80, defOver, defBack);
menu[2][1] = new Item('Nickel Cadmium', '#', 'batterylit:nicd', defLength, 0, 0);
menu[2][2] = new Item('Nickel-Metal Hydride', '#', 'batterylit:nimh', defLength, 0, 0);
menu[2][3] = new Item('Lithium-Ion', '#', 'batterylit:liion', defLength, 0, 0);

// Chemistry menu
menu[3] = new Array();
menu[3][0] = new Menu(true, '', 90, 0, 125, defOver, defBack);
menu[3][1] = new Item('Nickel Cadmium', 'nicdProds.asp', 'products:chemistry:nicd', defLength, 0, 0);
menu[3][2] = new Item('Nickel-Metal Hydride', 'nimhProds.asp', 'products:chemistry:nimh', defLength, 0, 0);
menu[3][3] = new Item('Lithium-Ion', 'liionProds.asp', 'products:chemistry:liion', defLength, 0, 0);
//menu[3][4] = new Item('Sealed-Lead Acid', 'leadacid.asp', 'products:chemistry:leadacid', defLength, 0, 0);


// Applications menu
menu[4] = new Array();
menu[4][0] = new Menu(true, '', 90, 0, 125, defOver, defBack);
menu[4][1] = new Item('Portable Electronics', 'prodByPtblElec.asp', 'products:applications:portable', defLength, 0, 0);
menu[4][2] = new Item('Telecommunications', 'prodByTelecom.asp', 'products:applications:telecom', defLength, 0, 0);
menu[4][3] = new Item('Medical Equipment', 'prodByMedicalApps.asp', 'products:applications:medical', defLength, 0, 0);
menu[4][4] = new Item('Defense', 'prodByDefense.asp', 'products:applications:defense', defLength, 0, 0);
menu[4][5] = new Item('Stationary', '#', 'products:applications:stationary', defLength, 0, 0);
menu[4][6] = new Item('Custom', '#', 'products:applications:custom', defLength, 0, 0);

// Construction menu
menu[5] = new Array();
menu[5][0] = new Menu(true, '', 90, 0, 125, defOver, defBack);
menu[5][1] = new Item('Sealed Cylindrical', '#', 'products:construction:sealed', defLength, 0, 0);
menu[5][2] = new Item('Vented', '#', 'products:construction:vented', defLength, 0, 0);
menu[5][3] = new Item('Pocket Plate', '#', 'products:construction:pocket', defLength, 0, 0);

// These two lines handle the window resize bug in NS4. See <body onResize="...">.

var popOldWidth = window.innerWidth;
nsResizeHandler = new Function('if (popOldWidth != window.innerWidth) location.reload()');


// This is a quick snippet that captures all clicks on the document and hides the menus
// every time you click. 

if (isNS4) document.captureEvents(Event.CLICK);
document.onclick = clickHandle;

function clickHandle(evt) {
 if (isNS4) document.routeEvent(evt);
 hideAllBut(0);
}