<!-- 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 = '#336699', defBack = '#003366', defBorder = '#000000';
// 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, 0, 80, '#003366', '#666666', defBorder);

// Notice how the targets are all set to nonzero values...
menu[0][1] = new Item('Home', '#', defHeight, 1);
menu[0][2] = new Item('History', '#', defHeight, 2);
menu[0][3] = new Item('Products', '#', defHeight, 6);
menu[0][4] = new Item('contactinfo', '#', defHeight, 3);
menu[1] = new Array();

// The File menu is positioned 0px across and 0 down from its trigger, and is 45 wide.
menu[1][0] = new Menu('homeMenu', 7, 0, 45, defBack, defBack, 0);
menu[1][1] = new Item('Home', 'index.htm', 17, 0);
menu[2] = new Array();

menu[2][0] = new Menu('hostoryMenu', 5, 0, 45, defBack, defBack, 0);
menu[2][1] = new Item('History', 'History.htm', 17, 0);
menu[3] = new Array();

menu[3][0] = new Menu('contactMenu', 5, 0, 78, defBack, defBack, 0);
menu[3][1] = new Item('Contact Info.', 'Contact_Info.htm', 17, 0);
menu[4] = new Array();

// Rightwards popout with a negative x relative to its trigger.
menu[4][0] = new Menu('cleaningMenu', 125, 0, 180, defOver, defBack, defBorder);
menu[4][1] = new Item('Gravity Selector', 'Gravity_Selector.htm', defHeight, 0);
menu[4][2] = new Item('Air Aspirator', 'Air_Aspirator.htm', defHeight, 0);
menu[4][3] = new Item('Trieur Battries', 'Trieur_Battries.htm', defHeight, 0);
menu[4][4] = new Item('Vibrating Seprator', 'Vibrating_Seprator.htm', defHeight, 0);
menu[4][5] = new Item('Horizontal Scourer', 'Horizontal_Scourer.htm', defHeight, 0);
menu[4][6] = new Item('Vertical Vibrating Turbo Sifter', 'vertical_vibrating.htm', defHeight, 0);
menu[5] = new Array();

// Rightwards popout with a negative x relative to its trigger.
menu[5][0] = new Menu('millingMenu', 125, 0, 180, defOver, defBack, defBorder);
menu[5][1] = new Item('Roller Mill', 'Roller_Mill.htm', defHeight, 0);
menu[5][2] = new Item('Drawer Plansifter', 'Drawer_Plansifter.htm', defHeight, 0);
menu[5][3] = new Item('Durum Detacher', 'Durum_Detacher.htm', defHeight, 0);
menu[5][4] = new Item('Centrifugal Pulversan', 'Centrifugal_Pulversan.htm', defHeight, 0);
menu[5][5] = new Item('Vibrating Discharger', 'Vibrating_Discharger.htm', defHeight, 0);

menu[6] = new Array();

menu[6][0] = new Menu('productsMenu', 0, 22, 120, defOver, defBack, defBorder);
menu[6][1] = new Item('Cleaning Section', 'Cleaning_Section.htm', defHeight, 4);
menu[6][2] = new Item('Milling Section', 'Milling_Section.htm', defHeight, 5);

// 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, 100, '100%', 17, 'hidden', '#666666', null, 100, '');

newRoot += startDL('rootMenu1', 5, 0, 45, 17, 'inherit', '#666666', null, 100, mouseProps(0, 1));
newRoot += '<span class="Item" style="cursor:hand" >&nbsp;Home</span>' + endDL;

newRoot += startDL('rootMenu2', 65, 0, 45, 17, 'inherit', '#666666', null, 100, mouseProps(0, 2));
newRoot += '<span class="Item" style="cursor:hand">&nbsp;History</span>' + endDL;

newRoot += startDL('rootMenu3', 135, 0, 55, 17, 'inherit', '#666666', null, 100, mouseProps(0, 3));
newRoot += '<span class="Item" style="cursor:default">&nbsp;Products</span>' + endDL;

newRoot += startDL('rootMenu4', 210, 0, 75, 17, 'inherit', '#666666', null, 100, mouseProps(0, 4));
newRoot += '<span class="Item" style="cursor:hand">&nbsp;Contact Info.</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, '&gt;');
// 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;
}
//  End -->

