// Frameset support. This finds the right window containing a PopupMenu object. var scFr=self.PopupMenu?self:(parent.PopupMenu?parent:top); // This runs functions for a list of PopupMenu objects. // You pass it a string to evaluate in the context of a menu object (e.g. 'position()') // and optionally a second parameter to eval that string for each menu in that object // appearing in this frame (e.g. to position all frame menus on scroll etc.). // You can use 'mN' which is the current menuName in eval'd strings for the page events. function popEvt(str, each) { var PML=scFr.PopupMenu.list, mN; for (var objName in PML) with (PML[objName]) { if (each) for (mN in menu) with (menu[mN][0]) { // Either: single frame menus, OR frameset menus with the menu appearing in this frame. if ((!par&&scFr==self) || (par&&par.substring(par.lastIndexOf('.')+1)==self.name)) eval(str); // NESTED FRAMES SUPPORT: Remove the above line and uncomment this next line: //if ((menu.root[0].par==self.name)==(isRoot?true:false)) eval(str); } else eval(str); } }; // Backup a whole load of page events, and get NS/Opera window sizes. var scrFn, popOL=window.onload, popUL=window.onunload, popOR=window.onresize, popOS=window.onscroll, nsWinW=window.innerWidth, nsWinH=window.innerHeight, nsPX=window.pageXOffset, nsPY=window.pageYOffset; document.popOC=document.onclick; // Only run the rest if we've found the core menu script in this or a parent window! if (scFr.PopupMenu) { // Import a local copy the 'page' object from the main menu window into this frame. // I'm also grabbing 'isNS4' as it's used a lot here. if (!self.page) var isNS4=scFr.isNS4, page={}; if (scFr != self) for (var f in scFr.page) page[f]=scFr.page[f]; page.win=self; // Import the menu names into this window, i.e. create self.pMenu = parent.pMenu; popEvt('self[objName]=PML[objName]',0); // Most functions here will set a page event, and run one of the backed up functions in the // list above once the event fires (so when you mix this with other scripts, they work too). // If you're really tweaking for speed, feel free to remove the backup code. // Menu creation: We select creation modes on a per-browser basis, using the update() function. // In non-NS4 browsers, we document.write() a menu by calling update(true,...); // In NS4, we have to create menus dynamically on page load completion using update(false,...); // Other browsers like MSIE, NS6+, Op7+ also support dynamic creation mode, use it if you want. // Dynamic mode is independent of script postion in the document (i.e. it can be in the HEAD). // We also run our scrFn scroll-detector every 50ms in NS4, and set an onunload to clear menus. if (!isNS4) popEvt('update(true,mN)',1); window.onload=function() { if (popOL) popOL(); // DYNAMIC MENU CREATION SUPPORT: To enable, *remove* the above "popEvt('update(...)')" line, // and *replace* the next popEvt('update(...)') line with this: //popEvt('if(isRoot)update(false,mN)',1); if(isNS4)setInterval(scrFn,50); if (isNS4) { popEvt('update(false,mN)',1); setInterval(scrFn,50) } // This next function is mostly a random IE6 fix, but freeing ref's is generally a good thing. // Don't cleanup for Opera, which cheats a LOT on its back/forward navigation. if (!scFr.isOp) window.onunload=new Function( 'if(popUL)popUL();popEvt("for(var i=0;i