// JavaScript Document

// *** (2) MENU DATA ***
//
// Read this section VERY CAREFULLY, it explains how to arrange and tweak the menus themselves.
// To use this script you must create one or more PopupMenu() objects, that will contain all
// the menu data and settings used. This demo contains one, named 'pMenu', although you can
// have as many totally separate menus as you want on one page.
//    Next we add menus and items to the object, using its startMenu() and addItem()
// commands. Each menu object MUST contain one menu named 'root', which is the first, always
// visible menu. The syntax of the startMenu() command is:
//
// startMenu('menu name', Vertical menu (true/false)?, left, top, width, default ItemStyle
//  for items in this menu, optional parent frame/window or layer in which this menu resides);
//
// In order, the parameters are a name for the menu like 'root' or 'mFile', which you can use to
// refer to this menu from other menus, to pop it out.
//    Next, pass 'true' if you want this to be a vertical stacked menu or 'false' if you want this
// to be a horizontal menu bar. You can orientate each menu differently this way.
//   The Left and Top positions allow you to locate this menu either absolutely from the page or
// relative to menu item that pops it out. If you want to offset this menu from the item that pops
// it out, set the positions as NUMBERS, e.g. 130, 10 would put the upper-left corner of this menu
// 130px across and 10px down from the upper-left corner of the item that popped it out.
//   If you put '130', '10' as positions in QUOTES, you can position the menu from the upper-left
// corner of the whole page. These strings can also include formulae to centre or scroll the menu,
// examples are included later on. Note: the 'root' menu is always positioned from the page corner.
//    The 'width' depends on the orientation of the menu -- for vertical menus it's the width,
// for horizontal menus it is the height. Basically, it's the constant dimension for all the items.
//    The parent window or layer parameter is optional, if not specified the current window is
// used -- this example does not use frames. See the frameset example file if you're using them,
// they are strings that when evaluated return a reference, like 'window.top'.
//
// Once you have created a menu, you add items to that menu using the addItem() command.
// You must give it THREE compulsory parameters: 1) The HTML/text to display in the item. 2) The
// menuname/filename/URL the item activates. 3) The action type or target frame of that item.
// All other parameters are optional -- you can override the menu's default ItemStyle with the
// item's own, and optionally override that was well by specifying a list of parameters in the
// same order as an ItemStyle, to give each item its own dimensions / colours etc.
// See the example menu below for an example of these extras...
//
// addItem('Text', 'URL or menuname', 'action type', optional ItemStyle, length, spacing,
//  'popout indicator', popout indicator position, etc... in the same order as ItemStyles);
//
// The third parameter, 'action type', tells the script what to do with the second parameter.
// You can tell the script to load a file in the current window or a particular frame, tell it
// to pop out a menu, or tell it to run a JavaScript command. You do these like this:
//
// addItem('Text', 'file.html', ''); //blank means opens up 'file.html' in the current window.
// addItem('Text', 'file.html', 'parent.content');  //opens 'file.html' in a frame named 'content'.
// addItem('Text', 'menuName', 'sm:');  //pops out another submenu called 'menuName'.
// addItem('Text', 'alert("Hello")', 'js:');  //runs a JavaScript command when clicked.
//
// Frame names should be valid JavaScript syntax, e.g. 'top.frameName' or 'parent.popupWin',
// evaluated from the the window containing the main script (this one). Also, this system means
// 'sm:' items aren't normally clickable. If you do want to add click or mouseover actions to
// items, see the "Optional Code" section of the script below.
//
// parameters 5 and 6 are colors I think
// 
// See the example below if this seems complicated, it's quite easy once you get the hang of it.
// Thanks to Martin J. Cole for originally suggesting the syntax!
// If you want more information, there's a FAQ (Frequently Asked Questions) section on my
// site: http://www.twinhelix.com, on the 'Popup Menus' page, or try the 'Site Forums" perhaps.



