// Original:  Angus Turnbull
// Web Site:  http://gusnz.cjb.net

// See http://www.twinhelix.com/dhtml/fsmenu/demo/ for updated versions.

// Begin
/* 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 = '#000099', defBack = '#000000', defBorder = '#FFFFFF';
// Default height of menu items - the spacing to the next item, actually.
var defHeight = 22;
// 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, 68, '100%', defOver, defBack, defBorder);
// Notice how the targets are all set to nonzero values...
menu[0][1] = new Item('About Us', '#', defHeight, 1);
menu[0][2] = new Item('General Reference', '#', defHeight, 2);
menu[0][3] = new Item('Searches', '#', defHeight, 3);
menu[0][4] = new Item('Charity/Religion', '#', defHeight, 4);
menu[0][5] = new Item('Home', '#', defHeight, 5);

menu[1] = new Array();
// The aboutus menu is positioned 5 px across and 18 down from its trigger, and is 110 wide.
menu[1][0] = new Menu('aboutusMenu', 5, 18, 110, defOver, defBack, defBorder);
menu[1][1] = new Item('Our Skills', 'skills.shtml', defHeight, 0);
menu[1][2] = new Item('Our People', 'people.shtml', defHeight, 0);
menu[1][3] = new Item('Our Customers', 'customers.shtml', defHeight, 0);
menu[1][4] = new Item('Contact Us', 'testmail2.php', defHeight, 0);

menu[2] = new Array();
menu[2][0] = new Menu('refMenu', 5, 18, 110, defOver, defBack, defBorder);
menu[2][1] = new Item('Travel/Entertainmt &nbsp;&nbsp;&nbsp;', 'oref1.shtml', defHeight, 0);
menu[2][2] = new Item('Family &amp; Health &nbsp;&nbsp;&nbsp;&nbsp;', 'oref2.shtml', defHeight, 0);
menu[2][3] = new Item('Government &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'oref3.shtml', defHeight, 0);
menu[2][4] = new Item('News &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'oref4.shtml', defHeight, 0);
menu[2][5] = new Item('Weather &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'oref5.shtml', defHeight, 0);
menu[2][6] = new Item('Reference Desk &nbsp;&nbsp;', 'oref6.shtml', defHeight, 0);
menu[2][7] = new Item('Protect Yourself &nbsp;&nbsp;', 'oref7.shtml', defHeight, 0);

menu[3] = new Array();
menu[3][0] = new Menu('searchMenu', 5, 18, 110, defOver, defBack, defBorder);
menu[3][1] = new Item('Find People &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'find1.shtml', defHeight, 0);
menu[3][2] = new Item('Find Companies &nbsp;&nbsp;', 'find2.shtml', defHeight, 0);
menu[3][3] = new Item('Find Anything Else', 'find3.shtml', defHeight, 0);

menu[4] = new Array();
menu[4][0] = new Menu('charrelMenu', 5, 18, 110, defOver, defBack, defBorder);
menu[4][1] = new Item('Web Sites &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', '/rel1.shtml', defHeight, 0);
menu[4][2] = new Item('Indexes &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', '/rel2.shtml', defHeight, 0);
menu[4][3] = new Item('Resources &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', '/rel3.shtml', defHeight, 0);

menu[5] = new Array();
menu[5][0] = new Menu('homeMenu', 5, 18, 110, defOver, defBack, defBorder);
/*
menu[5][1] = new Item('Home Page &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', '/indexnew.shtml', 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, 64, '90%', 25, 'hidden', '#000000', null, 100, '');
newRoot += startDL('rootMenu1', 5, 4, 110, 17, 'inherit', '#000000', null, 100, mouseProps(0, 1));
newRoot += '<span class="Item">  <B>About Us</B></span>' + endDL;
newRoot += startDL('rootMenu2', 100, 4, 110, 17, 'inherit', '#000000', null, 100, mouseProps(0, 2));
newRoot += '<span class="Item">  <B>General Reference</B></span>' + endDL;
newRoot += startDL('rootMenu3', 255, 4, 110, 17, 'inherit', '#000000', null, 100, mouseProps(0, 3));
newRoot += '<span class="Item">  <B>Searches</B></span>' + endDL;
newRoot += startDL('rootMenu4', 355, 4, 110, 17, 'inherit', '#000000', null, 100, mouseProps(0, 4));
newRoot += '<span class="Item">  <B>Charity/Religion</B></span>' + endDL;
newRoot += startDL('rootMenu5', 490, 4, 110, 17, 'inherit', '#000000', null, 100, mouseProps(0, 5));
newRoot += '<span class="Item">  <A HREF="/indexnew.shtml"><FONT COLOR="WHITE"><B>Home</B></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.
document.onclick = clickHandle;
function clickHandle(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;
}
//  End
