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).
var defOver = '#707070', defBack = '#be0035', defBorder = '#000000';    
// Default height of menu items - the spacing to the next item, actually.
var defHeight = 20;
// Menu 0 is the special, 'root' menu from which everything else arises.
menu[0] = new Array();
// Pass a few different colours, as an example.
menu[0][0] = new Menu('rootMenu', 0, 0, 125, '#be0035', '#be0035', defBorder);
// Notice how the targets are all set to nonzero values...
menu[0][1] = new Item('About', 'about.html', defHeight, 1);
menu[0][2] = new Item('Services', 'services.html', defHeight, 2);
menu[0][3] = new Item('Contact', 'contact.html', defHeight, 3);
menu[0][4] = new Item('Links', 'links.html', defHeight, 4);
menu[0][5] = new Item('Home', 'index.html', defHeight, 5);
menu[1] = new Array();
// The File menu is positioned 0px across and 22 down from its trigger, and is 80 wide.
menu[1][0] = new Menu('aboutMenu', -5, 20, 140, defOver, defBack, defBorder);
menu[1][1] = new Item('About Abair', 'about.html', defHeight, 0);
menu[1][2] = new Item('Who we are', 'about.html', defHeight, 0);
menu[1][3] = new Item('What we do','about2.html', defHeight, 0);
menu[1][4] = new Item('Where to find us', 'where.html', defHeight, 0);
menu[1][5] = new Item('Biographies', 'biography.html', defHeight, 0);

menu[2] = new Array();
menu[2][0] = new Menu('servicesMenu', -5, 20, 125, defOver, defBack, defBorder);
menu[2][1] = new Item('Overview of Services', 'services.html', defHeight, 0);
menu[2][2] = new Item('Education and Training', 'education.html', defHeight, 0);
menu[2][3] = new Item('Education Schedule', 'calendar.html', defHeight, 0);
menu[2][4] = new Item('FAQs', 'faq.html', defHeight, 0);
menu[2][5] = new Item('APICS 2005 White Paper', 'whitepaper.html', defHeight, 0);

menu[3] = new Array();
menu[3][0] = new Menu('contactMenu', 0, 20, 125, defOver, defBack, defBorder);
menu[3][1] = new Item('Contact Information', 'contact.html', defHeight, 0);
menu[3][2] = new Item('Directions', 'dir.html', defHeight, 0);
menu[3][3] = new Item('Where to find us', 'where.html', defHeight, 0);
menu[3][4] = new Item('Our Team', 'biography.html', defHeight, 0);

menu[4] = new Array();
menu[4][0] = new Menu('linksMenu', -5, 20, 125, defOver, defBack, defBorder);
menu[4][1] = new Item('Recommended Readings', 'read.html', defHeight, 0);
menu[4][2] = new Item('Related Links', 'links.html', defHeight, 0);
menu[4][3] = new Item('Where to Find us', 'where.html', defHeight, 0);
menu[4][4] = new Item('Speaking & Seminars', 'where.html', defHeight, 0);

menu[5] = new Array();
menu[5][0] = new Menu('indexMenu', -5, 20, 125, defOver, defBack, defBorder);

// Now, this next bit of script will write our own custom root menu -- a horizontal
// one, as the defaults are all vertical with borders. Even if you are writing your
// own root menu, you must still specify the names, colours and targets above -- the
// positions are calculated on the fly and hence are ignored.
// Basically, you must duplicate the output of the writeMenus() function. Just work
// from this example.
// Syntax: startDL('id', x, y, width, height, 'visibility', '#background colour or null
//for transparent', '#border colour or null for no border', 'additional properties');
// It returns a string of HTML text comprising the opening tag of a div or layer.
// mouseProps(menu, item) returns the 'onMouseEvent' properties for a specific menu item,
// passed as 'additional properties' to startDL. Just cut and paste below, or allow the
// script to write its own root menu.
// endDL is a variable containing either '</div>' or '</layer>', so add it afterwards. 
newRoot = startDL('rootMenu', 0, 90, '100%', 20, 'hidden', '#be0035', null, 100, '');
newRoot += startDL('rootMenu1', 140, 0, 135, 20, 'inherit', '#be0035', null, 100, mouseProps(0, 1));
newRoot += '<span class="Item"><a href="about.html"><font class=link>  About </font></a></span>' + endDL;
newRoot += startDL('rootMenu2', 265, 0, 120, 20, 'inherit', '#be0035', null, 100, mouseProps(0, 2));
newRoot += '<span class="Item"><a href="services.html"><font class=link> Services</font></a></span>' + endDL;
newRoot += startDL('rootMenu3', 395, 0, 120, 20, 'inherit', '#be0035', null, 100, mouseProps(0, 3));
newRoot += '<span class="Item"><a href="contact.html"><font class=link>  &nbsp;Contact</font></a></span>' + endDL;
newRoot += startDL('rootMenu4', 520, 0, 120, 20, 'inherit', '#be0035', null, 100, mouseProps(0, 4));
newRoot += '<span class="Item"><a href="links.html"><font class=link>  Links</font></a></span>' + endDL;
newRoot += startDL('rootMenu5', 654, 0, 120, 20, 'inherit', '#be0035', null, 100, mouseProps(0, 5));
newRoot += '<span class="Item"><a href="index.html"><font class=link>  Home</font></a></span>' + endDL;
newRoot += endDL;
// Pass this two strings - the first is HTML to write a custom root menu, or null to
// generate one normally. The second is the popout indicator HTML - try an image...?
// Try writeMenus(null, '<img src="...">'); in your own script.
writeMenus(newRoot, '>');
// This is a quick snippet that captures all clicks on the document and hides the menus
// every time you click. Use if you want.
if (isNS4) document.captureEvents(Event.CLICK);
document.onclick = clickHandle;
function clickHandle(evt) {
if (isNS4) document.routeEvent(evt);
hideAllBut(0);
}
// Show root menu command - place in an onLoad="..." type function if you want.
eval(docObj + menu[0][0].id + styObj + '.visibility = "visible"');

