home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 November / Chip Kasım 2001.iso / prog / share / dhtml / setup.exe / tutorial / menus / menu.js < prev    next >
Encoding:
JavaScript  |  2001-08-22  |  50.2 KB  |  1,111 lines

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