// A PopupMenu() object must be passed its own name so it can reference itself when the menu
// is active. We also use a 'with' block to work with its properties and functions below.
var pMenu = new PopupMenu('pMenu');
with (pMenu)
{

// *** MOVE OR CENTRE THE MENU HERE ***

// To centre it, or scroll with the window etc, just include a global variable or formula as one
// of the positions. This script includes my page object, which has several useful methods, namely
// 'page.winW()', 'page.winH()', 'page.scrollY()' and 'page.scrollX()'. These return the current
// dimensions of the visible window area and the scroll position of the window, which can be
// used to position menus however you want. Try replacing the first startMenu() below with one of
// these commented lines, and scroll/resize the window to see how they work.

//startMenu('root', false, 'page.winW()/2 - pMenu.menu.root[0].menuW/2', 0, 17, hBar); // Centres.
//startMenu('root', false, 10, 'page.scrollY()', 17, hBar); // Floats with window as you scroll.
//startMenu('root', false, 10, 0, 17, hBar, 'frameName'); // To create in subframe.

// The 'root' menu is horizontal, positioned at (x = 10, y = something) and is 17px high, and items
// by default use the colours and dimensions in the 'hBar' ItemStyle defined above.
// This menu is also positioned over a similarly-coloured table in the HTML document above.
//startMenu('root', false, 10, 200, 17, hBar);
// Yes this should be an else if but there is something wrong then with isOp
//if( isIE )
//startMenu('root', false, '20', '192', 17, hBar); 
//else
//startMenu('root', false, '20', '192', 17, hBar);
//if( isOp )
//startMenu('root', false, '20', '187', 17, hBar);

// bab 20080624 Why isn't this the same as systronix.com??
if( isIE )
startMenu('root', false, '20', '198', 17, hBar); 
else
startMenu('root', false, '20', '187', 17, hBar);
if( isOp )
startMenu('root', false, '20', '187', 17, hBar);


<!-- else startMenu('root', false, 'page.winW()/2 - pMenu.menu.root[0].menuW/2', '195', 17, hBar); 



// Next is an example of a Javascript function embedded in the menu, to open a new window...
// Also, note the extra optional 4th and 5th parameters -- this menu item is 90px long,
// rather than the default length from the ItemStyle.
addItem('&nbsp; Home & Info', 'mInfo', 'sm:', hBar, 90);

// The text is a space then 'File', and this item pops out the 'mFile' submenu when moused over
// as we've set 'sm:' as the action type. If you want to assign a click action (e.g. navigating to
// a file) to one of these 'sm:' items, see the 'Optional Code' section below.
addItem('&nbsp; JCX Hardware', 'mHard', 'sm:', hBar, 100);
addItem('&nbsp; JCX Software', 'mSoft', 'sm:', hBar, 100);
addItem('&nbsp; JCX Mechanical', 'mMech', 'sm:', hBar, 110);
addItem('&nbsp; Support & Help', 'mHelp', 'sm:', hBar, 100);
// Next is an example of a Javascript function embedded in the menu, to open a new window...
// Also, note the extra optional 4th and 5th parameters -- this menu item is 80px long,
// rather than the default length from the ItemStyle.
//addItem('&nbsp; JCX Home', 'http://www.jcx.systronix.com', '', hBar, 70);
//addItem('&nbsp; Shop (soon)', 'http://store.systronix.com', '', hBar, 80);
addItem('&nbsp; Shop', 'mShop', 'sm:', hBar, 40);

startMenu('mShop', true, 0, 22, 120, subM);
addItem('&nbsp; Systronix Store', 'http://store.systronix.com', '');

// This is a vertical menu positioned 0px across and 22px down from its trigger, and is 120px wide.
// The URLs are set to # here, be sure to replace them with your path/file names or JS functions!
// Also note how all the types are '', indicating these links open in the current frame.

// bbboyes this opens a URL in a new browser window which seems to be a clone of the current window
// addItem('&nbsp; Robix Web Site', 'http://www.robix.com', 'js:window.open()');

startMenu('mInfo', true, 0, 22, 150, subM);
addItem('&nbsp; JCX Home', 'http://www.jcx.systronix.com', '');
addItem('&nbsp; JCX News', 'http://www.jcx.systronix.com/news.htm', '');
addItem('&nbsp; Conferences &<br>&nbsp;&nbsp;&nbsp;Public Appearances', 'http://www.systronix.com/appearances.html', '', '', 38);
addItem('&nbsp; Robotics Standards<br>&nbsp;&nbsp;&nbsp;through OMG', 'http://www.jcx.systronix.com/OmgRobotics.html', '', '', 38);
addItem('&nbsp; JCX Overview', 'http://www.jcx.systronix.com/whyjcx.htm', '');
addItem('&nbsp; JCX vs JSimm', 'http://www.jcx.systronix.com/JcxJsimmExplained.html', '');
addItem('&nbsp; JCX XML Tagging', 'http://www.jcx.systronix.com/XmlTagging.html', '');
addItem('&nbsp; JCX Specifications', 'http://www.jcx.systronix.com/specs.htm', '');
addItem('&nbsp; JCX Schematics', 'http://www.jcx.systronix.com/schematics.htm', '');
addItem('&nbsp; Compare Lego RCX&reg;', 'http://www.jcx.systronix.com/compare.htm', '');
addItem('&nbsp; JCX in Education', 'mEdu', 'sm:');
addItem('&nbsp; Related Products', 'mRelated', 'sm:');
addItem('&nbsp; Using this site', 'http://www.jcx.systronix.com/using.htm', '');
addItem('&nbsp; Systronix Home', 'http://www.systronix.com', '');

startMenu('mSoft', true, 0, 22, 130, subM);
//addItem('&nbsp; Overview/Start', '#', 'js:window.open("http://www.jcx.systronix.com/soon.html", "Soon", 'width=300') );
addItem('&nbsp; Overview/Start', '', '' , notYet);
//addItem('&nbsp; Systronix News', '#', '', notYet, 22);
addItem('&nbsp; JCX Java API', 'http://www.jcx.systronix.com/jcx_java_package.htm', '');
//addItem('&nbsp; javaxcomm', '#', '');
//addItem('&nbsp; 1-Wire J2ME API', 'window.open("http://jstampu.systronix.com/appnotes/listow/cldc_1wire.htm")', 'js:');
addItem('&nbsp; 1-Wire J2ME API', 'http://jstampu.systronix.com/appnotes/listow/cldc_1wire.htm', '');
//addItem('&nbsp; CMUcam API', '#', '');
//addItem('&nbsp; CMUcam API', '#', '', '', '100', '', '', '0', '0', '#00FF00', "#0000FF');
addItem('&nbsp; Examples', 'mExam', 'sm:');

startMenu('mHard', true, 0, 22, 120, subM);
addItem('&nbsp; Overview/Start', '', '', notYet);
addItem('&nbsp; Product Matrix', '', '', notYet);
addItem('&nbsp; Controllers', 'mCont', 'sm:');
addItem('&nbsp; Inputs', 'mInp', 'sm:');
addItem('&nbsp; Outputs', 'mOut', 'sm:');
addItem('&nbsp; Communication', 'mComm', 'sm:');
addItem('&nbsp; LCDs & GUIs', 'mGui', 'sm:');
addItem('&nbsp; Connectors', 'mConn', 'sm:');
addItem('&nbsp; Alpha Models', 'mEarly', 'sm:');


startMenu('mEdu', true, 155, 0, 120, subM);
addItem('&nbsp; Pricing', '', '', notYet);
addItem('&nbsp; Curricula', '', '', notYet);
addItem('&nbsp; Examples', 'mEduExam', 'sm:');

startMenu('mEduExam', true, 125, 0, 120, subM);
addItem('&nbsp; Univ of Utah', 'http://www.cs.utah.edu/classes/cs4710/', '');
addItem('&nbsp; HockeyBots', 'http://www.cielguard.com', '');

startMenu('mEarly', true, 125, 0, 130, subM);
addItem('&nbsp; Motor Alpha', 'http://www.jcx.systronix.com/quadmotor.htm', '');
addItem('&nbsp; Sensor Alpha', 'http://www.jcx.systronix.com/octalsensor.htm', '');

startMenu('mMech', true, 0, 22, 130, subM);
addItem('&nbsp; Lego&reg; Technics', 'mLego', 'sm:');
addItem('&nbsp; Vex&reg; Robotics', 'mVex', 'sm:');
addItem('&nbsp; Robix&reg;', 'mRobix', 'sm:');
addItem('&nbsp; Lynxmotion', 'mLynx', 'sm:');

startMenu('mLego', true, 135, 0, 140, subM);
addItem('&nbsp; JCX Sonar TrackBot', 'http://jcx.systronix.com/appnotes/SonarTrackbot/SonarTrackbot.html', '');
addItem('&nbsp; Lego Education', 'http://www.legoeducation.com', '');
addItem('&nbsp; Lego Mindstorms', 'http://mindstorms.lego.com/eng', '');
addItem('&nbsp; BrickLink (parts)', 'http://www.bricklink.com/', '');
addItem('&nbsp; BrickShelf Technic', 'http://www.brickshelf.com/cgi-bin/customview.cgi?include=Technic', '');

startMenu('mVex', true, 135, 0, 140, subM);
addItem('&nbsp; Vex & JCX - <br>&nbsp;&nbsp;&nbsp;Overview', 'http://www.jcx.systronix.com/vex/vex.html', '', '', 38);
addItem('&nbsp; Vex & JCX - <br>&nbsp;&nbsp;&nbsp;Get Started!', 'http://www.jcx.systronix.com/vex/getstarted.html', '', '', 38);
addItem('&nbsp; VexRobotics Kits', 'http://www.vexrobotics.com', '');
addItem('&nbsp; Vex Labs', 'http://www.vexlabs.com', '');
addItem('&nbsp; IFIrobotics', 'http://www.ifirobotics.com/', '');

startMenu('mRobix', true, 135, 0, 140, subM);
addItem('&nbsp; Robix & JCX', 'http://www.jcx.systronix.com/robix.html', '');
addItem('&nbsp; Robix Site', 'http://www.robix.com', '');

startMenu('mLynx', true, 135, 0, 140, subM);
addItem('&nbsp; Lynxmotion & JCX', 'http://www.jcx.systronix.com/lynxmotion.html', '');
addItem('&nbsp; Lynxmotion site', 'http://www.lynxmotion.com', '');
addItem('&nbsp; Servo Erector Set', 'http://www.lynxmotion.com/Category.aspx?CategoryID=73', '');


startMenu('mRelated', true, 155, 0, 100, subM);
addItem('&nbsp; JRealTime', 'http://www.jrealtime.com', '');
addItem('&nbsp; JSimm', 'http://www.jsimm.com', '');
addItem('&nbsp; JStamp', 'http://www.jstamp.com', '');
addItem('&nbsp; JStik', 'http://www.jstik.com', '');
//addItem('&nbsp; * JStik', 'http://www.jstik.com', 'js:window.open()');

startMenu('mCont', true, 125, 0, 120, subM);
addItem('&nbsp; JSimm.JStamp', 'http://www.jsimm.com/jsimm_jstamp.htm', '');
addItem('&nbsp; JStik', 'http://jstik.systronix.com/specs.htm', '');

startMenu('mInp', true, 125, 0, 120, subM);
addItem('&nbsp; JCX.Sensor', 'http://www.jcx.systronix.com/sensor.htm', '');
addItem('&nbsp; Sonar', 'http://jcx.systronix.com/appnotes/sonar_ranger.htm', '');
addItem('&nbsp; Color vision<br>&nbsp;&nbsp;&nbsp;using CMUcam2', 'http://jcx.systronix.com/appnotes/CMUcam2/cmucam2.html', '', '', 38);
//addItem('&nbsp; CMUcam', '#', '');
//addItem('&nbsp; IR rangefinder', '#', '');
addItem('&nbsp; JCX.AIO', 'http://jsimm.systronix.com/jsimm_aio.htm', '');
addItem('&nbsp; JCX.DIO', 'http://jcx.systronix.com/dio/jcx_dio.html', '');

startMenu('mGui', true, 125, 0, 120, subM);
addItem('&nbsp; Amulet LCD/GUI', 'http://jstampu.systronix.com/appnotes/arm5/arm5.htm', '');
//addItem('&nbsp; PalmOS PDAs', '#', '');

startMenu('mOut', true, 125, 0, 120, subM);
addItem('&nbsp; JCX.Motor', 'http://www.jcx.systronix.com/motor.htm', '');
addItem('&nbsp; R/C Servos', 'http://jcx.systronix.com/appnotes/servo.htm', '');
addItem('&nbsp; JCX.AIO', 'http://jsimm.systronix.com/jsimm_aio.htm', '');
addItem('&nbsp; JCX.DIO', 'http://jcx.systronix.com/dio/jcx_dio.html', '');


startMenu('mConn', true, 125, 0, 130, subM);
addItem('&nbsp; 6-slot Backplane', 'http://www.jsimm.com/backplane.htm', '');
addItem('&nbsp; JSimm Connector', 'http://jsimm.systronix.com/jsimm_connector.htm', '');
addItem('&nbsp; Brick Connector', 'http://www.jcx.systronix.com/brick_connector.htm', '');
addItem('&nbsp; Pluggable Wires', '', '', notYet);

startMenu('mComm', true, 125, 0, 120, subM);
//addItem('&nbsp; RS232 & RS485', '#', '');
addItem('&nbsp; Dallas 1-Wire&reg;', 'http://jstampu.systronix.com/appnotes/listow/cldc_1wire.htm', '');
addItem('&nbsp; IrDA', 'http://www.systronix.com/irda/irda.htm', '');
addItem('&nbsp; RFModem', 'http://www.jcx.systronix.com/rfmodems.htm', '');
addItem('&nbsp; Ethernet', 'http://www.jstik.com', '');
//addItem('&nbsp; RCX Infrared', '#', '');

startMenu('mHelp', true, 0, 22, 100, subM);
addItem('&nbsp; FAQ', '', '', notYet);
addItem('&nbsp; Updates', 'mUpd', 'sm:', subM);
addItem('&nbsp; eGroups', 'mGrps', 'sm:', subM);
addItem('&nbsp; References', 'mRefs', 'sm:', subM);

startMenu('mExam', true, 135, 0, 110, subM);
addItem('&nbsp; Getting Started', '', '', notYet);
addItem('&nbsp; Sonar Ranger', 'http://jcx.systronix.com/appnotes/sonar_ranger.htm', '');
addItem('&nbsp; Lego&reg; Arm', 'http://jcx.systronix.com/appnotes/lego-arm.htm', '');
addItem('&nbsp; Sonar Trackbot', 'http://jcx.systronix.com/appnotes/SonarTrackbot/SonarTrackbot.html', '');
addItem('&nbsp; Arm w/Vision', '', '', notYet);
addItem('&nbsp; JDroid', 'http://www.jdroid.com', '');


startMenu('mUpd', true, 105, 0, 100, subM);
addItem('&nbsp; aJile Tools', 'http://jstampu.systronix.com/ajile_docs.htm', '');
addItem('&nbsp; JCX API', 'http://jcx.systronix.com/jcx_java_package.htm', '');


startMenu('mGrps', true, 105, 0, 130, subM);
//addItem('&nbsp; JCX@JavaDevices', '#', '');
addItem('&nbsp; New! Systronix Java<br> &nbsp; &nbsp; MailMan List', 'http://mailman.xmission.com/cgi-bin/mailman/listinfo/systronixjava', '', '', 38);
addItem('&nbsp; Old Yahoo eGroups<br> &nbsp; &nbsp; (archive only)', 'mYahoo', 'sm:', subM, 38);
addItem('&nbsp; Lego&reg; Users', 'http://www.lugnet.com/', '');
addItem('&nbsp; Amulet Users', 'http://groups.yahoo.com/group/Amulet', '');

			startMenu('mYahoo', true, 145, 0, 125, subM);
			addItem('&nbsp; JStamp&reg; eGroup', 'http://groups.yahoo.com/group/jstamp/', '');
			addItem('&nbsp; JStik&trade; eGroup', 'http://groups.yahoo.com/group/jstik/', '');
			addItem('&nbsp; TStik&trade; eGroup', 'http://groups.yahoo.com/group/TStik_TStamp', '');


startMenu('mRefs', true, 105, 0, 170, subM);
addItem('&nbsp; PracticalEmbeddedJava', 'http://www.practicalembeddedjava.com', '');
//addItem('&nbsp; J2ME/CLDC at Sun', '#', '');
addItem('&nbsp; Java Robot Sim', 'http://www.jdroid.com/construction.htm', '');  


// You can assign 'oncreate' events to specific menus. By default, the script has only one for
// the root menu that shows it when it is created. You may wish to change it to something like the
// following, which uses the animation function to show the menu, or delay its show altogether.
//menu.root[0].oncreate = function()
// { this.visNow=true; pMenu.position('root'); pMenu.showMenu('root') }

// Uncomment these lines to make specific menus show popouts on click rather than on mouseover.
//menu.root[0].subsOnClick = true;
//menu.mFile[0].subsOnClick = true;

// You can also customise hide or show delays (in milliseconds) to the menus. Defaults are:
//showDelay = 0;
//hideDelay = 500;
// Specify hideDelay as zero if you want to disable autohiding, and showDelay as a couple of
// hundred if you don't want the menus showing instantaneously when moused over.

// End of 'with (pMenu)' block. That's one menu object created, now we have to activate it...

}

