/* Syntaxes:
 *
 * menu[menuNumber][0] = new Menu('menu ID', left, top, width, 'mouseover colour',
 *'background colour', 'border colour');
 * Left and Top are measured on-the-fly relative to the top-left corner of its trigger.
 *
 * menu[menuNumber][itemNumber] = new Item('Text', 'URL', vertical spacing to next item, 
 *target menu number);
 * If no target menu (popout) is desired, set it to 0. All menus must trace back their
 * targets to the root menu! That is, every menu must be targeted by one item somewhere.
 * Even if you're not writing the root menu, you must still specify its settings here.
 */

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 = 'yellow', defBack = 'lime', defBorder = 'red';
// Default height of menu items - the spacing to the next item, actually.

var defHeight = 25;
// 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, 80, '#669999', '#006666', defBorder);
// Notice how the targets are all set to nonzero values...
menu[0][1] = new Item('File', '#', defHeight, 1);
menu[0][2] = new Item('Edit', '#', defHeight, 2);
menu[0][3] = new Item('Tools', '#', defHeight, 3);
menu[0][4] = new Item('Help', '#', defHeight, 4);
menu[0][5] = new Item('Fun', '#', defHeight, 5);

menu[1] = new Array();
// The File menu is positioned 0px across and 18 down from its trigger, and is 80 wide.
menu[1][0] = new Menu('fileMenu', 0, 18, 150, defOver, defBack, defBorder);
menu[1][1] = new Item('Homepage', 'index.html', defHeight, 0);
menu[1][2] = new Item('Web Development', 'webPromo.html', defHeight, 0);
menu[1][3] = new Item('Computer Services', 'compuSales.html', defHeight, 0);
menu[1][4] = new Item('Computer Training', 'webPromo.html', defHeight, 0);
menu[1][5] = new Item('Printing & Publishing', 'printing.html', defHeight, 0);
menu[1][6] = new Item('Phone Services', 'phone.html', defHeight, 0);
menu[1][7] = new Item('Business Centre', 'document.html', defHeight, 0);
menu[1][8] = new Item('e-Shopping', 'eshop/index.htm', defHeight, 0);
// Non-zero target means this will trigger a popup.
menu[1][9] = new Item('Useful Links >>>', 'javascript:void(0)', defHeight, 6);
menu[1][10] = new Item('Exit', 'javascript:window.close(0)', defHeight, 0);

menu[2] = new Array();
menu[2][0] = new Menu('editMenu', 0, 18, 145, defOver, defBack, defBorder);
menu[2][1] = new Item('Undo Navigation <-', 'javascript:history.back(0)', defHeight, 0);
menu[2][2] = new Item('Redo Navigation ->', 'javascript:history.forward(0)', defHeight, 0);
menu[2][3] = new Item('Find on this Site', 'search.html', defHeight, 0);
menu[2][4] = new Item('Search the Net', 'netSearch.html', defHeight, 0);
menu[2][5] = new Item('Message Board', 'corkboard/index.html', defHeight, 0);

menu[3] = new Array();
menu[3][0] = new Menu('toolMenu', 0, 18, 120, defOver, defBack, defBorder);
menu[3][1] = new Item('e-Shopping', 'eshop/index.htm', defHeight, 0);
menu[3][2] = new Item('News >>>', '#', defHeight, 10);
menu[3][3] = new Item('Calendar', 'tools/calendar.html', defHeight, 0);
menu[3][4] = new Item('Calculator', 'tools/calculator.html', defHeight, 0);
menu[3][5] = new Item('Address Book', 'tools/address.html', defHeight, 0);
menu[3][6] = new Item('Photo Album', 'photoSlide.html', defHeight, 0);
menu[3][7] = new Item('Message Board', 'corkboard/index.html', defHeight, 0);

menu[4] = new Array();
menu[4][0] = new Menu('helpMenu', 0, 18, 150, defOver, defBack, defBorder);
menu[4][1] = new Item('Help Page', 'help.html', defHeight, 0);
menu[4][2] = new Item('Send Feedback', 'feedback.html', defHeight, 0);
menu[4][3] = new Item('Email Webmaster', 'javascript:"mailto:webmaster@iortyange.8m.com?subject=INFO REQUEST FROM MASHI COMPUTER CENTRE WEBSITE&body=Dear Webmaster at www.iortyange.8m.com, I have visited your site at http://www.iortyange.8m.com and I have the following message for you..."', defHeight, 0);
menu[4][4] = new Item('Message Board', 'corkboard/index.html', defHeight, 0);
menu[4][5] = new Item('Privacy Policy', 'privacy.html', defHeight, 0);
menu[4][6] = new Item('About >>>', 'javascript:void(0)', defHeight, 7);

