home *** CD-ROM | disk | FTP | other *** search
/ com!online 2002 June / comonline0602.iso / software / navigation / dmbsetup.exe / tutorial / menus / menu.js < prev    next >
Encoding:
JavaScript  |  2002-02-28  |  52.1 KB  |  1,118 lines

  1. //////////////////////////////////////////////////
  2. // DMB DHTML ENGINE 1.2.4                       //
  3. // (c)xFX JumpStart                             //
  4. //                                              //
  5. // PSN: 019CCA-437176-XFX-8926                  //
  6. //                                              //
  7. // GENERATED: 2/28/2002 - 3:34:32 AM            //
  8. // -------------------------------------------- //
  9. //  Config: Local                               //
  10. //   AddIn:                                     //
  11. // JS Name: menu                                //
  12. //////////////////////////////////////////////////
  13.  
  14.  
  15.     var nStyle = new Array;
  16.     var hStyle = new Array;
  17.     var nLayer = new Array;
  18.     var hLayer = new Array;
  19.     var nTCode = new Array;
  20.  
  21.     var AnimStep = 0;
  22.     var AnimHnd = 0;
  23.     var HTHnd = new Array;
  24.     var DoFormsTweak = true;
  25.     var MenusReady = false;
  26.     var SelSndId = 0;
  27.     var NSFixedFonts = false;
  28.  
  29.     var nsOW;
  30.     var nsOH;
  31.  
  32.     var mFrame;
  33.     var cFrame;
  34.  
  35.     var OpenMenus = new Array;
  36.     var nOM = 0;
  37.  
  38.     var mX;
  39.     var mY;
  40.  
  41.     var HideSpeed = 300;
  42.     var TimerHideDelay = 2000;
  43.     var TimerHideHnd = 0;
  44.     var IsOverHS = false;
  45.     var cntxMenu = '';
  46.     var IsContext = false;
  47.     var IsFrames = false;
  48.  
  49. var BV=parseFloat(navigator.appVersion.indexOf("MSIE")>0?navigator.appVersion.split(";")[1].substr(6):navigator.appVersion);
  50. var BN=navigator.appName;
  51. var IsWin=(navigator.userAgent.indexOf('Win')!=-1);
  52. var IsMac=(navigator.userAgent.indexOf('Mac')!=-1);
  53. var OP=(navigator.userAgent.indexOf('Opera')!=-1&&BV>=4)?true:false;
  54. var NS=(BN.indexOf('Netscape')!=-1&&(BV>=4&&BV<5)&&!OP)?true:false;
  55. var SM=(BN.indexOf('Netscape')!=-1&&(BV>=5)||OP)?true:false;
  56. var IE=(BN.indexOf('Explorer')!=-1&&(BV>=4)||SM)?true:false;
  57.  
  58.  
  59.     if(!eval(frames['self'])) {
  60.         frames.self = window;
  61.         frames.top = top;
  62.     }
  63.  
  64.     cFrame = eval(frames['self']);
  65.  
  66.     var fx = 0;
  67.  
  68.  
  69.  
  70.  
  71.  
  72.     hStyle[0]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  73.     hStyle[1]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  74.     hStyle[2]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  75.     hStyle[3]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  76.     hStyle[4]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  77.     hStyle[5]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  78.     hStyle[6]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  79.     hStyle[7]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  80.     hStyle[8]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  81.     hStyle[9]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  82.     hStyle[10]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  83.     hStyle[11]="; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #FFFFFF; background-color: #804040; cursor: default;";
  84.     nLayer[1]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=93 height=11><layer top=-1 width=75 left=0><div align=left>Computers</layer><layer top=0 left=83><img name=ComputersRImg src=\"file:///C:/My%20Projects/Visual%20Basic/DHTML%20Menu%20Builder%203.0/Help/tutorial/images/black_arrow.gif\" width=10 height=10></layer></layer></font></b></ilayer>|";
  85.     hLayer[1]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=93 height=11><layer top=-1 width=75 left=0><div align=left>Computers</layer><layer top=0 left=83><img name=ComputersRImg src=\"file:///C:/My%20Projects/Visual%20Basic/DHTML%20Menu%20Builder%203.0/Help/tutorial/images/white_arrow.gif\" width=10 height=10></layer></layer></font></b></ilayer>|";
  86.     nLayer[2]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=93 height=11><layer top=-1 width=75 left=0><div align=left>Accessories</layer><layer top=0 left=83><img name=AccessoriesRImg src=\"file:///C:/My%20Projects/Visual%20Basic/DHTML%20Menu%20Builder%203.0/Help/tutorial/images/black_arrow.gif\" width=10 height=10></layer></layer></font></b></ilayer>|";
  87.     hLayer[2]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=93 height=11><layer top=-1 width=75 left=0><div align=left>Accessories</layer><layer top=0 left=83><img name=AccessoriesRImg src=\"file:///C:/My%20Projects/Visual%20Basic/DHTML%20Menu%20Builder%203.0/Help/tutorial/images/white_arrow.gif\" width=10 height=10></layer></layer></font></b></ilayer>|";
  88.     nLayer[3]="|";
  89.     hLayer[3]="|";
  90.     nTCode[4]="cFrame.execURL('', 'frames[self]');";
  91.     nLayer[4]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=93 height=11><layer top=-1 width=93 left=0><div align=left>Catalog Index</layer></layer></font></b></ilayer>|";
  92.     hLayer[4]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=93 height=11><layer top=-1 width=93 left=0><div align=left>Catalog Index</layer></layer></font></b></ilayer>|";
  93.     nTCode[5]="cFrame.execURL('', 'frames[self]');";
  94.     nLayer[5]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=142 height=11><layer top=-1 width=142 left=0><div align=left>High Performance</layer></layer></font></b></ilayer>|";
  95.     hLayer[5]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=142 height=11><layer top=-1 width=142 left=0><div align=left>High Performance</layer></layer></font></b></ilayer>|";
  96.     nTCode[6]="cFrame.execURL('', 'frames[self]');";
  97.     nLayer[6]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=142 height=11><layer top=-1 width=142 left=0><div align=left>Gaming Systems</layer></layer></font></b></ilayer>|";
  98.     hLayer[6]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=142 height=11><layer top=-1 width=142 left=0><div align=left>Gaming Systems</layer></layer></font></b></ilayer>|";
  99.     nTCode[7]="cFrame.execURL('', 'frames[self]');";
  100.     nLayer[7]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=142 height=24><layer top=-1 width=142 left=0><div align=left>Computers for the Home<br>Desktop Systems</layer></layer></font></b></ilayer>|";
  101.     hLayer[7]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=142 height=24><layer top=-1 width=142 left=0><div align=left>Computers for the Home<br>Desktop Systems</layer></layer></font></b></ilayer>|";
  102.     nTCode[8]="cFrame.execURL('', 'frames[self]');";
  103.     nLayer[8]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=64 height=11><layer top=-1 width=64 left=0><div align=left>Cables</layer></layer></font></b></ilayer>|";
  104.     hLayer[8]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=64 height=11><layer top=-1 width=64 left=0><div align=left>Cables</layer></layer></font></b></ilayer>|";
  105.     nTCode[9]="cFrame.execURL('', 'frames[self]');";
  106.     nLayer[9]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=64 height=11><layer top=-1 width=64 left=0><div align=left>Adapters</layer></layer></font></b></ilayer>|";
  107.     hLayer[9]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=64 height=11><layer top=-1 width=64 left=0><div align=left>Adapters</layer></layer></font></b></ilayer>|";
  108.     nTCode[10]="cFrame.execURL('', 'frames[self]');";
  109.     nLayer[10]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=64 height=11><layer top=-1 width=64 left=0><div align=left>Connectors</layer></layer></font></b></ilayer>|";
  110.     hLayer[10]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=64 height=11><layer top=-1 width=64 left=0><div align=left>Connectors</layer></layer></font></b></ilayer>|";
  111.     nTCode[11]="cFrame.execURL('', 'frames[self]');";
  112.     nLayer[11]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=64 height=11><layer top=-1 width=64 left=0><div align=left>Batteries</layer></layer></font></b></ilayer>|";
  113.     hLayer[11]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=64 height=11><layer top=-1 width=64 left=0><div align=left>Batteries</layer></layer></font></b></ilayer>|";
  114.     nTCode[12]="cFrame.execURL('http:\\www.google.com', 'frames[self]');";
  115.     nLayer[12]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=103 height=11><layer top=-1 width=103 left=0><div align=left>Search the Web</layer></layer></font></b></ilayer>|";
  116.     hLayer[12]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=103 height=11><layer top=-1 width=103 left=0><div align=left>Search the Web</layer></layer></font></b></ilayer>|";
  117.     nTCode[13]="javascript:dmbNW=window.open('http:\\software.xfx.net','NewWindow','left='+80+',top='+80+',width='+600+',height='+400+',directories=0,channelmode=0,toolbar=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=1');dmbNW.focus();";
  118.     nLayer[13]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#000000><layer left=1 top=1 width=103 height=11><layer top=-1 width=103 left=0><div align=left>xFX JumpStart<sup>«</sup></layer></layer></font></b></ilayer>|";
  119.     hLayer[13]="<ilayer left=8 top=4><b><font face=Tahoma point-size=8 color=#FFFFFF><layer left=1 top=1 width=103 height=11><layer top=-1 width=103 left=0><div align=left>xFX JumpStart<sup>«</sup></layer></layer></font></b></ilayer>|";
  120.     var ComputersRImgOff = new Image;
  121.     var ComputersRImgOn = new Image;
  122.     ComputersRImgOff.src = 'file:///C:/My%20Projects/Visual%20Basic/DHTML%20Menu%20Builder%203.0/Help/tutorial/images/black_arrow.gif';
  123.     ComputersRImgOn.src = 'file:///C:/My%20Projects/Visual%20Basic/DHTML%20Menu%20Builder%203.0/Help/tutorial/images/white_arrow.gif';
  124.     var AccessoriesRImgOff = new Image;
  125.     var AccessoriesRImgOn = new Image;
  126.     AccessoriesRImgOff.src = 'file:///C:/My%20Projects/Visual%20Basic/DHTML%20Menu%20Builder%203.0/Help/tutorial/images/black_arrow.gif';
  127.     AccessoriesRImgOn.src = 'file:///C:/My%20Projects/Visual%20Basic/DHTML%20Menu%20Builder%203.0/Help/tutorial/images/white_arrow.gif';
  128.  
  129.  
  130. var tbUseToolbar = false;
  131. var lmcHS = null;
  132.  
  133.  
  134.     function GetCurCmd(e) {
  135.         //IE,SM,OP
  136.         //This function will return the current command under the mouse pointer.
  137.         //It will return null if the mouse is not over any command.
  138.         //------------------------------
  139.         //Version 1.5
  140.         //
  141.         if(SM)
  142.             var cc = e;
  143.         else {
  144.             var cc = mFrame.window.event;
  145.             if(!cc)
  146.                 cc = cFrame.window.event;
  147.             cc = cc.srcElement;
  148.         }
  149.         while(cc.id=="") {
  150.             cc = cc.parentElement;
  151.             if(cc==null)
  152.                 break;
  153.         }
  154.         return cc;
  155.     }
  156.  
  157.     function HoverSel(mode, imgLName, imgRName, e) {
  158.         //IE,SM,OP
  159.         //This is the function called every time the mouse pointer is moved over a command.
  160.         //------------------------------
  161.         //mode: 0 if the mouse is moving over the command and 1 if is moving away.
  162.         //imgLName: Name of the left image object, if any.
  163.         //imgRName: Name of the right image object, if any.
  164.         //------------------------------
  165.         //Version 16.1
  166.         //
  167.         var imgLRsc = new Image;
  168.         var imgRRsc = new Image;
  169.         var nStyle;
  170.         var mc;
  171.         
  172.         if(mode==0 && OpenMenus[nOM].SelCommand!=null)
  173.             HoverSel(1);
  174.         
  175.         if(mode==0) {
  176.             mc = GetCurCmd(e);
  177.             if(nOM>1) {
  178.                 if(mc==OpenMenus[nOM-1].SelCommand)
  179.                     return false;
  180.                 while(((BV>=5)?mc.parentNode.parentNode.id!=OpenMenus[nOM].mName:mc.parentElement.parentElement.id!=OpenMenus[nOM].mName))
  181.                         Hide();
  182.             }
  183.             if(imgLName!='_') imgLRsc = eval(imgLName+"On");
  184.             if(imgRName!='_') imgRRsc = eval(imgRName+"On");
  185.             if(OP)
  186.                 mc.opw = OpenMenus[nOM].width - 2*mc.style.left;
  187.             else {
  188.                 mc.opw = mc.style.width;
  189.                 mc.b = mc.style.borderLeft;
  190.                 mc.hasBorder = mc.b.split(" ").length>1;
  191.             }
  192.             OpenMenus[nOM].SelCommand = mc;
  193.             OpenMenus[nOM].SelCommandPar = [imgLName,imgRName,SM?mc.getAttribute("style"):mc.style.cssText];
  194.             if(SM) {
  195.                 IsOverHS = false;
  196.                 mc.setAttribute("style", GetCStyle(mc.style) + xrep(hStyle[mc.id],"hand","pointer"));
  197.             } else
  198.                 mc.style.cssText = GetCStyle(mc.style) + hStyle[mc.id];
  199.             if(SelSndId) PlaySound();
  200.         } else {
  201.             mc = (mode==1)?OpenMenus[nOM].SelCommand:OpenMenus[nOM].Opener;
  202.             imgLName = (mode==1)?OpenMenus[nOM].SelCommandPar[0]:OpenMenus[nOM].OpenerPar[0];
  203.             imgRName = (mode==1)?OpenMenus[nOM].SelCommandPar[1]:OpenMenus[nOM].OpenerPar[1];
  204.             nStyle = (mode==1)?OpenMenus[nOM].SelCommandPar[2]:OpenMenus[nOM].OpenerPar[2];
  205.             mc.style.background = "";
  206.             if(IsMac) mc.style.border = "0px none";
  207.             if(SM)
  208.                 mc.setAttribute("style", nStyle);
  209.             else
  210.                 mc.style.cssText = ((BV<5)?GetCStyle(mc.style):"") + nStyle;
  211.             if(imgLName!='_') imgLRsc = eval(imgLName+"Off");
  212.             if(imgRName!='_') imgRRsc = eval(imgRName+"Off");
  213.             OpenMenus[nOM].SelCommand = null;
  214.         }
  215.         
  216.         if(imgLName!='_') mFrame.document.images[imgLName].src = imgLRsc.src;
  217.         if(imgRName!='_') mFrame.document.images[imgRName].src = imgRRsc.src;
  218.         
  219.         if(!OP) FixHover(mc, mode);
  220.         
  221.         return true;
  222.     }
  223.     
  224.     function FixHover(mc, mode) {
  225.         //IE,SM
  226.         //This function fixes the position of the commands' contents when using special highlighting effects.
  227.         //------------------------------
  228.         //Version 2.1
  229.         //
  230.         var hasBorder;
  231.         var bw;
  232.         if(mode==0) {
  233.             if(BV>=5)
  234.                 s = mc.getElementsByTagName("SPAN")[0];
  235.             else
  236.                 s = mc.document.all.tags("SPAN")[0];
  237.             mc.s = s;
  238.             mc.stop = s.style.top;
  239.             mc.sleft = s.style.left;
  240.             
  241.             hasBorder = mc.style.borderLeft.split(" ").length>1;
  242.             if(hasBorder != mc.hasBorder) {
  243.                 bw = (hasBorder?-GetBorderWidth(mc.style.borderLeft):GetBorderWidth(mc.b));
  244.                 s.style.left = parseInt(s.style.left) + bw + "px";
  245.                 s.style.top = parseInt(s.style.top) + bw + "px";
  246.                 if(SM) {
  247.                     mc.cwidth = mc.style.width;
  248.                     mc.cheight = mc.style.height;
  249.                     mc.style.width = parseInt(mc.style.width) + 2*bw + "px";
  250.                     mc.style.height = parseInt(mc.style.height) + 2*bw + "px";
  251.                 }
  252.             }            
  253.         } else {
  254.             mc.s.style.top = mc.stop;
  255.             mc.s.style.left = mc.sleft;
  256.             if(SM) {
  257.                 mc.style.width = mc.cwidth;
  258.                 mc.style.height = mc.cheight;
  259.             }
  260.         }
  261.     }
  262.     
  263.     function NSHoverSel(mode, mc, bcolor) {
  264.         //NS
  265.         //This is the function called every time the mouse pointer is moved over or away from a command.
  266.         //------------------------------
  267.         //mode: 0 if the mouse is moving over the command and 1 if is moving away.
  268.         //mc: Name of the layer that corresponds to the selected command.
  269.         //n: Unique ID that identifies this command. Used to retrieve the data from the nLayer or hLayer array.
  270.         //bcolor: Background color of the command. Ignored if the group uses a background image.
  271.         //w: Width of the command's layer.
  272.         //h: Height of the command's layer.
  273.         //------------------------------
  274.         //Version 12.0
  275.         //
  276.         var n;
  277.         var ocw;
  278.         var och;
  279.         var LayerHTML;
  280.         
  281.         ClearTimer(parseInt(HTHnd[nOM]));HTHnd[nOM] = 0;
  282.         if(!nOM) return false;
  283.         
  284.         if(mode==0 && OpenMenus[nOM].SelCommand!=null)
  285.             NSHoverSel(1);
  286.         
  287.         if(mode==0) {
  288.             mc = mc.parentLayer.layers[mc.name.substr(0, mc.name.indexOf("EH"))];
  289.             n = parseInt(mc.name.substr(2));
  290.             if(nOM>1)
  291.                 if(mc==OpenMenus[nOM-1].SelCommand)
  292.                     return false;
  293.             while(!InMenu()&&nOM>1)
  294.                 Hide();
  295.             LayerHTML = hLayer[n];
  296.             OpenMenus[nOM].SelCommand = mc;
  297.             OpenMenus[nOM].SelCommandPar = mc.bgColor;
  298.             mc.bgColor = (LayerHTML.split("|")[1]!="")?null:bcolor;
  299.             if(SelSndId) PlaySound();
  300.         } else {
  301.             mc = (mode==1)?OpenMenus[nOM].SelCommand:OpenMenus[nOM].Opener;
  302.             bcolor = (mode==1)?OpenMenus[nOM].SelCommandPar:OpenMenus[nOM].OpenerPar;
  303.             n = parseInt(mc.name.substr(2));
  304.             LayerHTML = nLayer[n];
  305.             mc.bgColor = (mc.parentLayer.background.src!="" || LayerHTML.split("|")[1]!="")?null:bcolor;
  306.             OpenMenus[nOM].SelCommand = null;
  307.         }
  308.         ocw = mc.clip.width;
  309.         och = mc.clip.height;
  310.         mc.document.write(LayerHTML.split("|")[0]);
  311.         mc.document.close();
  312.         mc.clip.width = ocw;
  313.         mc.clip.height = och;
  314.         if(LayerHTML.split("|")[1]!="") mc.background.src = LayerHTML.split("|")[1];
  315.  
  316.         return true;
  317.     }
  318.  
  319.     function Hide() {
  320.         //IE,NS,SM,OP
  321.         //This function hides the last opened group and it keeps hiding all the groups until
  322.         //no more groups are opened or the mouse is over one of them.
  323.         //Also takes care of reseting any highlighted commands.
  324.         //------------------------------
  325.         //Version 4.6
  326.         //
  327.         ClearTimer(HTHnd[nOM]);HTHnd[nOM] = 0;
  328.         ClearTimer(AnimHnd);AnimHnd = 0;
  329.         ClearTimer(TimerHideHnd);
  330.         
  331.         if(nOM) {
  332.             if(OpenMenus[nOM].SelCommand!=null) {
  333.                 if(IE) HoverSel(1);
  334.                 if(NS) NSHoverSel(1);
  335.             }
  336.             if(OpenMenus[nOM].Opener!=null) {
  337.                 if(IE) HoverSel(3);
  338.                 if(NS) NSHoverSel(3);
  339.             }
  340.         
  341.             OpenMenus[nOM].visibility = "hidden";
  342.             nOM--;
  343.         }
  344.         
  345.         if(nOM==0) {
  346.             if(tbUseToolbar && lmcHS) {
  347.                 if(IE) hsHoverSel(1);
  348.                 if(NS) hsNSHoverSel(1);
  349.             }
  350.             FormsTweak("visible");
  351.             status = "";
  352.         } else
  353.             if(!InMenu()) HTHnd[nOM] = window.setTimeout("Hide()", HideSpeed/4);
  354.     }
  355.  
  356.     function ShowMenu(mName, x, y, isCascading, hsImgName, algn) {
  357.         //IE,NS,SM,OP
  358.         //This is the main function to show the menus when a hotspot is triggered or a cascading command is activated.
  359.         //------------------------------
  360.         //mName: Name of the <div> or <layer> to be shown.
  361.         //x: Left position of the menu.
  362.         //y: Top position of the menu.
  363.         //isCascading: True if the menu has been triggered from a command.
  364.         //hsImgName: Image to which the menu is attached to.
  365.         //algn: Alignment setting for the menu.
  366.         //------------------------------
  367.         //Version 16.1
  368.         //
  369.         ClearTimer(parseInt(HTHnd[nOM]));HTHnd[nOM] = 0;
  370.         x = parseInt(x);y = parseInt(y);
  371.         
  372.         if(IE)
  373.             if(BV>=5)
  374.                 var Menu = mFrame.document.getElementById(mName);
  375.             else
  376.                 var Menu = mFrame.document.all[mName];
  377.         if(NS)
  378.             var Menu = mFrame.document.layers[mName];
  379.         if(!Menu)
  380.             return false;        
  381.         if(IE) {
  382.             Menu = Menu.style;
  383.             if(BV>=5)
  384.                 Menu.frmt = mFrame.document.getElementById(mName+"frmt").style;
  385.             else
  386.                 Menu.frmt = mFrame.document.all[mName+"frmt"].style;
  387.         }
  388.         
  389.         if(nOM>0)
  390.             if(OpenMenus[1].mName == mName && !isCascading) {
  391.                 IsOverHS = true;
  392.                 return false;
  393.             }
  394.         if(Menu==OpenMenus[nOM]) return false;
  395.             
  396.         if(AnimHnd && nOM>0) {
  397.             AnimStep=100;
  398.             Animate();
  399.         }
  400.             
  401.         if(!isCascading) {
  402.             var oldlmcHS = lmcHS;
  403.             lmcHS = null;
  404.             HideAll();
  405.             lmcHS = oldlmcHS;
  406.         }
  407.         
  408.         Menu.mName = mName;
  409.         Menu.Opener = nOM>0?OpenMenus[nOM].SelCommand:null;
  410.         Menu.OpenerPar = nOM>0?OpenMenus[nOM].SelCommandPar:null;
  411.         Menu.SelCommand = null;
  412.         if(OP) {
  413.             Menu.width = Menu.pixelWidth;
  414.             Menu.height = Menu.pixelHeight;
  415.         }
  416.         
  417.         if(!isCascading) {
  418.             if(hsImgName) {
  419.                 var imgObj = cFrame.document.images[hsImgName.split("|")[0]];
  420.                 if(imgObj) {
  421.                     var tbMode = hsImgName.split("|")[1];
  422.                     if(tbMode&2) x = AutoPos(Menu, imgObj, algn)[0] + (IsFrames?GetLeftTop()[0]:0);
  423.                     if(tbMode&1) y = AutoPos(Menu, imgObj, algn)[1] + (IsFrames?GetLeftTop()[1]:0);
  424.                 }
  425.             }
  426.  
  427.         }
  428.         
  429.         var pW = GetWidthHeight()[0] + GetLeftTop()[0];
  430.         var pH = GetWidthHeight()[1] + GetLeftTop()[1];
  431.         
  432.         if(IE) {
  433.             if(SM) Menu.display = "none";
  434.             if(isCascading) {
  435.                 x = parseInt(OpenMenus[nOM].left) + (x>0?2:1)*parseInt(OpenMenus[nOM].SelCommand.style.left) + (x>0?parseInt(OpenMenus[nOM].SelCommand.opw):0) - 6 + Math.abs(x);
  436.                 y = parseInt(OpenMenus[nOM].SelCommand.style.top) + parseInt(OpenMenus[nOM].top) - y;
  437.  
  438.                 Menu.left = ((x+parseInt(Menu.width)>pW)?parseInt(OpenMenus[nOM].left) - parseInt(Menu.width) + 6:x) + "px";
  439.                 Menu.top =  ((y+parseInt(Menu.height)>pH)?pH - parseInt(Menu.height):y) + (OP?"":"px");
  440.             } else {
  441.                 Menu.left = ((x+parseInt(Menu.width)>pW)?pW - parseInt(Menu.width):x) + "px";
  442.                 Menu.top =  ((y+parseInt(Menu.height)>pH)?pH - parseInt(Menu.height):y) + (OP?"":"px");
  443.             }
  444.             if(IsWin&&!SM)
  445.                 Menu.clip = "rect(0 0 0 0)";
  446.         }
  447.         if(NS) {
  448.             if(isCascading) {
  449.                 x = OpenMenus[nOM].left + (x>0?2:1)*OpenMenus[nOM].SelCommand.left + (x>0?OpenMenus[nOM].SelCommand.clip.width:0) - 6 + Math.abs(x);
  450.                 y = OpenMenus[nOM].SelCommand.top + OpenMenus[nOM].top - y;
  451.  
  452.                 x = (x+Menu.w>pW)?OpenMenus[nOM].left - Menu.w + 6:x;
  453.                 y = (y+Menu.h>pH)?pH - Menu.h:y;
  454.             } else {
  455.                 x = (x+Menu.w>pW)?pW - Menu.w:x;
  456.                 y = (y+Menu.h>pH)?pH - Menu.h:y;
  457.             }
  458.             Menu.clip.width = 0;
  459.             Menu.clip.height = 0;
  460.             Menu.moveToAbsolute(x,y);
  461.         }
  462.         if(isCascading)
  463.             Menu.zIndex = parseInt(OpenMenus[nOM].zIndex) + 1;
  464.         OpenMenus[++nOM] = Menu;
  465.         if(NS) FillCommands();
  466.         if(SM&&!OP) FixCommands(mName);
  467.         if(SM) Menu.display = "inline";
  468.         Menu.visibility = "visible";
  469.         HTHnd[nOM] = 0;
  470.         if((IE&&IsWin&&!SM)||NS)
  471.             AnimHnd = window.setTimeout("Animate()", 10);
  472.         FormsTweak("hidden");
  473.         
  474.         if(!isCascading&&!IsContext)
  475.             IsOverHS = true;
  476.         IsContext = false;
  477.         ClearTimer(TimerHideHnd);
  478.         TimerHideHnd = window.setTimeout("AutoHide()", TimerHideDelay);
  479.         
  480.         if(SelSndId) PlaySound();
  481.         
  482.         return true;
  483.     }
  484.     
  485.     function FixCommands(mName) {
  486.         //SM
  487.         //This function is used to fix the way the Gecko engine calculates
  488.         //the borders and the way they affect the size of divs
  489.         //------------------------------
  490.         //Version 1.7
  491.         //
  492.         var m = mFrame.document.getElementById(mName);
  493.         if(!m.Fixed) {
  494.             var sd = m.getElementsByTagName("DIV");
  495.             var b = GetBorderWidth(sd[0].style.borderLeft);
  496.             sd[0].style.width = parseInt(sd[0].style.width) - 2*b + "px";
  497.             sd[0].style.height = parseInt(sd[0].style.height) - 2*b + "px";
  498.             for(i=1;i<(sd.length);i++) {
  499.                 if(sd[i].style.borderLeft.indexOf("none")==-1) {
  500.                     sd[i].style.width = parseInt(sd[i].style.width) - 2*GetBorderWidth(sd[i].style.borderLeft) + "px";
  501.                     sd[i].style.height = parseInt(sd[i].style.height) - 2*GetBorderWidth(sd[i].style.borderTop) + "px";
  502.                 }
  503.             }
  504.                 
  505.         }
  506.         m.Fixed = true;
  507.     }
  508.     
  509.     function FillCommands() {
  510.         //NS
  511.         //This function is used to avoid having the same declaration for the normal
  512.         //state of the commands
  513.         //------------------------------
  514.         //Version 1.6
  515.         //
  516.         var n;
  517.         var ocw;
  518.         var och;
  519.         if(!OpenMenus[nOM].Filled) {
  520.             var m = OpenMenus[nOM];
  521.             for(var sl=0; sl<m.layers.length; sl++)
  522.                 if(m.layers[sl].layers.length>0) {
  523.                     m = m.layers[sl];
  524.                     break;
  525.                 }
  526.             for(var sl=0; sl<m.layers.length-1; sl++) {
  527.                 var slo = m.layers[sl];
  528.                 if(slo.name.indexOf("EH")==-1 && slo.name.indexOf("MC")==0) {
  529.                     ocw = slo.clip.width;
  530.                     och = slo.clip.height;
  531.                     n = parseInt(slo.name.substr(2));
  532.                     slo.document.write(nLayer[n].split("|")[0]);
  533.                     slo.document.close();
  534.                     slo.clip.width = ocw;
  535.                     slo.clip.height = och;
  536.                 }
  537.             }
  538.         }
  539.         OpenMenus[nOM].Filled = true;
  540.     }
  541.  
  542.     function Animate() {
  543.         //IE,NS
  544.         //This function is called by ShowMenu every time a new group must be displayed and produces the predefined unfolding effect.
  545.         //Currently is disabled for Navigator, because of some weird bugs we found with the clip property of the layers.
  546.         //------------------------------
  547.         //Version 1.9
  548.         //
  549.         var r = '';
  550.         var nw = nh = 0;
  551.         switch(fx) {
  552.             case 1:
  553.                 if(IE) r = "0 " + AnimStep + "% " + AnimStep + "% 0";
  554.                 if(NS) nw = AnimStep; nh = AnimStep;
  555.                 break;
  556.             case 2:
  557.                 if(IE) r = "0 100% " + AnimStep + "% 0";
  558.                 if(NS) nw = 100; nh = AnimStep;
  559.                 break;
  560.             case 3:
  561.                 if(IE) r = "0 " + AnimStep + "% 100% 0";
  562.                 if(NS) nw = AnimStep; nh = 100;
  563.                 break;
  564.             case 0:
  565.                 if(IE) r = "0 100% 100% 0";
  566.                 if(NS) nw = 100; nh = 100;
  567.                 break;
  568.         }
  569.         if(OpenMenus[nOM]) {
  570.             with(OpenMenus[nOM]) {
  571.                 if(IE)
  572.                     clip =  "rect(" + r + ")";
  573.                 if(NS) {
  574.                     clip.width = w*(nw/100);
  575.                     clip.height = h*(nh/100);
  576.                 }
  577.             }
  578.             AnimStep += 20;
  579.             if(AnimStep<=100)
  580.                 AnimHnd = window.setTimeout("Animate()",25);
  581.             else {
  582.                 ClearTimer(AnimHnd);
  583.                 AnimStep = 0;
  584.                 AnimHnd = 0;
  585.             }
  586.         }
  587.     }
  588.     
  589.     function InTBHotSpot() {
  590.         //IE,NS,SM,OP
  591.         //This function returns true if the mouse pointer is over a toolbar item.
  592.         //------------------------------
  593.         //Version 1.0
  594.         //
  595.         if(!tbUseToolbar) return ;
  596.         var m = lmcHS;
  597.         if(!m) return false;
  598.         var l = parseInt(m.left);
  599.         var r = l+(IE?parseInt(m.width):m.clip.width);
  600.         var t = parseInt(m.top);
  601.         var b = t+(IE?parseInt(m.height):m.clip.height);
  602.         return ((mX>=l && mX<=r) && (mY>=t && mY<=b)) || IsOverHS || (nOM>0);
  603.     }
  604.     
  605.     function InMenu() {
  606.         //IE,NS,SM,OP
  607.         //This function returns true if the mouse pointer is over the last opened menu.
  608.         //------------------------------
  609.         //Version 2.1
  610.         //
  611.         var m = OpenMenus[nOM];
  612.         if(!m) return false;
  613.         var l = parseInt(m.left);
  614.         var r = l+(IE?parseInt(m.width):m.clip.width);
  615.         var t = parseInt(m.top);
  616.         var b = t+(IE?parseInt(m.height):m.clip.height);
  617.         return ((mX>=l && mX<=r) && (mY>=t && mY<=b)) || IsOverHS;
  618.     }
  619.  
  620.     function SetPointerPos(e) {
  621.         //IE,NS,SM,OP
  622.         //This function sets the mX and mY variables with the current position of the mouse pointer.
  623.         //------------------------------
  624.         //e: Only used under Navigator, corresponds to the Event object.
  625.         //------------------------------
  626.         //Version 1.6
  627.         //
  628.         if(IE) {
  629.             if(!SM) {
  630.                 if(mFrame!=cFrame||event==null)
  631.                     if(mFrame.window.event==null)
  632.                         return;
  633.                     else
  634.                         e = mFrame.window.event;
  635.                 else
  636.                     e = event;
  637.             }
  638.             mX = e.clientX + GetLeftTop()[0];
  639.             mY = e.clientY + GetLeftTop()[1];
  640.         }
  641.         if(NS) {
  642.             mX = e.pageX;
  643.             mY = e.pageY;
  644.         }
  645.     }
  646.     
  647.     function HideMenus(e) {
  648.         //IE,NS,SM,OP
  649.         //This function checks if the mouse pointer is on a valid position and if the current menu should be kept visible.
  650.         //The function is called every time the mouse pointer is moved over the document area.
  651.         //------------------------------
  652.         //e: Only used under Navigator, corresponds to the Event object.
  653.         //------------------------------
  654.         //Version 25.1
  655.         //
  656.         if(nOM>0) {
  657.             SetPointerPos(e);
  658.             if(OpenMenus[nOM].SelCommand!=null)
  659.                 if(!InMenu()&&!HTHnd[nOM])
  660.                     HTHnd[nOM] = window.setTimeout("if(nOM>0)if(!InMenu())Hide()", HideSpeed);
  661.         }
  662.     }
  663.     
  664.     function FormsTweak(state) {
  665.         //IE,SM,OP
  666.         //This is an undocumented function, which can be used to hide every listbox (or combo) element on a page.
  667.         //This can be useful if the menus will be displayed over an area where is a combo box, which is an element that cannot be placed behind the menus and it will always appear over the menus resulting in a very undesirable effect.
  668.         //------------------------------
  669.         //Version 2.1
  670.         //
  671.         if(DoFormsTweak && IE)
  672.             for(var f = 0; f <= (mFrame.document.forms.length - 1); f++)
  673.                 for(var e = 0; e <= (mFrame.document.forms[f].elements.length - 1); e++)
  674.                     if(mFrame.document.forms[f].elements[e].type.indexOf("select")==0)
  675.                         mFrame.document.forms[f].elements[e].style.visibility = state;
  676.     }
  677.  
  678.     function execURL(url, tframe) {
  679.         //IE,NS,SM,OP
  680.         //This function is called every time a command is triggered to jump to another page or execute some javascript code.
  681.         //------------------------------
  682.         //url: Encrypted URL that must be opened or executed.
  683.         //tframe: If the url is a document location, tframe is the target frame where this document will be opened.
  684.         //------------------------------
  685.         //Version 1.1
  686.         //
  687.         HideAll();
  688.         window.setTimeout("execURL2('" + url + "', '" + tframe + "')", 100);
  689.     }
  690.  
  691.     function execURL2(url, tframe) {
  692.         //IE,NS,SM,OP
  693.         //This function is called every time a command is triggered to jump to another page or execute some javascript code.
  694.         //------------------------------
  695.         //url: Encrypted URL that must be opened or executed.
  696.         //tframe: If the url is a document location, tframe is the target frame where this document will be opened.
  697.         //------------------------------
  698.         //Version 1.2
  699.         //
  700.         var fObj = eval(rStr(tframe));
  701.         url = rStr(url);
  702.         url.indexOf("javascript:")!=url.indexOf("vbscript:")?eval(url):fObj.location.href = url;
  703.     }
  704.  
  705.     function rStr(s) {
  706.         //IE,NS,SM,OP
  707.         //This function is used to decrypt the URL parameter from the triggered command.
  708.         //------------------------------
  709.         //Version 1.1
  710.         //
  711.         s = xrep(s, "\x1E", "'");
  712.         if(OP&&s.indexOf("frames[")!=-1) {
  713.             s = xrep(s, String.fromCharCode(s.charCodeAt(7)), "'");
  714.         }
  715.         s = xrep(s, "\x1D", "\x22");
  716.         s = xrep(s, "\x1C", ",");
  717.         return s;
  718.     }
  719.  
  720.     function xrep(s, f, n) {
  721.         //IE,NS,SM,OP
  722.         //This function looks for any occurrence of the f string and replaces it with the n string.
  723.         //------------------------------
  724.         //Version 1.0
  725.         //
  726.         var tmp = s.split(f);
  727.         return tmp.join(n);
  728.     }
  729.  
  730.     function hNSCClick(e) {
  731.         //NS
  732.         //This function executes the selected command's trigger code.
  733.         //------------------------------
  734.         //Version 1.0
  735.         //
  736.         eval(this.TCode);
  737.     }
  738.     
  739.     function HideAll() {
  740.         //IE,NS,SM,OP
  741.         //This function will hide all the currently opened menus.
  742.         //------------------------------
  743.         //Version 1.1
  744.         //
  745.         if(nOM)
  746.             while(nOM>0) Hide();
  747.         else Hide();
  748.     }
  749.  
  750.     function GetLeftTop(f) {
  751.         //IE,NS,SM,OP
  752.         //This function returns the scroll bars position on the menus frame.
  753.         //------------------------------
  754.         //Version 2.2
  755.         //
  756.         if(!f) f = mFrame;
  757.         if(IE)
  758.             if(SM)
  759.                 return [OP?0:f.scrollX,OP?0:f.scrollY];
  760.             else
  761.                 if(f.document.body)
  762.                     return [f.document.body.scrollLeft,f.document.body.scrollTop];
  763.                 else
  764.                     return [0, 0];
  765.         if(NS)
  766.             return [f.pageXOffset,f.pageYOffset];
  767.     }
  768.     
  769.     function tHideAll() {
  770.         //IE,NS,SM,OP
  771.         //This function is called when the mouse is moved away from a hotspot to close any opened menu.
  772.         //------------------------------
  773.         //Version 1.2
  774.         //
  775.         IsOverHS = false;
  776.         HTHnd[nOM] = window.setTimeout("if(!InMenu()&&!InTBHotSpot())HideAll(); else HTHnd[nOM]=0;", HideSpeed);
  777.     }
  778.  
  779.     function GetWidthHeight(f) {
  780.         //IE,NS,SM,OP
  781.         //This function returns the width and height of the menus frame.
  782.         //------------------------------
  783.         //Version 2.1
  784.         //
  785.         if(!f) f = mFrame;
  786.         if(IE&&!SM)
  787.             return [f.document.body.clientWidth,f.document.body.clientHeight];
  788.         if(NS||SM)
  789.             return [f.innerWidth,f.innerHeight];
  790.     }
  791.     
  792.     function GetBorderWidth(b) {
  793.         //IE,SM,SM,OP
  794.         //This functions returns the width of a border
  795.         //------------------------------
  796.         //Version 1.1
  797.         //
  798.         if(OP) return 0;
  799.         var w;
  800.         var l = b.split(" ");
  801.         for(var i=0; i<l.length; i++) {
  802.             w = parseInt(l[i]);
  803.             if(w>0)
  804.                 return w;
  805.         }
  806.         return 0;
  807.     }
  808.     
  809.     function GetCStyle(cmc) {
  810.         //IE,SM,OP
  811.         //This function completes the style of command with all the common
  812.         //parameters from the original style code.
  813.         //------------------------------
  814.         //Version 1.0
  815.         //
  816.         return "position: absolute; left:" + cmc.left + 
  817.                "; top: " + cmc.top + 
  818.                "; width: " + (OP?cmc.pixelWidth:cmc.width) + 
  819.                "; height: " + (OP?cmc.pixelHeight:cmc.height) + "; ";
  820.     }
  821.     
  822.     function AutoPos(Menu, imgObj, arAlignment) {
  823.         //IE,NS,SM,OP
  824.         //This function finds the image-based hotspot and returns the position at which 
  825.         //the menu should be displayed based on the alignment setting.
  826.         //------------------------------
  827.         //Version 1.1
  828.         //
  829.         var x = GetImgXY(imgObj)[0];
  830.         var y = GetImgXY(imgObj)[1];
  831.         var mW = parseInt(NS?Menu.w:Menu.width);
  832.         var mH = parseInt(NS?Menu.h:Menu.height);
  833.             
  834.         switch(arAlignment) {
  835.             case 0:
  836.                 y += GetImgWH(imgObj)[1];
  837.                 break;
  838.             case 1:
  839.                 x += GetImgWH(imgObj)[0] - mW;
  840.                 y += GetImgWH(imgObj)[1];
  841.                 break;
  842.             case 2:
  843.                 y -= mH;
  844.                 break;
  845.             case 3:
  846.                 x += GetImgWH(imgObj)[0] - mW;
  847.                 y -= mH;
  848.                 break;
  849.             case 4:
  850.                 x -= mW;
  851.                 break;
  852.             case 5:
  853.                 x -= mW;
  854.                 y -= mH - GetImgWH(imgObj)[1];
  855.                 break;
  856.             case 6:
  857.                 x += GetImgWH(imgObj)[0];
  858.                 break;
  859.             case 7:
  860.                 x += GetImgWH(imgObj)[0];
  861.                 y -= mH - GetImgWH(imgObj)[1];
  862.                 break;
  863.         }
  864.         
  865.         return [x, y];
  866.     }
  867.  
  868.     function GetImgXY(imgObj) {
  869.         //IE,NS,SM,OP
  870.         //This function returns the x,y coordinates of an image.
  871.         //------------------------------
  872.         //Version 1.1
  873.         //
  874.         var x;
  875.         var y;
  876.             
  877.         if(IE)    {
  878.             x = getOffset(imgObj)[0];
  879.             y = getOffset(imgObj)[1];
  880.         } else    {
  881.             x = imgObj.x;
  882.             y = imgObj.y;
  883.         }
  884.             
  885.         return [x, y];
  886.         
  887.     }
  888.  
  889.     function GetImgWH(imgObj) {
  890.         //IE,NS,SM,OP
  891.         //This function returns the width and height of an image.
  892.         //------------------------------
  893.         //Version 1.1
  894.         //
  895.         return [parseInt(imgObj.width), parseInt(imgObj.height)];
  896.     }
  897.  
  898.     function getOffset(imgObj) {
  899.         //IE,NS,SM,OP
  900.         //This function returns the horizontal and vertical offset of an object.
  901.         //------------------------------
  902.         //Version 1.0
  903.         //
  904.         x = imgObj.offsetLeft;
  905.         y = imgObj.offsetTop;
  906.         ce =imgObj.offsetParent;
  907.         while (ce!=null)    {
  908.             y += ce.offsetTop;
  909.             x += ce.offsetLeft;
  910.             ce = ce.offsetParent;
  911.         }
  912.         return [x,y];
  913.         
  914.     }
  915.     
  916.     function AutoHide() {
  917.         //IE,NS,SM,OP
  918.         //This function hides the menus, even when a submenu is open and no
  919.         //command has been selected.
  920.         //------------------------------
  921.         //Version 1.1
  922.         //
  923.         var original_nOM = nOM;
  924.         var OktoClose = true;
  925.         for(;nOM>0;nOM--)
  926.             if(InMenu()) {
  927.                 OktoClose = false;
  928.                 break;
  929.             }
  930.         nOM = original_nOM;
  931.         if(OktoClose&&!IsOverHS)
  932.             HideAll();
  933.         
  934.         TimerHideHnd = window.setTimeout("AutoHide()", TimerHideDelay);        
  935.     }
  936.     
  937.     function PlaySound() {
  938.         //IE,NS
  939.         //This function plays the embeded sound referenced by SelSndId.
  940.         //WARNING: This function is under development
  941.         //------------------------------
  942.         //Version 1.0
  943.         //
  944.         if(IsWin&&!SM&&(IE&&BV>=5||NS)) {
  945.             var s = mFrame.document.embeds["Snd" + SelSndId];
  946.             if(s) s.play();
  947.         }
  948.         SelSndId = 0;
  949.     }
  950.     
  951.     function ShowContextMenu(e) {
  952.         //IE,NS
  953.         //This function is called when a user rightclicks on the document and it will show a predefined menu.
  954.         //------------------------------
  955.         //Version 1.2
  956.         //
  957.         if(cntxMenu!='') {
  958.             if(IE) {
  959.                 SetPointerPos(e);
  960.                 IsContext = true;
  961.                 cFrame.ShowMenu(cntxMenu, mX-1, mY-1, false);
  962.                 return false;
  963.             }
  964.             
  965.             if(NS)
  966.                 if(e.which==3) {
  967.                     IsContext = true;
  968.                     cFrame.ShowMenu(cntxMenu, e.x-1, e.y-1, false);
  969.                     return false;
  970.                 }
  971.         }        
  972.         return true;
  973.     }
  974.  
  975.     function SetUpEvents() {
  976.         //IE,NS,SM,OP
  977.         //This function initializes the frame variables and setups the event handling.
  978.         //------------------------------
  979.         //Version 2.1
  980.         //
  981.         if(!SM) onerror = errHandler;
  982.         if(typeof(mFrame)=="undefined")
  983.         mFrame = eval(frames['self']);
  984.         if(typeof(mFrame)=="undefined")
  985.             window.setTimeout("SetUpEvents()",10);
  986.         else {
  987.             if(NS) {
  988.                 mFrame.captureEvents(Event.MOUSEMOVE);
  989.                 mFrame.onmousemove = HideMenus;
  990.                 if(cntxMenu!="") {
  991.                     mFrame.window.captureEvents(Event.MOUSEDOWN);
  992.                     mFrame.window.onmousedown = ShowContextMenu;
  993.                 }
  994.                 nsOW = GetWidthHeight()[0];
  995.                 nsOH = GetWidthHeight()[1];
  996.                 window.onresize = rHnd;
  997.                 PrepareEvents();
  998.             }
  999.             if(IE) {
  1000.                 document.onmousemove = HideMenus;
  1001.                 mFrame.document.onmousemove = document.onmousemove;
  1002.                 mFrame.document.oncontextmenu = ShowContextMenu;
  1003.                 if(SM&&!OP) {
  1004.                     var i = 0;
  1005.                     var m;
  1006.                     while(mFrame.document.getElementById(i)) {
  1007.                         m = mFrame.document.getElementById(i++);
  1008.                         m.style.width = parseInt(m.style.width) - 2*parseInt(m.style.paddingLeft) + "px";
  1009.                         m.style.height = parseInt(m.style.height) - 2*parseInt(m.style.paddingTop) + "px";
  1010.                     }
  1011.                 }
  1012.             }
  1013.             IsFrames = (cFrame!=mFrame);
  1014.             MenusReady = true;
  1015.         }
  1016.     }
  1017.     
  1018.     function errHandler(sMsg,sUrl,sLine) {
  1019.         //IE,NS
  1020.         //This function will trap any errors generated by the scripts and filter the unhandled ones.
  1021.         //------------------------------
  1022.         //Version 1.1
  1023.         //
  1024.         if(sMsg.substr(0,16)!="Access is denied"&&sMsg!="Permission denied")
  1025.             alert("Java Script Error\n" +
  1026.                   "\nDescription: " + sMsg +
  1027.                   "\nSource: " + sUrl +
  1028.                   "\nLine: "+sLine);
  1029.         return true;
  1030.     }
  1031.     
  1032.     function FixPointSize(s) {
  1033.         //NS
  1034.         //This function increases the point-font value of any tag.
  1035.         //------------------------------
  1036.         //Version 1.5
  1037.         //
  1038.         if(s.indexOf("point-size=")!=-1) {
  1039.             var sp = s.split("point-size=")[1];
  1040.             var ls = s.split("point-size=")[0] + "point-size=";
  1041.             var ps = sp.substr(0,sp.indexOf(" "));
  1042.             var rs = s.split("point-size=")[1].substr(sp.indexOf(" "));
  1043.             ps = parseInt(ps) + 3;
  1044.         } else
  1045.             return s;
  1046.  
  1047.         return ls + ps + rs;
  1048.     }
  1049.     
  1050.     function ClearTimer(t) {
  1051.         //NS,IE
  1052.         //This function is used to overcome a bug in very
  1053.         //old versions of Navigator 4
  1054.         //------------------------------
  1055.         //Version 1.0
  1056.         //
  1057.         if(t) window.clearTimeout(t);
  1058.     }
  1059.     
  1060.     function rHnd() {
  1061.         //NS
  1062.         //This function is used to reload the page when Navigator window is resized.
  1063.         //Original Code from DHTML Lab
  1064.         //------------------------------
  1065.         //Version 1.0
  1066.         //
  1067.         if((GetWidthHeight()[0]!=nsOW) || (GetWidthHeight()[1]!=nsOH))
  1068.             frames["top"].location.reload();
  1069.     }
  1070.  
  1071.     function PrepareEvents() {
  1072.         //NS
  1073.         //This function is called right after the menus are rendered.
  1074.         //It has been designed to attach the event handlers to the <layer> tag and
  1075.         //fix the font size problems with Navigator under the Mac and Linux.
  1076.         //------------------------------
  1077.         //Version 4.0
  1078.         //
  1079.         for(var l=0; l<mFrame.document.layers.length; l++) {
  1080.             var lo = mFrame.document.layers[l];
  1081.             if(lo.layers.length) {
  1082.                 lo.w = lo.clip.width;
  1083.                 lo.h = lo.clip.height;
  1084.                 for(var sx=0; sx<lo.layers.length; sx++)
  1085.                     for(var sl=0; sl<lo.layers[sx].layers.length; sl++) {
  1086.                         var slo = mFrame.document.layers[l].layers[sx].layers[sl];
  1087.                         if(slo.name.indexOf("EH")>0) {
  1088.                             slo.document.onmouseup = hNSCClick;
  1089.                             slo.document.TCode = nTCode[slo.name.split("EH")[1]];
  1090.                         } else
  1091.                             if((slo.name.indexOf("MC")!=-1)&&!IsWin&&!NSFixedFonts)
  1092.                                 if(nLayer[slo.name.substr(2)].split("|")[0]!="") {
  1093.                                     nLayer[slo.name.substr(2)] = FixPointSize(nLayer[slo.name.substr(2)]);                            
  1094.                                     hLayer[slo.name.substr(2)] = FixPointSize(hLayer[slo.name.substr(2)]);
  1095.                                 }
  1096.                     }
  1097.  
  1098.             }
  1099.         }
  1100.         NSFixedFonts = true;
  1101.     }
  1102.  
  1103.     if(IE)
  1104.         with(document) {
  1105.             open();
  1106.             write("<div id=\"grpProducts\" style=\"position: absolute; left:0px; top:0px; width:119px; height:87px; z-index: 1000; visibility: hidden\"><div id=\"grpProductsfrmt\" style=\"position: absolute; left:0px; top:0px; width: 119px; height: 87px; background-color: #FFC840; border-left: #804040 2px solid ; border-right: #804040 2px solid ; border-top: #804040 2px solid ; border-bottom: #804040 2px solid ;\"><div nowrap style=\"position: absolute;; left: 2px; top: 2px; width: 111px; height: 21px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=0 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'ComputersRImg\',this);status=\'Computers\';cFrame.ShowMenu(\'grpComputers\', 1, 0, true);\"><span style=\"position:absolute; left: 9px; top: 5px; width: 93px; height: 11px;\"><div style=\"position:absolute; top:-1px; width:75px; left:0px;\"  align=left>Computers</div><span style=\"position:absolute; top:0px; left:83px;\"><img name=ComputersRImg src=\"file:///C:/My%20Projects/Visual%20Basic/DHTML%20Menu%20Builder%203.0/Help/tutorial/images/black_arrow.gif\" width=10 height=10></span></span></div><div nowrap style=\"position: absolute;; left: 2px; top: 24px; width: 111px; height: 21px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=1 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'AccessoriesRImg\',this);status=\'Accessories\';cFrame.ShowMenu(\'grpAccessories\', 1, 0, true);\"><span style=\"position:absolute; left: 9px; top: 5px; width: 93px; height: 11px;\"><div style=\"position:absolute; top:-1px; width:75px; left:0px;\"  align=left>Accessories</div><span style=\"position:absolute; top:0px; left:83px;\"><img name=AccessoriesRImg src=\"file:///C:/My%20Projects/Visual%20Basic/DHTML%20Menu%20Builder%203.0/Help/tutorial/images/black_arrow.gif\" width=10 height=10></span></span></div><div style=\"position: absolute; overflow:hidden; top: 51; left: 10px; width: 99px; height: 2px; border-top: 1px solid #000080; border-bottom: 1px solid #FFFFFF;\"></div><div nowrap style=\"position: absolute;; left: 2px; top: 60px; width: 111px; height: 21px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=2 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'_\',this);status=\'Catalog Index\';\" OnClick=\"cFrame.execURL(\'\', \'frames[self]\');\"><span style=\"position:absolute; left: 9px; top: 5px; width: 93px; height: 11px;\"><div style=\"position:absolute; top:-1px; width:93px; left:0px;\"  align=left>Catalog Index</div></span></div></div></div><div id=\"grpComputers\" style=\"position: absolute; left:0px; top:0px; width:168px; height:86px; z-index: 1000; visibility: hidden\"><div id=\"grpComputersfrmt\" style=\"position: absolute; left:0px; top:0px; width: 168px; height: 86px; background-color: #FFC840; border-left: #804040 2px solid ; border-right: #804040 2px solid ; border-top: #804040 2px solid ; border-bottom: #804040 2px solid ;\"><div nowrap style=\"position: absolute;; left: 2px; top: 2px; width: 160px; height: 21px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=3 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'_\',this);status=\'High Performance\';\" OnClick=\"cFrame.execURL(\'\', \'frames[self]\');\"><span style=\"position:absolute; left: 9px; top: 5px; width: 142px; height: 11px;\"><div style=\"position:absolute; top:-1px; width:142px; left:0px;\"  align=left>High Performance</div></span></div><div nowrap style=\"position: absolute;; left: 2px; top: 24px; width: 160px; height: 21px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=4 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'_\',this);status=\'Gaming Systems\';\" OnClick=\"cFrame.execURL(\'\', \'frames[self]\');\"><span style=\"position:absolute; left: 9px; top: 5px; width: 142px; height: 11px;\"><div style=\"position:absolute; top:-1px; width:142px; left:0px;\"  align=left>Gaming Systems</div></span></div><div nowrap style=\"position: absolute;; left: 2px; top: 46px; width: 160px; height: 34px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=5 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'_\',this);status=\'Computers for the Home<br>Desktop Systems\';\" OnClick=\"cFrame.execURL(\'\', \'frames[self]\');\"><span style=\"position:absolute; left: 9px; top: 5px; width: 142px; height: 24px;\"><div style=\"position:absolute; top:-1px; width:142px; left:0px;\"  align=left>Computers for the Home<br>Desktop Systems</div></span></div></div></div><div id=\"grpAccessories\" style=\"position: absolute; left:0px; top:0px; width:90px; height:95px; z-index: 1000; visibility: hidden\"><div id=\"grpAccessoriesfrmt\" style=\"position: absolute; left:0px; top:0px; width: 90px; height: 95px; background-color: #FFC840; border-left: #804040 2px solid ; border-right: #804040 2px solid ; border-top: #804040 2px solid ; border-bottom: #804040 2px solid ;\"><div nowrap style=\"position: absolute;; left: 2px; top: 2px; width: 82px; height: 21px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=6 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'_\',this);status=\'Cables\';\" OnClick=\"cFrame.execURL(\'\', \'frames[self]\');\"><span style=\"position:absolute; left: 9px; top: 5px; width: 64px; height: 11px;\"><div style=\"position:absolute; top:-1px; width:64px; left:0px;\"  align=left>Cables</div></span></div><div nowrap style=\"position: absolute;; left: 2px; top: 24px; width: 82px; height: 21px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=7 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'_\',this);status=\'Adapters\';\" OnClick=\"cFrame.execURL(\'\', \'frames[self]\');\"><span style=\"position:absolute; left: 9px; top: 5px; width: 64px; height: 11px;\"><div style=\"position:absolute; top:-1px; width:64px; left:0px;\"  align=left>Adapters</div></span></div><div nowrap style=\"position: absolute;; left: 2px; top: 46px; width: 82px; height: 21px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=8 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'_\',this);status=\'Connectors\';\" OnClick=\"cFrame.execURL(\'\', \'frames[self]\');\"><span style=\"position:absolute; left: 9px; top: 5px; width: 64px; height: 11px;\"><div style=\"position:absolute; top:-1px; width:64px; left:0px;\"  align=left>Connectors</div></span></div><div nowrap style=\"position: absolute;; left: 2px; top: 68px; width: 82px; height: 21px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=9 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'_\',this);status=\'Batteries\';\" OnClick=\"cFrame.execURL(\'\', \'frames[self]\');\"><span style=\"position:absolute; left: 9px; top: 5px; width: 64px; height: 11px;\"><div style=\"position:absolute; top:-1px; width:64px; left:0px;\"  align=left>Batteries</div></span></div></div></div><div id=\"grpLinks\" style=\"position: absolute; left:0px; top:0px; width:129px; height:51px; z-index: 1000; visibility: hidden\"><div id=\"grpLinksfrmt\" style=\"position: absolute; left:0px; top:0px; width: 129px; height: 51px; background-color: #FFC840; border-left: #804040 2px solid ; border-right: #804040 2px solid ; border-top: #804040 2px solid ; border-bottom: #804040 2px solid ;\"><div nowrap style=\"position: absolute;; left: 2px; top: 2px; width: 121px; height: 21px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=10 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'_\',this);status=\'Search the Web\';\" OnClick=\"cFrame.execURL(\'http:\\www.google.com\', \'frames[self]\');\"><span style=\"position:absolute; left: 9px; top: 5px; width: 103px; height: 11px;\"><div style=\"position:absolute; top:-1px; width:103px; left:0px;\"  align=left>Search the Web</div></span></div><div nowrap style=\"position: absolute;; left: 2px; top: 24px; width: 121px; height: 21px; font-family: Tahoma; font-size: 11px; font-weight: bold; font-style: normal; text-decoration: none; color: #000000; cursor: default; background-color: #FFC840;\" id=11 OnMouseOver=\"cFrame.HoverSel(0,\'_\',\'_\',this);status=\'xFX JumpStart<sup>«</sup>\';\" OnClick=\"javascript:dmbNW=window.open(\'http:\\software.xfx.net\',\'NewWindow\',\'left=\'+80+\',top=\'+80+\',width=\'+600+\',height=\'+400+\',directories=0,channelmode=0,toolbar=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=1\');dmbNW.focus();\"><span style=\"position:absolute; left: 9px; top: 5px; width: 103px; height: 11px;\"><div style=\"position:absolute; top:-1px; width:103px; left:0px;\"  align=left>xFX JumpStart<sup>«</sup></div></span></div></div></div>");
  1107.             close();
  1108.         }
  1109.     if(NS)
  1110.         with(document) {
  1111.             open();
  1112.             write("<layer name=grpProducts top=0 left=0 width=119 height=87 z-index=1000 bgColor=#804040 visibility=hidden><layer bgColor=#FFC840 left=2 top=2 width=115 height=83 z-index=1001><layer name=MC1EH1 left=2 top=2 width=111 height=21 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'Computers\';cFrame.ShowMenu(\'grpComputers\', 1, 0, true);\"></layer><layer name=MC1 left=2 top=2 width=111 height=21 z-index=1002 bgColor=#FFC840></layer><layer name=MC2EH2 left=2 top=24 width=111 height=21 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'Accessories\';cFrame.ShowMenu(\'grpAccessories\', 1, 0, true);\"></layer><layer name=MC2 left=2 top=24 width=111 height=21 z-index=1002 bgColor=#FFC840></layer><layer top=48 left=10 width=95 height=2 z-index=1000 bgColor=#FFFFFF></layer><layer name=MC4EH4 left=2 top=60 width=111 height=21 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'Catalog Index\';\"></layer><layer name=MC4 left=2 top=60 width=111 height=21 z-index=1002 bgColor=#FFC840></layer></layer></layer><layer name=grpComputers top=0 left=0 width=168 height=86 z-index=1000 bgColor=#804040 visibility=hidden><layer bgColor=#FFC840 left=2 top=2 width=164 height=82 z-index=1001><layer name=MC5EH5 left=2 top=2 width=160 height=21 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'High Performance\';\"></layer><layer name=MC5 left=2 top=2 width=160 height=21 z-index=1002 bgColor=#FFC840></layer><layer name=MC6EH6 left=2 top=24 width=160 height=21 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'Gaming Systems\';\"></layer><layer name=MC6 left=2 top=24 width=160 height=21 z-index=1002 bgColor=#FFC840></layer><layer name=MC7EH7 left=2 top=46 width=160 height=34 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'Computers for the Home<br>Desktop Systems\';\"></layer><layer name=MC7 left=2 top=46 width=160 height=34 z-index=1002 bgColor=#FFC840></layer></layer></layer><layer name=grpAccessories top=0 left=0 width=90 height=95 z-index=1000 bgColor=#804040 visibility=hidden><layer bgColor=#FFC840 left=2 top=2 width=86 height=91 z-index=1001><layer name=MC8EH8 left=2 top=2 width=82 height=21 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'Cables\';\"></layer><layer name=MC8 left=2 top=2 width=82 height=21 z-index=1002 bgColor=#FFC840></layer><layer name=MC9EH9 left=2 top=24 width=82 height=21 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'Adapters\';\"></layer><layer name=MC9 left=2 top=24 width=82 height=21 z-index=1002 bgColor=#FFC840></layer><layer name=MC10EH10 left=2 top=46 width=82 height=21 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'Connectors\';\"></layer><layer name=MC10 left=2 top=46 width=82 height=21 z-index=1002 bgColor=#FFC840></layer><layer name=MC11EH11 left=2 top=68 width=82 height=21 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'Batteries\';\"></layer><layer name=MC11 left=2 top=68 width=82 height=21 z-index=1002 bgColor=#FFC840></layer></layer></layer><layer name=grpLinks top=0 left=0 width=129 height=51 z-index=1000 bgColor=#804040 visibility=hidden><layer bgColor=#FFC840 left=2 top=2 width=125 height=47 z-index=1001><layer name=MC12EH12 left=2 top=2 width=121 height=21 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'Search the Web\';\"></layer><layer name=MC12 left=2 top=2 width=121 height=21 z-index=1002 bgColor=#FFC840></layer><layer name=MC13EH13 left=2 top=24 width=121 height=21 z-index=1003 OnMouseOver=\"cFrame.NSHoverSel(0,this,\'#804040\');status=\'xFX JumpStart<sup>«</sup>\';\"></layer><layer name=MC13 left=2 top=24 width=121 height=21 z-index=1002 bgColor=#FFC840></layer></layer></layer>");
  1113.             close();
  1114.         }
  1115. SetUpEvents();
  1116.  
  1117.  
  1118.