// *** (3) MENU EFFECTS AND ANIMATION ***


// Now you've created a basic menu object, you can add optional effects like borders and
// shadows to specific menus. These functions are found in the "Optional Code" section
// below, you can edit them or delete them entirely if you don't want to use them, with
// no harm to the rest of the script itself.


// Add a border to an all menus using a specified ItemStyle. The syntax is:
// addMenuBorder(menuObject, ItemStyle,
//  opacity of border, 'border colour', border width, 'padding colour', padding width);
// Opacity is a number from 0 to 100, or null for no filter, like the ItemStyles.

addMenuBorder(pMenu, window.subBlank,
 null, '#666666', 1, '#CCCCDD', 2);


// Apply a dropshadow to specific menus again. The syntax is similar, but later on you
// pass arrays [...] for each layer of the shadow you want. I've used two grey layers
// here, but you can use as many or as few as you want. The syntax for the layers is:

// [opacity, 'layer colour', X offset, Y offset, Width Difference, Height difference]

// Opacity is from 0 to 100 (or null for no filter), and the X/Y offsets are the
// distance in pixels from the menu's top left corner to that shadow layer's corner.
// The width/height differences are added or subtracted to the current menu size, for
// instance the first layer of this shadow is 4px narrower and shorter than the menu
// it is shadowing.