menu[5] = new Array();
menu[5][0] = new Menu('funMenu', 0, 18, 130, defOver, defBack, defBorder);
menu[5][1] = new Item('Break Out', 'games/break-out.html', defHeight, 0);
menu[5][2] = new Item('Memory', 'games/memory.html', defHeight, 0);
menu[5][3] = new Item('Box Puzzle', 'games/box-puzzle.html', defHeight, 0);
menu[5][4] = new Item('Crab Race', 'games/crab-race.html', defHeight, 0);
menu[5][5] = new Item('Distances', 'games/distances.html', defHeight, 0);
menu[5][6] = new Item('Fighter', 'games/fighter.html', defHeight, 0);
menu[5][7] = new Item('Typing', 'games/typing-test.html', defHeight, 0);
menu[5][8] = new Item('Hangman', '#', defHeight, 8);

menu[6] = new Array();
menu[6][0] = new Menu('subFile', 120, -0, 140, 'yellow', 'lime', 'red');
menu[6][1] = new Item('Tiv People', 'http://tiv.4t.com/', defHeight, 0);
menu[6][2] = new Item('Iortyange.Net', 'http://www.iortyange.8m.net/index.html', 
defHeight, 0);
menu[6][3] = new Item('The CYON', 'http://cyon.faithweb.com/', defHeight, 0);
menu[6][4] = new Item('The KSAFCYO', 'http://ksafcyo.faithweb.com/', defHeight, 0);
menu[6][5] = new Item('Message Board', 'corkboard/index.html', 
defHeight, 0);
menu[6][6] = new Item('Automobile Africa', 'http://www.automobileafrica.com/index.html', 
defHeight, 0);
menu[6][7] = new Item('JavaScript', '#', defHeight, 9);
menu[6][7] = new Item('Other Links >>>', 'links.html', defHeight, 0);

menu[7] = new Array();
menu[7][0] = new Menu('subAbout', 120, -0, 130, defOver, defBack, defBorder);
menu[7][1] = new Item('Read about Us', 'aboutUs.html', defHeight, 0);
menu[7][2] = new Item('Read about You', 'aboutYou.html', defHeight, 0);

menu[8] = new Array();
menu[8][0] = new Menu('subFun', 120, -0, 180, 'yellow', 'lime', 'red');
menu[8][1] = new Item('Nigerian States/Towns', 'games/hangman1.html', defHeight, 0);
menu[8][2] = new Item('American Presidents', 'games/hangman2.html', defHeight, 0);

menu[9] = new Array();
menu[9][0] = new Menu('subJava', 120, -0, 150, defOver, defBack, defBorder);
menu[9][1] = new Item('JavaScript Source', 'http://www.javascriptsource.com/', defHeight, 0);
menu[9][2] = new Item('JavaScript Home', 'http://www.javascript.internet.com/', defHeight, 0);

menu[10] = new Array();
menu[10][0] = new Menu('subNews', 120, -0, 150, defOver, defBack, defBorder);
menu[10][1] = new Item('Top Stories', 'news/index.html', defHeight, 0);
menu[10][2] = new Item('World News', 'news/world.html', defHeight, 0);

menu[10][3] = new Item('Travel', 'news/travel.html', defHeight, 0);
menu[10][4] = new Item('Internet', 'news/internet.html', defHeight, 0);
menu[10][5] = new Item('Computers', 'news/computers.html', defHeight, 0);
menu[10][6] = new Item('Web Design', 'news/web-design.html', defHeight, 0);


// 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, 0, '100%', 17, 'hidden', '#006666', null, 100, '');
newRoot += startDL('rootMenu1', 5, 0, 40, 17, 'inherit', '#006666', null, 100, mouseProps(0, 1));
newRoot += '<span class="Item"><FONT weight="bold" face="comic sans ms" color="white">  <b><u>F</u>ile</b></FONT></span>' + endDL;
newRoot += startDL('rootMenu2', 55, 0, 40, 17, 'inherit', '#006666', null, 100, mouseProps(0, 2));
newRoot += '<span class="Item"><FONT weight="bold" face="comic sans ms" color="white">  <b><u>E</u>dit</b></FONT></span>' + endDL;
newRoot += startDL('rootMenu3', 105, 0, 40, 17, 'inherit', '#006666', null, 100, mouseProps(0, 3));
newRoot += '<span class="Item"><FONT weight="bold" face="comic sans ms" color="white">  <b><u>T</u>ools</b></FONT></span>' + endDL;
newRoot += startDL('rootMenu4', 155, 0, 40, 17, 'inherit', '#006666', null, 100, mouseProps(0, 4));
newRoot += '<span class="Item"><FONT weight="bold" face="comic sans ms" color="white">  <b><u>H</u>elp</b></FONT></span>' + endDL;
newRoot += startDL('rootMenu5', 205, 0, 40, 17, 'inherit', '#006666', null, 100, mouseProps(0, 5));
newRoot += '<span class="Item"><FONT weight="bold" face="comic sans ms" color="white">  <b><u>F</u>un</b></FONT></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"');
// This is just the moving command for the example.
function moveRoot() {
rM = eval(docObj + menu[0][0].id + styObj);
if (parseInt(rM.top) < 40) rM.top = 40;
else rM.top = 0;
}
