// Me - My own Menu Bar
// Syntaxes: *** START EDITING HERE, READ THIS SECTION CAREFULLY! ***
//
// 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).336699
var defOver = '#0000FF', defBack = '#000080';

// 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. #669999 
// *** MOVE ROOT MENU AROUND HERE ***  it's positioned at (5, 0) and is 17px high now.
menu[0][0] = new Menu(false, '', 5, 35, 17, '#0000FF', '#000080', '', 'itemText');
// Notice how the targets are all set to nonzero values...
// The 'length' of each of these items 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.
// the 3rd parameter could contain _New if you want it to open a new window
menu[0][1] = new Item('  Home', 'http://www.RiverApes.com', '', 40, 10, 1);
menu[0][2] = new Item('  Latest', 'http://www.RiverApes.com/Latest/index.htm', '', 40, 10, 2);
menu[0][3] = new Item('  Work Done', 'http://www.RiverApes.com/Me/index.htm', '', 70, 20, 3);
menu[0][4] = new Item('  About Me', 'http://www.RiverApes.com/Me/index.htm', '', 68, 10, 4);

// Home.
menu[1] = new Array();
// The File menu is positioned 0px across and 22 down from its trigger, and is 80 wide.
// All text in this menu has the stylesheet class 'item' -- see the <style> section above.
// We've passed a 'greater-than' sign '>' as a popout indicator. Try an image...?
menu[1][0] = new Menu(true, '>', 0, 22, 80, defOver, defBack, 'itemBorder', 'itemText');
menu[1][1] = new Item('Search', 'http://www.RiverApes.com/search.htm', '', defLength , 0, 0);

// Latest menu.
menu[2] = new Array();
menu[2][0] = new Menu(true, '>', 0, 22, 150, defOver, defBack, 'itemBorder', 'itemText');
menu[2][1] = new Item('AAH on BBC Radio 4', 'http://www.RiverApes.com/Latest/scars_of_evolution.htm', '', defLength, 0, 0);
menu[2][2] = new Item('Apes 48 Humans 46, why?', 'http://www.RiverApes.com/AHAH/Hybrids/KaryotypeChange.htm', '', defLength, 0, 0);
menu[2][3] = new Item('AAH Defined, endorsed by Morgan', 'http://www.RiverApes.com/AAH/AAHDefined.htm', '', defLength, 0, 0);
menu[2][4] = new Item('Langdon JHE Critique', 'http://www.RiverApes.com/AAH/Arguments/Langdon/LangdonCritique.pdf', '', defLength, 0, 0);
menu[2][5] = new Item('AquaticApe.org Critique', 'http://www.RiverApes.com/AAH/Arguments/JimMoore/JMHome.htm', '', defLength, 0, 0);
menu[2][6] = new Item('Wading Paper published in Nutrition & Health', 'http://www.RiverApes.com/Me/Work/Nutrition and Health.htm', '', defLength, 0, 0);

// Work menu.
menu[3] = new Array();
menu[3][0] = new Menu(true, '>', 0, 22, 150, defOver, defBack, 'itemBorder', 'itemText');
menu[3][1] = new Item('Hybridisation Essay', 'http://www.RiverApes.com/Me/Work/HumanHybridisationTheory.htm', '', defLength, 0, 0);
menu[3][2] = new Item('Bipedal Wading in Hominoidae Thesis', 'http://www.RiverApes.com/Me/Work/BipedalismThesis.htm', '', defLength, 0, 0);
menu[3][3] = new Item('Nutition & Health Paper', 'http://www.RiverApes.com/Me/Work/Wading%20for%20NutritionAndHealth.htm', '', defLength, 0, 0);
menu[3][4] = new Item('Wading or Walking', 'http://www.RiverApes.com/Me/Work/WalkingOrWading.htm', '', defLength, 0, 0);
menu[3][5] = new Item('Roede et al Critique', 'http://www.RiverApes.com/AAH/FoF/FactOrFiction.htm', '', defLength, 0, 0);
menu[3][6] = new Item('First Langdon Critique', 'http://www.RiverApes.com/AAH/Arguments/Langdon/Langdon.htm', '', defLength, 0, 0);
menu[3][7] = new Item('Latest Langdon Critique', 'http://www.RiverApes.com/Me/Work/LangdonAAHMisunderstanding.doc', '', defLength, 0, 0);
menu[3][8] = new Item('Jim Moore Critique', 'http://www.RiverApes.com/AAH/Arguments/JimMoore/JMHome.htm', '', defLength, 0, 0);
menu[3][9] = new Item('ASHB 2004 Talk', 'http://www.RiverApes.com/Me/Work/AAHDismissedorMisunderstood', '', defLength, 0, 0);

// About Me menu
menu[4] = new Array();
menu[4][0] = new Menu(true, '>', 0, 22, 210, defOver, defBack, 'itemBorder', 'itemText');
menu[4][1] = new Item('My Mum...', 'http://www.kuliukas.com/Mum/index.htm', '', defLength, 0, 0);
menu[4][2] = new Item('My Dad...', 'http://www.kuliukas.com/Dad/index.htm', '', defLength, 0, 0);


// *** OPTIONAL CODE FROM HERE DOWN ***

// These two lines handle the window resize bug in NS4. See <body onResize="...">.
// I recommend you leave this here as otherwise when you resize NS4's width menus are hidden.

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. Use if you want.

if (isNS4) document.captureEvents(Event.CLICK);
document.onclick = clickHandle;

function clickHandle(evt)
{
 if (isNS4) document.routeEvent(evt);
 hideAllBut(0);
}


// This is just the moving command for the example.

function moveRoot()
{
 with(menu[0][0].ref) left = ((parseInt(left) < 100) ? 100 : 5);
}
//  End -->