addDropShadow(pMenu, window.subM,
 [40,"#333333",6,6,-4,-4], [40,"#666666",4,4,0,0]);
addDropShadow(pMenu, window.subBlank,
 [40,"#333333",6,6,-4,-4], [40,"#666666",4,4,0,0]);


// Add animation to the 'pMenu' menu object for supported browsers.
// Opera doesn't support clipping so we turn it off, and Mozilla versions prior to
// 1.x (such as Netscape 6) are too slow to support it, so disable there too.
// If you don't want animation, delete this entirely, and the menus will act normally.
// Change the speed if you want... it's the last number, between -100 and 100, and is
// defined as the percentage the animation moves each frame.
// The 'menuAnim' function is in the "Optional Code" section below, edit if you want to,
// I've put in a few extra tweaks in there like fading transitions if you're interested.

//if (!isOp && navigator.userAgent.indexOf('rv:0.')==-1)
//{
// pMenu.showMenu = new Function('mN','menuAnim(this, mN, 10)');
// pMenu.hideMenu = new Function('mN','menuAnim(this, mN, -10)');

 // Alternatively: try the IE5.5+/Windows filters. Comment above two lines out and uncomment:
 //pMenu.showMenu = function(mN)
 // { menuFilterShow(this, mN, 'progid:DXImageTransform.Microsoft.fade(duration=1)') }
 // There's a good list of transitions available from http://msdn.microsoft.com

 // Add animation to other menu objects like this...
 //anotherMenu.showMenu = new Function('mN','menuAnim(this, mN, 10)');
 //anotherMenu.hideMenu = new Function('mN','menuAnim(this, mN, -10)');
