// Cascading Popup Menus v5.2 - Single Frame Menu example script.// If you're upgrading from v5.1, you can paste your existing menu data in, and if you're// upgrading from v5.0 you need to add 'cursor' settings to your ItemStyles.//// And before going ANY further, you must have READ and AGREE TO the script license!// It can be found on my site, in the syntax helpfile, or in the demo script document.// The 'sub Menu' items: these have popout indicators of "Greater Than" signs ">" 15px from their// right edge, and CSS borders. Text class also changes on mouseover.var subM = new ItemStyle(15, 0, '&gt;', -15, 0, '#CCEBD6', '#009933', 'lowText', 'highText', 'itemBorder', 'itemBorder', null, null, 'hand', 'default');// Create a PopupMenu() object, and pass its own name so it can reference itself later on.// We also use a 'with' block to work with its properties and functions below.var pMenu = new PopupMenu('pMenu');with (pMenu){// Here's what the values in the next startMenu() command mean, in order://  'root': the name of this menu.//   false: orientated as a horizontal menu (true creates a vertical menu).//      0: the 'left' offset of this menu in pixels.//       0: the 'top' offset of this menu in pixels.//      207: the height of this menu (for vertical menus, this becomes the menu width).//    hBar: the ItemStyle used to give this menu colours and layout/formatting.//      '': this menu does not display within a frame (see the Frameset Example Script to do that).//   false: this menu shows submenus on mouseover. 'true' means show on click.//// Most of the items are 'sm:' items popping out submenus, except the last 'js:' JavaScript command// to pop open a new window. I've also given each item a length in pixels, overriding the ItemStyle.startMenu('root', true, 0, window.page.scrollY() + 10, 207, subM);// LOGOaddItem('<img src="images/menuggalogo.gif" border="0">','', '', null, 56);// HOMEaddItem('SWAP:<img src="images/menuhome.gif" border="0">^<img src="images/menuhome-roll.gif" border="0">', 'index.html', '', null, 15);// COMPANY REFERENCEaddItem('<img src="images/menucompref.gif" border="0">','', '', null, 15);addItem('SWAP:<img src="images/menumradv.gif" border="0">^<img src="images/menumradv-roll.gif" border="0">', 'cradv.html', '', null, 15);addItem('SWAP:<img src="images/menucrdist.gif" border="0">^<img src="images/menucrdist-roll.gif" border="0">', 'crdist.html', '', null, 15);addItem('SWAP:<img src="images/menucrinfo.gif" border="0">^<img src="images/menucrinfo-roll.gif" border="0">', 'mcrinfo', 'sm:', null, 15);// GroVisionaddItem('<img src="images/menugrovis.gif" border="0">','', '', null, 15);addItem('SWAP:<img src="images/menugvadv.gif" border="0">^<img src="images/menugvadv-roll.gif" border="0">', 'grogga.html', '', null, 15);//addItem('SWAP:<img src="images/menugvevent.gif" border="0">^<img src="images/menugvevent-roll.gif" border="0">', 'groevent.html', '', null, 15);addItem('SWAP:<img src="images/menugveventres.gif" border="0">^<img src="images/menugveventres-roll.gif" border="0">', 'gveventres', 'sm:', null, 15);addItem('SWAP:<img src="images/menugvfaqs.gif" border="0">^<img src="images/menugvfaqs-roll.gif" border="0">', 'grofaqs.html', '', null, 15);// MANUFACTURER REFERENCEaddItem('<img src="images/menumanref.gif" border="0">','', '', null, 15);addItem('SWAP:<img src="images/menumradv.gif" border="0">^<img src="images/menumradv-roll.gif" border="0">', 'mradv.html', '', null, 15);addItem('SWAP:<img src="images/menumrover.gif" border="0">^<img src="images/menumrover-roll.gif" border="0">', 'mrover.html', '', null, 15);addItem('SWAP:<img src="images/menumrpds.gif" border="0">^<img src="images/menumrpds-roll.gif" border="0">', 'mmrpds', 'sm:', null, 15);addItem('SWAP:<img src="images/menumrsched.gif" border="0">^<img src="images/menumrsched-roll.gif" border="0">', 'mrsched.html', '', null, 15);addItem('SWAP:<img src="images/menuprfaq.gif" border="0">^<img src="images/menuprfaq-roll.gif" border="0">', 'mrfaqs.html', '', null, 15);// ANNUAL GRO GROUP KICKOFFaddItem('<img src="images/menuprogrev.gif" border="0">','', '', null, 15);addItem('SWAP:<img src="images/menumradv.gif" border="0">^<img src="images/menumradv-roll.gif" border="0">', 'pradv.html', '', null, 15);addItem('SWAP:<img src="images/menuprfaq.gif" border="0">^<img src="images/menuprfaq-roll.gif" border="0">', 'pradvfaqs.html', '', null, 15);// REGIONAL TRADE SHOWSaddItem('<img src="images/menutradeshows.gif" border="0">','', '', null, 15);addItem('SWAP:<img src="images/menumradv.gif" border="0">^<img src="images/menumradv-roll.gif" border="0">', 'tsadv.html', '', null, 15);addItem('SWAP:<img src="images/menutssched.gif" border="0">^<img src="images/menutssched-roll.gif" border="0">', 'tssched.html', '', null, 15);// RETEAILER REFERENCEaddItem('<img src="images/menuretailref.gif" border="0">','', '', null, 15);addItem('SWAP:<img src="images/menumradv.gif" border="0">^<img src="images/menumradv-roll.gif" border="0">', 'rradv.html', '', null, 15);addItem('SWAP:<img src="images/menurrgsplus.gif" border="0">^<img src="images/menurrgsplus-roll.gif" border="0">', 'mrrgsplus', 'sm:', null, 15);addItem('SWAP:<img src="images/menurrgw.gif" border="0">^<img src="images/menurrgw-roll.gif" border="0">', 'mrrgw', 'sm:', null, 15);// DISTRIBUTOR RESOURCEaddItem('SWAP:<img src="images/menudistres.gif" border="0">^<img src="images/menudistres-roll.gif" border="0">', 'mdistres', 'sm:', null, 15);// NEWS ROOMaddItem('<img src="images/menunews.gif" border="0">','', '', null, 15);addItem('SWAP:<img src="images/menunrpr.gif" border="0">^<img src="images/menunrpr-roll.gif" border="0">', 'nrpr.html', '', null, 15);addItem('SWAP:<img src="images/menunrnews.gif" border="0">^<img src="images/menunrnews-roll.gif" border="0">', 'mrrnews', 'sm:', null, 15);// EmploymentaddItem('SWAP:<img src="images/menuemploy.gif" border="0">^<img src="images/menuemploy-roll.gif" border="0">', 'employment.html', '', null, 15);// PRESENTATIONaddItem('<img src="images/presentationbut.gif" border="0">','ggapresentation.html', '', null, 94);// XTRA SPACEaddItem('<img src="images/menuback.gif" border="0">','', '', null, 30);// This is a vertical menu positioned 0px across and 22px down from its trigger, and is 80px wide.// The URLs are set to # here, be sure to replace them with your path/file names or JS functions!// Also note how the types are '', indicating these links open in the current frame/window.// The last item here changes its text on mouseover (^ separates the two strings), links to my site,// and has a custom ItemStyle and length specified so it's longer than the rest.// COMPANY INFO SUBstartMenu('mcrinfo', true, 208, 0, 207, subM, '', true);addItem('SWAP:<img src="images/menucrmission.gif" border="0">^<img src="images/menucrmission-roll.gif" border="0">', 'crmission.html', '', null, 15);addItem('SWAP:<img src="images/menucrpres.gif" border="0">^<img src="images/menucrpres-roll.gif" border="0">', 'crpres.html', '', null, 15);addItem('SWAP:<img src="images/menucrdirect.gif" border="0">^<img src="images/menucrdirect-roll.gif" border="0">', 'crmdirect.html', '', null, 15);addItem('SWAP:<img src="images/menucrcontact.gif" border="0">^<img src="images/menucrcontact-roll.gif" border="0">', 'crcontact.html', '', null, 15);// GROVISION EVENT RESOURCE SUBstartMenu('gveventres', true, 208, 0, 207, subM, '', true);addItem('SWAP:<img src="images/menugvprog.gif" border="0">^<img src="images/menugvprog-roll.gif" border="0">', 'groprogram.html', '', null, 15);addItem('SWAP:<img src="images/menugvgolf.gif" border="0">^<img src="images/menugvgolf-roll.gif" border="0">', 'grogolftourn.html', '', null, 15);addItem('SWAP:<img src="images/menugvsponsor.gif" border="0">^<img src="images/menugvsponsor-roll.gif" border="0">', 'grosponsorship.html', '', null, 15);addItem('SWAP:<img src="images/menugvhotel.gif" border="0">^<img src="images/menugvhotel-roll.gif" border="0">', 'groreservations.html', '', null, 15);// PRODUCT DATA SET SUBstartMenu('mmrpds', true, 208, 0, 207, subM, '', true);addItem('SWAP:<img src="images/menumrpdsintro.gif" border="0">^<img src="images/menumrpdsintro-roll.gif" border="0">', 'mrpdsintro.html', '', null, 15);addItem('SWAP:<img src="images/menumrpdsguide.gif" border="0">^<img src="images/menumrpdsguide-roll.gif" border="0">', 'mrpdsuserguide.pdf', '', null, 15);addItem('SWAP:<img src="images/menumrpdswork.gif" border="0">^<img src="images/menumrpdswork-roll.gif" border="0">', 'mrpdswrksheet.xls', '', null, 15);// GROSOURCE PLUS SUBstartMenu('mrrgsplus', true, 208, 0, 207, subM, '', true);addItem('SWAP:<img src="images/menurrgspintro.gif" border="0">^<img src="images/menurrgspintro-roll.gif" border="0">', 'rrgspintro.html', '', null, 15);addItem('SWAP:<img src="images/menurrgspfaq.gif" border="0">^<img src="images/menurrgspfaq-roll.gif" border="0">', 'rrgspfaqs.html', '', null, 15);// GROWISE SUBstartMenu('mrrgw', true, 208, 0, 207, subM, '', true);addItem('SWAP:<img src="images/menurrgwintro.gif" border="0">^<img src="images/menurrgwintro-roll.gif" border="0">', 'gwintro.html', '', null, 15);addItem('SWAP:<img src="images/menurrgwlink.gif" border="0">^<img src="images/menurrgwlink-roll.gif" border="0">', 'rrgwgraphics.html', '', null, 15);// DISTRIBUTOR RESOURCE SUBstartMenu('mdistres', true, 208, 0, 207, subM, '', true);addItem('SWAP:<img src="images/menudrmeetsched.gif" border="0">^<img src="images/menudrmeetsched-roll.gif" border="0">', 'drmeetsched.html', '', null, 15);addItem('SWAP:<img src="images/menudrteam.gif" border="0">^<img src="images/menudrteam-roll.gif" border="0">', 'drteam.html', '', null, 15);addItem('SWAP:<img src="images/menudrlogos.gif" border="0">^<img src="images/menudrlogos-roll.gif" border="0">', 'drlogos.html', '', null, 15);// NEWS ROOM SUBstartMenu('mrrnews', true, 208, 0, 207, subM, '', true);addItem('SWAP:<img src="images/menunrgga.gif" border="0">^<img src="images/menunrgga-roll.gif" border="0">', 'nrgga.html', '', null, 15);addItem('SWAP:<img src="images/menunrgspu.gif" border="0">^<img src="images/menunrgspu-roll.gif" border="0">', 'nrgspupdate.html', '', null, 15);addItem('SWAP:<img src="images/menunrgwu.gif" border="0">^<img src="images/menunrgwu-roll.gif" border="0">', 'nrgwupdate.html', '', null, 15);}// ******************** MENU EFFECTS ********************//// Now you've created a basic menu object, you can add optional effects like borders and// shadows to specific menus. You can remove this section entirely if you want, the// functions called are found at the bottom of this file.// ANIMATION SETTING: We add this to the 'pMenu' menu object for supported browsers.// IE4/Mac and Opera 5/6 don't support clipping, and Mozilla versions prior to 1.x (such as// Netscape 6) are too slow to support it, so I'm doing some browser sniffing.// 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 (defaults are 10 and 15).if ((navigator.userAgent.indexOf('rv:0.')==-1) &&    !(isOp&&!document.documentElement) && !(isIE4&&!window.external)){ pMenu.showMenu = new Function('mN','menuAnim(this, mN, 10)'); pMenu.hideMenu = new Function('mN','menuAnim(this, mN, -15)'); // 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, -15)');}// ******************** FUNCTIONS CALLED BY THE EFFECTS SECTION ********************// These can be deleted if you're not using them. Alternatively, if you're using several menu// data files, you may want to move them to the "core" script file instead.// This is the "positioning from page anchors" code used by the advanced positioning expressions.page.elmPos=function(e,p){ var x=0,y=0,w=p?p:this.win; e=e?(e.substr?(isNS4?w.document.anchors[e]:getRef(e,w)):e):p; if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.pageX;y+=p.pageY}} else if (e && e.focus && e.href && this.MS && /Mac/.test(navigator.platform)) {  e.onfocus = new Function('with(event){self.tmpX=clientX-offsetX;' +   'self.tmpY=clientY-offsetY}');  e.focus();x=tmpX;y=tmpY;e.blur() } else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent} return{x:x,y:y};};// Animation://// Each menu object you create by default shows and hides its menus instantaneously.// However you can override this behaviour with custom show/hide animation routines,// as we have done in the "Menu Effects" section. Feel free to edit this, or delete// this entire function if you're not using it. Basically, make functions to handle// menuObj.showAnim() and .hideAnim(), both of which are passed menu names.//// Customisers: My lyr.clip() command gets passed the parameters (x1, y1, x2, y2)// so you might want to adjust the direction etc. Oh, and I'm adding 2 to the dimensions// to be safe due to different box models in some browsers.// Another idea: add some if/thens to test for specific menu names...?function menuAnim(menuObj, menuName, dir){ // The array index of the named menu (e.g. 'mFile') in the menu object (e.g. 'pMenu'). var mD = menuObj.menu[menuName][0]; // Add timer and counter variables to the menu data structure, we'll need them. if (!mD.timer) mD.timer = 0; if (!mD.counter) mD.counter = 0; with (mD) {  // Stop any existing animation.  clearTimeout(timer);  // If the litNow() array doesn't show this menu as lit, and we're still showing it,  // force a quick hide (this stops miscellaneous timer errors).  //if (dir>0 && !menuObj.litNow[menuObj.menu[menuName][0].parentMenu]) dir = -100;  // If the layer doesn't exist (cross-frame navigation) quit.  if (!lyr || !lyr.ref) return;  // This next line is not strictly necessary, but it stops the one-in-a-hundred menu that  // shows and doesn't hide on very quick mouseovers.  if (!visNow && dir>0) dir = 0-dir;  // Show the menu if that's what we're doing.  if (dir>0) lyr.vis('visible');  // Also raise showing layers above hiding ones.  lyr.sty.zIndex = dir>0 ? mD.zIndex + 1 : 1001;  // Alpha fade in IE5.5+. Mozilla's opacity (pre-v1.7) isn't well suited as it's an inheritable  // property rather than a block-level filter, and it's slow, but uncomment and try it perhaps.  // WARNING: This looks funny if you're mixing opaque and translucent items e.g. solid menus  // with dropshadows. If you're going to use it, either disable dropshadows or set the opacity  // values for your items to numbers instead of null.  //if (isIE && window.createPopup) lyr.alpha(counter&&(counter<100) ? counter : null);  // Clip the visible area. The syntax is:   lyr.clip(left, top, right, bottom);  // As you can see in these examples, three are static at either zero or the edge of a menu item,  // and either the top or bottom is a complicated formula based on the 'counter' variable which  // counts from 0 to 100 and back again; this give a nice accelerating-sliding animation.  // Feel free to experiment with your own animations, here are some samples (use one only):  // Straightforward downwards clipping animation (default setting):  lyr.clip(0, 0, menuW+2, (menuH+2)*Math.pow(Math.sin(Math.PI*counter/200),0.75) );  // If you want, comment out the above line and enable this one to animate bottom-upwards:  //lyr.clip(0, (menuH+2)-(menuH+2)*Math.pow(Math.sin(Math.PI*counter/200),0.75), menuW+2, menuH+2);  // Another alternative: Move+clip sliding animation. Looks really cool :).  //if (!counter) mD.origY = lyr.y();  //var newY = (menuH+2)-(menuH+2)*Math.pow(Math.sin(Math.PI*counter/200),0.75);  //lyr.clip(0, newY, menuW+2, menuH+2);  //lyr.y(mD.origY - newY);  // Increment the counter and if it hasn't reached the end (counter is 0% or 100%),  // set the timer to call the animation function again in 40ms to contine the animation.  // Note that we hide the menu div on animation end in that direction.  counter += dir;  if (counter>100) { counter = 100; lyr.sty.zIndex = mD.zIndex }  else if (counter<0) { counter = 0; lyr.vis('hidden') }  else timer = setTimeout('menuAnim('+menuObj.myName+',"'+menuName+'",'+dir+')', 40); }};