//}


// Advanced (or just plain determined to tweak everything) users: Custom item arrangement!
// Here you can extend a menu's overall dimensions, and then reposition or resize its items.
// You can arrange the items however you want within a menu, in a curve or similar,
// or even change the overall arrangement of the menu (put items in rows etc).
// Individual items have .iX and .iY which are positions and .iW and .iH which are dimensions.
// I recommend doing this *before* calling the border or shadow commands too :).

//with (pMenu.menu)
//{
// mFile[0].menuW += 20;
// mFile[0].menuH += 20;
// mFile[1].iX += 5;
// mFile[2].iX += 2;
// mFile[2].iW -= 2;
// mFile[3].iX += 5;
// mFile[4].iX += 10;
// mFile[4].iW += 10;
// mFile[4].iY += 3;
//}

// *** (4) EVENTS ***
//
// In JavaScript, there are document 'events' you need to set so any scripts you are using
// are notified of things like page loading/clicking/scrolling. If you've got several menus
// or another JavaScript entirely in your page, you'll need to add all their functions in here.
// For another menu object, call its functions like update() and position() next to pMenu's,
// I've put examples in to show where these need to go.
//    The reason for these is that every time you set them, they override a previous setting.
// So make sure you collate all the functions that need to be called in here! Syntax:

//object.onevent = function()
//{
// function1();
// function2();
// ...
//}

// That's similar to: <BODY ONEVENT="function1(); function2(); ...">


// The most important event is one used to display the menu by calling one of several methods of
// any menu object(s) you have created. This is where you select the menu creation mode. 'Dynamic'
// mode inserts the menus into the document once it has finished loading and supports features
// like modifying the menu after creation. You update a menu in 'Dynamic' mode by just calling the
// .update() method of a menu object like 'pMenu'.
//    'Fast' creation mode writes the menus to the document here and now, which is faster and
// more reliable in many browsers but only when the document's loading -- you do this by passing
// 'true' without quotes to the update function to signal that we're inline.
//    Opera only supports Fast mode and Netscape 4 only supports in Dynamic mode, so we use
// browser-detect code here. If you find some browser has troubles with one mode or another, try
// the other menu creation method -- see the "Cross-Browser" code at the very top of the SCRIPT
// tag for the variables used.
//    Hardcore tweakers -- there's some extra code commented in the popOver() function at the top
// which lets you create the root menu on page load and other menus only as needed, which might
// be useful for very very large menus in a single frame. Look it up if you want.

if (!isNS4)
{
 // Write menus now in non-NS4 browsers, by calling the "Fast" mode .update(true) method.
 pMenu.update(true);
 //anotherMenu.update(true);
}
else
{
 // For Netscape 4, back up the old onload function and make a new one to update our menus.
 // This is the regular "Dynamic" mode menu update, it works in IE and NS6 too if required.
 var popOldOL = window.onload;
 window.onload = function()
 {
  if (popOldOL) popOldOL();
  pMenu.update();
  //anotherMenu.update();
 }
}


// Other events must be assigned, these are less complicated, just add or remove menu objects.

var nsWinW = window.innerWidth, nsWinH = window.innerHeight, popOldOR = window.onresize;
window.onresize = function()
{
 if (popOldOR) popOldOR();
 if (isNS4 && (nsWinW!=innerWidth || nsWinH!=innerHeight)) history.go(0);
 pMenu.position();
 //anotherMenu.position();
}

window.onscroll = function()
{
 pMenu.position();
 //anotherMenu.position();
}


// NS4 can't reliably capture clicks on layers, so here's a workaround.
if (isNS4)
{
 document.captureEvents(Event.CLICK);
 document.onclick = function(evt)
 {
  with (pMenu) if (overI) click(overM, overI);
  //with (anotherMenu) if (overI) click(overM, overI);
  return document.routeEvent(evt);
 }
}

// Activate the window.onscroll() event in non-Microsoft browsers.
if (!isIE || isOp)
{
 var nsPX=pageXOffset, nsPY=pageYOffset;
 setInterval('if (nsPX!=pageXOffset || nsPY!=pageYOffset) ' +
 '{ nsPX=pageXOffset; nsPY=pageYOffset; window.onscroll() }', 50);
}

// *** (5) OPTIONAL CODE ***   DELETE IF YOU'RE NOT USING THESE!


// MOUSE EVENTS:
//
// If you want, you can assign functions to handle mouse events like mouse over/out/click.
// You'll want to use these for assigning click actions to 'sm:' items or status messages etc.
// 'with (this)' means use the properties of the menu object, and it's passed the current
// menu name (mN) and item number (iN) you can use to calculate the active item.
// To uncomment and activate, delete the /* and */ at the start and end.

/*
pMenu.onclick = function(mN, iN) { with (this)
{
 // Do actions depending on the item that the mouse was over at the time of the click.
 // You may with to use nested IFs or 'switch' statements etc. if you're familiar with JS.

 if (mN == 'root')
 {
  if (iN == 1) status = 'Congratulations, you\'ve mastered clicking!';
  // Click on second item in root menu will navigate to 'edit.html'. Copy and paste this for
  // each menu item to add click actions to 'sm:' items...
  if (iN == 2) location.href = 'edit.html';
  if (iN == 3) location.href = 'help.html';
 }
}}

// Set the status message to the URL if the 'action type' is nothing, and clear on mouseout.
pMenu.onmouseover = function(mN, iN) { with (this)
{
 // By now, you either have my JS Object Browser script from my site or you need it... try
 // embedding in an IFrame and typing 'pMenu' into its Go To field to see the menu internals.
 with (menu[mN][iN]) if (!type) status = href;
}}
pMenu.onmouseout = function() { status = '' }
*/




