home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2002 August / INTERNET94.ISO / pc / software / windows / mail / ft_gate_office / jscript / dropheader.js < prev    next >
Encoding:
JavaScript  |  2001-11-07  |  38.9 KB  |  1,133 lines

  1. /* dhtmllib.js Copyright 1999 by Mike Hall. Web address: http://www.brainjar.com
  2. Last update: February 26, 2000.
  3. Provides basic functions for DHTML positioned elements which will work on 
  4. both Netscape Communicator and Internet Explorer browsers (version 4.0 and up).*/
  5. // Determine browser.
  6. var AppVer=parseFloat(navigator.appVersion);
  7. var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 && AppVer>= 4.0) ? 1 : 0;
  8. var isMinIE4 = (document.all) ? 1 : 0;
  9. var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;
  10. //-----------------------------------------------------------------------------
  11. // Layer visibility.
  12. //-----------------------------------------------------------------------------
  13. function hideLayer(layer) {
  14.   if (isMinNS4)
  15.     layer.visibility = "hide";
  16.   if (isMinIE4)
  17.     layer.style.visibility = "hidden";
  18. }
  19. function showLayer(layer) {
  20.   if (isMinNS4)
  21.     layer.visibility = "show";
  22.   if (isMinIE4)
  23.     layer.style.visibility = "visible";
  24. }
  25. function inheritLayer(layer) {
  26.   if (isMinNS4)
  27.     layer.visibility = "inherit";
  28.   if (isMinIE4)
  29.     layer.style.visibility = "inherit";
  30. }
  31. function getVisibility(layer) {
  32.   if (isMinNS4) {
  33.     if (layer.visibility == "show")
  34.       return "visible";
  35.     if (layer.visibility == "hide")
  36.       return "hidden";
  37.     return layer.visibility;
  38.   }
  39.   if (isMinIE4)
  40.     return layer.style.visibility;
  41.   return "";
  42. }
  43. //-----------------------------------------------------------------------------
  44. // Layer positioning.
  45. //-----------------------------------------------------------------------------
  46. function moveLayerTo(layer, x, y) {
  47.   if (isMinNS4)
  48.     layer.moveTo(x, y);
  49.   if (isMinIE4) {
  50.     layer.style.left = x;
  51.     layer.style.top  = y;
  52.   }
  53. }
  54. function moveLayerBy(layer, dx, dy) {
  55.   if (isMinNS4)
  56.     layer.moveBy(dx, dy);
  57.   if (isMinIE4) {
  58.     layer.style.pixelLeft += dx;
  59.     layer.style.pixelTop  += dy;
  60.   }
  61. }
  62. function getLeft(layer) {
  63.   if (isMinNS4)
  64.     return layer.left;
  65.   if (isMinIE4)
  66.     return layer.style.pixelLeft;
  67.   return -1;
  68. }
  69. function getTop(layer) {
  70.   if (isMinNS4)
  71.     return layer.top;
  72.   if (isMinIE4)
  73.     return layer.style.pixelTop;
  74.   return -1;
  75. }
  76. function getRight(layer) {
  77.   if (isMinNS4)
  78.     return layer.left + getWidth(layer);
  79.   if (isMinIE4)
  80.     return layer.style.pixelLeft + getWidth(layer);
  81.   return -1;
  82. }
  83. function getBottom(layer) {
  84.   if (isMinNS4)
  85.     return layer.top + getHeight(layer);
  86.   if (isMinIE4)
  87.     return layer.style.pixelTop + getHeight(layer);
  88.   return -1;
  89. }
  90. function getPageLeft(layer) {
  91.   var x;
  92.   if (isMinNS4)
  93.     return layer.pageX;
  94.   if (isMinIE4) {
  95.     x = 0;
  96.     while (layer.offsetParent != null) {
  97.       x += layer.offsetLeft;
  98.       layer = layer.offsetParent;
  99.     }
  100.     x += layer.offsetLeft;
  101.     return x;
  102.   }
  103.   return -1;
  104. }
  105. function getPageTop(layer) {
  106.   var y;
  107.   if (isMinNS4)
  108.     return layer.pageY;
  109.   if (isMinIE4) {
  110.     y = 0;
  111.     while (layer.offsetParent != null) {
  112.       y += layer.offsetTop;
  113.       layer = layer.offsetParent;
  114.     }
  115.     y += layer.offsetTop;
  116.     return y;
  117.   }
  118.   return -1;
  119. }
  120. function getWidth(layer) {
  121.   if (isMinNS4) {
  122.     if (layer.document.width)
  123.       return layer.document.width;
  124.     else
  125.       return layer.clip.right - layer.clip.left;
  126.   }
  127.   if (isMinIE4) {
  128.     if (layer.style.pixelWidth)
  129.       return layer.style.pixelWidth;
  130.     else
  131.       return layer.clientWidth;
  132.   }
  133.   return -1;
  134. }
  135. function getHeight(layer) {
  136.   if (isMinNS4) {
  137.     if (layer.document.height)
  138.       return layer.document.height;
  139.     else
  140.       return layer.clip.bottom - layer.clip.top;
  141.   }
  142.   if (isMinIE4) {
  143.     if (layer.style.pixelHeight)
  144.       return layer.style.pixelHeight;
  145.     else
  146.       return layer.clientHeight;
  147.   }
  148.   return -1;
  149. }
  150. function getzIndex(layer) {
  151.   if (isMinNS4)
  152.     return layer.zIndex;
  153.   if (isMinIE4)
  154.     return layer.style.zIndex;
  155.   return -1;
  156. }
  157. function setzIndex(layer, z) {
  158.   if (isMinNS4)
  159.     layer.zIndex = z;
  160.   if (isMinIE4)
  161.     layer.style.zIndex = z;
  162. }
  163. //-----------------------------------------------------------------------------
  164. // Layer clipping.
  165. //-----------------------------------------------------------------------------
  166. function clipLayer(layer, clipleft, cliptop, clipright, clipbottom) {
  167.   if (isMinNS4) {
  168.     layer.clip.left   = clipleft;
  169.     layer.clip.top    = cliptop;
  170.     layer.clip.right  = clipright;
  171.     layer.clip.bottom = clipbottom;
  172.   }
  173.   if (isMinIE4)
  174.     layer.style.clip = 'rect(' + cliptop + ' ' +  clipright + ' ' + clipbottom + ' ' + clipleft +')';
  175. }
  176. function getClipLeft(layer) {
  177.   if (isMinNS4)
  178.     return layer.clip.left;
  179.   if (isMinIE4) {
  180.     var str =  layer.style.clip;
  181.     if (!str)
  182.       return 0;
  183.     var clip = getIEClipValues(layer.style.clip);
  184.     return(clip[3]);
  185.   }
  186.   return -1;
  187. }
  188. function getClipTop(layer) {
  189.   if (isMinNS4)
  190.     return layer.clip.top;
  191.   if (isMinIE4) {
  192.     var str =  layer.style.clip;
  193.     if (!str)
  194.       return 0;
  195.     var clip = getIEClipValues(layer.style.clip);
  196.     return clip[0];
  197.   }
  198.   return -1;
  199. }
  200. function getClipRight(layer) {
  201.   if (isMinNS4)
  202.     return layer.clip.right;
  203.   if (isMinIE4) {
  204.     var str =  layer.style.clip;
  205.     if (!str)
  206.       return layer.style.pixelWidth;
  207.     var clip = getIEClipValues(layer.style.clip);
  208.     return clip[1];
  209.   }
  210.   return -1;
  211. }
  212. function getClipBottom(layer) {
  213.   if (isMinNS4)
  214.     return layer.clip.bottom;
  215.   if (isMinIE4) {
  216.     var str =  layer.style.clip;
  217.     if (!str)
  218.       return layer.style.pixelHeight;
  219.     var clip = getIEClipValues(layer.style.clip);
  220.     return clip[2];
  221.   }
  222.   return -1;
  223. }
  224. function getClipWidth(layer) {
  225.   if (isMinNS4)
  226.     return layer.clip.width;
  227.   if (isMinIE4) {
  228.     var str = layer.style.clip;
  229.     if (!str)
  230.       return layer.style.pixelWidth;
  231.     var clip = getIEClipValues(layer.style.clip);
  232.     return clip[1] - clip[3];
  233.   }
  234.   return -1;
  235. }
  236. function getClipHeight(layer) {
  237.   if (isMinNS4)
  238.     return layer.clip.height;
  239.   if (isMinIE4) {
  240.     var str =  layer.style.clip;
  241.     if (!str)
  242.       return layer.style.pixelHeight;
  243.     var clip = getIEClipValues(layer.style.clip);
  244.     return clip[2] - clip[0];
  245.   }
  246.   return -1;
  247. }
  248. function getIEClipValues(str) {
  249.   var clip = new Array();
  250.   var i;
  251.   // Parse out the clipping values for IE layers.
  252.   i = str.indexOf("(");
  253.   clip[0] = parseInt(str.substring(i + 1, str.length), 10);
  254.   i = str.indexOf(" ", i + 1);
  255.   clip[1] = parseInt(str.substring(i + 1, str.length), 10);
  256.   i = str.indexOf(" ", i + 1);
  257.   clip[2] = parseInt(str.substring(i + 1, str.length), 10);
  258.   i = str.indexOf(" ", i + 1);
  259.   clip[3] = parseInt(str.substring(i + 1, str.length), 10);
  260.   return clip;
  261. }
  262. //-----------------------------------------------------------------------------
  263. // Layer scrolling.
  264. //-----------------------------------------------------------------------------
  265. function scrollLayerTo(layer, x, y, bound) {
  266.   var dx = getClipLeft(layer) - x;
  267.   var dy = getClipTop(layer) - y;
  268.   scrollLayerBy(layer, -dx, -dy, bound);
  269. }
  270. function scrollLayerBy(layer, dx, dy, bound) {
  271.   var cl = getClipLeft(layer);
  272.   var ct = getClipTop(layer);
  273.   var cr = getClipRight(layer);
  274.   var cb = getClipBottom(layer);
  275.   if (bound) {
  276.     if (cl + dx < 0)
  277.       dx = -cl;
  278.     else if (cr + dx > getWidth(layer))
  279.       dx = getWidth(layer) - cr;
  280.     if (ct + dy < 0)
  281.       dy = -ct;
  282.     else if (cb + dy > getHeight(layer))
  283.       dy = getHeight(layer) - cb;
  284.   }
  285.   clipLayer(layer, cl + dx, ct + dy, cr + dx, cb + dy);
  286.   moveLayerBy(layer, -dx, -dy);
  287. }
  288. //-----------------------------------------------------------------------------
  289. // Layer background.
  290. //-----------------------------------------------------------------------------
  291. function setBgColor(layer, color) {
  292.   if (isMinNS4)
  293.     layer.bgColor = color;
  294.   if (isMinIE4)
  295.     layer.style.backgroundColor = color;
  296. }
  297. function setBgImage(layer, src) {
  298.   if (isMinNS4)
  299.     layer.background.src = src;
  300.   if (isMinIE4)
  301.     layer.style.backgroundImage = "url(" + src + ")";
  302. }
  303. //-----------------------------------------------------------------------------
  304. // Layer utilities.
  305. //-----------------------------------------------------------------------------
  306. function getLayer(name) {
  307.   if (isMinNS4)
  308.     return findLayer(name, document);
  309.   if (isMinIE4)
  310.     return eval('document.all.' + name);
  311.   return null;
  312. }
  313. function findLayer(name, doc) {
  314.   var i, layer;
  315.   for (i = 0; i < doc.layers.length; i++) {
  316.     layer = doc.layers[i];
  317.     if (layer.name == name)
  318.       return layer;
  319.     if (layer.document.layers.length > 0)
  320.       if ((layer = findLayer(name, layer.document)) != null)
  321.         return layer;
  322.   }
  323.   return null;
  324. }
  325. //-----------------------------------------------------------------------------
  326. // Image utilities.
  327. //-----------------------------------------------------------------------------
  328. function getImage(name) {
  329.   if (isMinNS4) {
  330.     return findImage(name, document);
  331.   }
  332.   if (isMinIE4)
  333.     return eval('document.all.' + name);
  334.   return null;
  335. }
  336. function findImage(name, doc) {
  337.   var i, img;
  338.   for (i = 0; i < doc.images.length; i++)
  339.     if (doc.images[i].name == name)
  340.       return doc.images[i];
  341.   for (i = 0; i < doc.layers.length; i++)
  342.     if ((img = findImage(name, doc.layers[i].document)) != null) {
  343.       img.container = doc.layers[i];
  344.       return img;
  345.     }
  346.   return null;
  347. }
  348. function getImagePageLeft(img) {
  349.   var x, obj;
  350.   if (isMinNS4) {
  351.     if (img.container != null)
  352.       return img.container.pageX + img.x;
  353.     else
  354.       return img.x;
  355.   }
  356.   if (isMinIE4) {
  357.     x = 0;
  358.     obj = img;
  359.     while (obj.offsetParent != null) {
  360.       x += obj.offsetLeft;
  361.       obj = obj.offsetParent;
  362.     }
  363.     x += obj.offsetLeft;
  364.     return x;
  365.   }
  366.   return -1;
  367. }
  368. function getImagePageTop(img) {
  369.   var y, obj;
  370.   if (isMinNS4) {
  371.     if (img.container != null)
  372.       return img.container.pageY + img.y;
  373.     else
  374.       return img.y;
  375.   }
  376.   if (isMinIE4) {
  377.     y = 0;
  378.     obj = img;
  379.     while (obj.offsetParent != null) {
  380.       y += obj.offsetTop;
  381.       obj = obj.offsetParent;
  382.     }
  383.     y += obj.offsetTop;
  384.     return y;
  385.   }
  386.   return -1;
  387. }
  388. //-----------------------------------------------------------------------------
  389. // Window and page properties.
  390. //-----------------------------------------------------------------------------
  391. function getWindowWidth() {
  392.   if (isMinNS4)
  393.     return window.innerWidth;
  394.   if (isMinIE4)
  395.     return document.body.clientWidth;
  396.   return -1;
  397. }
  398. function getWindowHeight() {
  399.   if (isMinNS4)
  400.     return window.innerHeight;
  401.   if (isMinIE4)
  402.     return document.body.clientHeight;
  403.   return -1;
  404. }
  405. function getPageWidth() {
  406.   if (isMinNS4)
  407.     return document.width;
  408.   if (isMinIE4)
  409.     return document.body.scrollWidth;
  410.   return -1;
  411. }
  412. function getPageHeight() {
  413.   if (isMinNS4)
  414.     return document.height;
  415.   if (isMinIE4)
  416.     return document.body.scrollHeight;
  417.   return -1;
  418. }
  419. function getPageScrollX() {
  420.   if (isMinNS4)
  421.     return window.pageXOffset;
  422.   if (isMinIE4)
  423.     return document.body.scrollLeft;
  424.   return -1;
  425. }
  426. function getPageScrollY() {
  427.   if (isMinNS4)
  428.     return window.pageYOffset;
  429.   if (isMinIE4)
  430.     return document.body.scrollTop;
  431.   return -1;
  432. }
  433.  
  434. /* navbar.js  Copyright 2000 by Mike Hall. Web address: http://www.brainjar.com 
  435. Last update: August 12, 2000. Creates interactive DHTML navigation bars with drop-down menus.
  436. Note: requires dhtmllib.js */
  437. // Need this to fix a bug with IE 5.5.
  438. var isMinIE5_5 = (isMinIE5 && navigator.appVersion.indexOf("5.5") >= 0) ? 1 : 0;
  439. var navBars = new Array();    // Used to track all navigation bars.
  440. //*****************************************************************************
  441. // NavBarMenuItem constructor.
  442. //*****************************************************************************
  443. function NavBarMenuItem(text, link) {
  444.   this.text = text;    // Item text.
  445.   this.link = link;    // Link URL or JavaScript code.
  446. }
  447. //*****************************************************************************
  448. // NavBarMenu constructor.
  449. //*****************************************************************************
  450. function NavBarMenu(hdrWidth, menuWidth) {
  451.   this.hdrWidth  = hdrWidth;
  452.   this.width     = menuWidth;
  453.   this.height    = 0;
  454.   this.items = new Array();
  455.   // Define methods.
  456.   this.addItem = navBarMenuAddItem;
  457. }
  458. //*****************************************************************************
  459. // NavBarMenu methods.
  460. //*****************************************************************************
  461. function navBarMenuAddItem(item) {
  462.   this.items[this.items.length] = item;
  463. }
  464. //*****************************************************************************
  465. // NavBar constructor.
  466. //*****************************************************************************
  467. function NavBar(width) {
  468.   this.x = 0;
  469.   this.y = 0;
  470.   this.width  = width;
  471.   this.height = 20;
  472.   this.align    = "left";
  473.   this.minWidth = 0;
  474.   this.inverted = false;
  475.   this.menus = new Array();
  476.   this.created = false;
  477.   // Set default sizes.
  478.   this.border    = 1;
  479.   this.padding   = 4;
  480.   this.separator = 1;
  481.   // Set default colors.
  482.   this.borderColor  = "#000000";
  483.   this.hdrFgColor   = "#000000";
  484.   this.hdrBgColor   = "#009999";
  485.   this.hdrHiFgColor = "#ffffff";
  486.   this.hdrHiBgColor = "#666666";
  487.   this.itmFgColor   = "#000000";
  488.   this.itmBgColor   = "#cccccc";
  489.   this.itmHiFgColor = "#ffffff";
  490.   this.itmHiBgColor = "#000080";
  491.   // Set default fonts.
  492.   this.hdrFontFamily = "Arial,Helvetica,sans-serif";
  493.   this.hdrFontStyle  = "plain";
  494.   this.hdrFontWeight = "bold";
  495.   this.hdrFontSize   = "10pt";
  496.   this.itmFontFamily = "Verdana,MS Sans Serif,Arial,Helvetica,sans-serif";
  497.   this.itmFontStyle  = "plain";
  498.   this.itmFontWeight = "";
  499.   this.itmFontSize   = "8pt";
  500.   // Define methods.
  501.   this.setSizes    = navBarSetSizes;
  502.   this.setColors   = navBarSetColors;
  503.   this.setFonts    = navBarSetFonts;
  504.   this.addMenu     = navBarAddMenu;
  505.   this.create      = navBarCreate;
  506.   this.hide        = navBarHide;
  507.   this.show        = navBarShow;
  508.   this.moveTo      = navBarMoveTo;
  509.   this.moveBy      = navBarMoveBy;
  510.   this.getzIndex   = navBarGetzIndex;
  511.   this.setzIndex   = navBarSetzIndex;
  512.   this.getWidth    = navBarGetWidth;
  513.   this.getMinWidth = navBarGetMinWidth;
  514.   this.getAlign    = navBarGetAlign;
  515.   this.setAlign    = navBarSetAlign;
  516.   this.resize      = navBarResize;
  517.   this.invert      = navBarInvert;
  518.   this.isInverted  = navBarIsInverted;
  519.   // Add to the list.
  520.   this.index = navBars.length;
  521.   navBars[this.index] = this;
  522. }
  523. //*****************************************************************************
  524. // NavBar methods.
  525. //*****************************************************************************
  526. function navBarSetSizes(border, padding, separator) {
  527.   if (!this.created) {
  528.     this.border = border;
  529.     this.padding = padding;
  530.     this.separator = separator;
  531.   }
  532. }
  533. function navBarSetColors(bdColor,
  534.                          hdrFgColor, hdrBgColor, hdrHiFgColor, hdrHiBgColor,
  535.                          itmFgColor, itmBgColor, itmHiFgColor, itmHiBgColor) {
  536.   if (!this.created) {
  537.     this.borderColor  = bdColor;
  538.     this.hdrFgColor   = hdrFgColor;
  539.     this.hdrBgColor   = hdrBgColor;
  540.     this.hdrHiFgColor = hdrHiFgColor;
  541.     this.hdrHiBgColor = hdrHiBgColor;
  542.     this.itmFgColor   = itmFgColor;
  543.     this.itmBgColor   = itmBgColor;
  544.     this.itmHiFgColor = itmHiFgColor;
  545.     this.itmHiBgColor = itmHiBgColor;
  546.   }
  547. }
  548. function navBarSetFonts(hdrFamily, hdrStyle, hdrWeight, hdrSize,
  549.                         itmFamily, itmStyle, itmWeight, itmSize) {
  550.   if (!this.created) {
  551.     this.hdrFontFamily = hdrFamily;
  552.     this.hdrFontStyle  = hdrStyle;
  553.     this.hdrFontWeight = hdrWeight;
  554.     this.hdrFontSize   = hdrSize;
  555.     this.itmFontFamily = itmFamily;
  556.     this.itmFontStyle  = itmStyle;
  557.     this.itmFontWeight = itmWeight;
  558.     this.itmFontSize   = itmSize;
  559.   }
  560. }
  561. function navBarAddMenu(menu) {
  562.   if (!this.created)
  563.     this.menus[this.menus.length] = menu;
  564. }
  565. function navBarCreate() {
  566.   var str;
  567.   var i, j;
  568.   var norm, high, end;
  569.   var width, height;
  570.   var x, y;
  571.   var scrX, scrY;
  572.   if (this.created || (!isMinNS4 && !isMinIE4))
  573.     return;
  574.   // Build HTML for filler and header layers.
  575.   str = "";
  576.   // For IE4, need to scroll to end of page before inserting HTML.
  577.   if (isMinIE4 && !isMinIE5) {
  578.     scrX = getPageScrollX();
  579.     scrY = getPageScrollY();
  580.     window.scrollTo(getPageWidth(), getPageHeight());
  581.   }
  582.   if (isMinNS4)
  583.     str += '<layer name="navBar' + this.index + '_filler"></layer>\n'
  584.         +  '<layer name="navBar' + this.index + '_hdrsBase">\n';
  585.   if (isMinIE4)
  586.     str += '<div id="navBar' + this.index + '_filler"'
  587.         +  ' style="position:absolute;">'
  588.         +  '</div>\n'
  589.         +  '<div id="navBar' + this.index + '_hdrsBase"'
  590.         +  ' style="position:absolute;">\n';
  591.   // Build HTML for the headers.
  592.   for (i = 0; i < this.menus.length; i++) {
  593.     norm = '<table border=0 cellpadding=' + this.padding
  594.          + ' cellspacing=0'
  595.          + (this.menus[i].hdrWidth > 0 ? ' width=' + this.menus[i].hdrWidth : '')
  596.          + ((isMinIE4 && !isMinIE5) ? ' id="navBar' + this.index + '_tbl' + i + '"': '')
  597.          + '><tr><td'
  598.          + (this.menus[i].hdrWidth == 0 ? ' nowrap=1' + this.menus[i].hdrWidth : '')
  599.          + '>'
  600.          + '<span style="color:' + this.hdrFgColor + ';'
  601.          + 'font-family:' + this.hdrFontFamily + ';'
  602.          + 'font-size:' + this.hdrFontSize + ';'
  603.          + 'font-style:' + this.hdrFontStyle + ';'
  604.          + 'font-weight:' + this.hdrFontWeight + ';">';
  605.     high = '<table border=0 cellpadding=' + this.padding
  606.          + ' cellspacing=0'
  607.          + (this.menus[i].hdrWidth > 0 ? ' width=' + this.menus[i].hdrWidth : '')
  608.          + '><tr><td'
  609.          + (this.menus[i].hdrWidth == 0 ? ' nowrap=1' + this.menus[i].hdrWidth : '')
  610.          + '>'
  611.          + '<span style="color:' + this.hdrHiFgColor + ';'
  612.          + 'font-family:' + this.hdrFontFamily + ';'
  613.          + 'font-size:' + this.hdrFontSize + ';'
  614.          + 'font-style:' + this.hdrFontStyle + ';'
  615.          + 'font-weight:' + this.hdrFontWeight + ';">';
  616.     end  = '</span></td></tr></table>';
  617.     if (isMinNS4)
  618.       str += '<layer name="navBar' + this.index + '_head' + i + '">'
  619.           +  norm + this.menus[i].items[0].text + end
  620.           +  '</layer>\n'
  621.           +  '<layer name="navBar' + this.index + '_headHigh' + i + '">'
  622.           +  high + this.menus[i].items[0].text + end
  623.           +  '</layer>\n'
  624.           +  '<layer name="navBar' + this.index + '_headDummy' + i + '">'
  625.           +  '</layer>\n';
  626.     if (isMinIE4) {
  627.       str += '<div id="navBar' + this.index + '_head' + i + '"'
  628.           +  ' style="position:absolute;">'
  629.           +  norm + this.menus[i].items[0].text + end
  630.           +  '</div>\n'
  631.           +  '<div id="navBar' + this.index + '_headHigh' + i + '"'
  632.           +  ' style="position:absolute;">'
  633.           +  high + this.menus[i].items[0].text + end
  634.           +  '</div>\n'
  635.           +  '<div id="navBar' + this.index + '_headDummy' + i + '"'
  636.           +  ' style="position:absolute;">';
  637.       if (isMinIE5_5)
  638.         str += '<table cellspacing=0 width="100%" height="100%"><tr><td></td></tr></table>';
  639.       str += '</div>\n';
  640.     }
  641.   }
  642.   if (isMinNS4) {
  643.     str += '</layer>\n';
  644.     this.baseLayer = new Layer(this.width);
  645.     this.baseLayer.document.open();
  646.     this.baseLayer.document.write(str);
  647.     this.baseLayer.document.close();
  648.   }
  649.   if (isMinIE4) {
  650.     str += '</div>\n';
  651.     str = '<div id="navBar' + this.index + '"'
  652.         + ' style="position:absolute;left:0px;top:0px;">\n'
  653.         + str
  654.         + '</div>\n';
  655.     document.body.insertAdjacentHTML("beforeEnd", str);
  656.     this.baseLayer = getLayer("navBar" + this.index);
  657.   }
  658.   // Position and initialize each header.
  659.   width = 0;
  660.   height = 0;
  661.   for (i = 0; i < this.menus.length; i++) {
  662.     this.menus[i].hdrNormLayer = getLayer('navBar' + this.index + '_head' + i);
  663.     this.menus[i].hdrHighLayer = getLayer('navBar' + this.index + '_headHigh' + i);
  664.     this.menus[i].hdrDmmyLayer = getLayer('navBar' + this.index + '_headDummy' + i);
  665.     height = Math.max(height, getHeight(this.menus[i].hdrNormLayer));
  666.     this.height = height + 2 * this.border;
  667.     // Fix for IE4 to resize headers to fit text width.
  668.     if (isMinIE4 && !isMinIE5) {
  669.       width = this.menus[i].hdrWidth;
  670.       if (width == 0)
  671.         width = eval('document.all.navBar' + this.index + '_tbl' + i + '.clientWidth');
  672.       navBarIEResizeLayer(this.menus[i].hdrNormLayer, width, height);
  673.       navBarIEResizeLayer(this.menus[i].hdrHighLayer, width, height);
  674.       navBarIEResizeLayer(this.menus[i].hdrDmmyLayer, width, height);
  675.     }
  676.   }
  677.   x = this.border;
  678.   y = this.border;
  679.   for (i = 0; i < this.menus.length; i++) {
  680.     width = Math.max(this.menus[i].hdrWidth, getWidth(this.menus[i].hdrNormLayer));
  681.     if (this.menus[i].width == 0)
  682.       this.menus[i].width = width + 2 * this.border;
  683.     moveLayerTo(this.menus[i].hdrNormLayer, x, y);
  684.     setBgColor(this.menus[i].hdrNormLayer, this.hdrBgColor);
  685.     clipLayer(this.menus[i].hdrNormLayer, 0, 0, width, height);
  686.     inheritLayer(this.menus[i].hdrNormLayer);
  687.     moveLayerTo(this.menus[i].hdrHighLayer, x, y);
  688.     setBgColor(this.menus[i].hdrHighLayer, this.hdrHiBgColor);
  689.     clipLayer(this.menus[i].hdrHighLayer, 0, 0, width, height);
  690.     hideLayer(this.menus[i].hdrHighLayer);
  691.     moveLayerTo(this.menus[i].hdrDmmyLayer, x, y);
  692.     if (isMinIE4)
  693.       navBarIEResizeLayer(this.menus[i].hdrDmmyLayer, width, height);
  694.     clipLayer(this.menus[i].hdrDmmyLayer, 0, 0, width, height);
  695.     inheritLayer(this.menus[i].hdrDmmyLayer);
  696.     this.menus[i].hdrDmmyLayer.highLayer = this.menus[i].hdrHighLayer;
  697.     this.menus[i].hdrLeft = x;
  698.     x += width + this.border;
  699.     this.menus[i].hdrRight = x;
  700.   }
  701.   // Save resulting width of headers and total width.
  702.   this.minWidth = x;
  703.   this.width = Math.max(this.minWidth, this.width);
  704.   // Position and initialize base, filler and headers base layers.
  705.   moveLayerTo(this.baseLayer, this.x, this.y);
  706.   setBgColor(this.baseLayer, this.borderColor);
  707.   if (isMinIE4)
  708.     navBarIEResizeLayer(this.baseLayer, this.width, this.height);
  709.   clipLayer(this.baseLayer, 0, 0, this.width, this.height);
  710.   this.fillerLayer = getLayer('navBar' + this.index + '_filler');
  711.   moveLayerTo(this.fillerLayer, this.border, this.border);
  712.   setBgColor(this.fillerLayer, this.hdrBgColor);
  713.   width = this.width - 2 * this.border;
  714.   height = this.height - 2 * this.border;
  715.   if (isMinIE4)
  716.     navBarIEResizeLayer(this.fillerLayer, width, height);
  717.   clipLayer(this.fillerLayer, 0, 0, width, height);
  718.   inheritLayer(this.fillerLayer);
  719.   this.hdrsBaseLayer = getLayer('navBar' + this.index + '_hdrsBase');
  720.   if (this.align == "left")
  721.     this.hdrsOffsetX = 0;
  722.   else if (this.align == "center")
  723.     this.hdrsOffsetX = Math.round((this.width - this.minWidth) / 2);
  724.   else if (this.align == "right")
  725.     this.hdrsOffsetX = this.width - this.minWidth;
  726.   else
  727.     this.hdrsOffsetX = Math.min(parseInt(this.align, 10), this.width - this.minWidth);
  728.   moveLayerTo(this.hdrsBaseLayer, this.hdrsOffsetX, 0);
  729.   setBgColor(this.hdrsBaseLayer, this.borderColor);
  730.   if (isMinIE4)
  731.     navBarIEResizeLayer(this.hdrsBaseLayer, this.minWidth, this.height);
  732.   clipLayer(this.hdrsBaseLayer, 0, 0, this.minWidth, this.height);
  733.   inheritLayer(this.hdrsBaseLayer);
  734.   // Set up event handling and positioning for headers.
  735.   for (i = 0; i < this.menus.length; i++) {
  736.     this.menus[i].hdrDmmyLayer.index = this.index;
  737.     this.menus[i].hdrDmmyLayer.offsetX = this.menus[i].hdrLeft - this.border;
  738.     if (this.menus[i].hdrDmmyLayer.offsetX + this.menus[i].width > this.width)
  739.       this.menus[i].hdrDmmyLayer.offsetX = this.menus[i].hdrRight - this.menus[i].width;
  740.     this.menus[i].hdrDmmyLayer.offsetY = this.height - this.border;
  741.     this.menus[i].hdrDmmyLayer.onmouseover = navBarHeaderOn;
  742.     this.menus[i].hdrDmmyLayer.onmouseout = navBarHeaderOff;
  743.     if (isMinNS4) {
  744.       this.menus[i].hdrDmmyLayer.document.highLayer = this.menus[i].hdrHighLayer;
  745.       this.menus[i].hdrDmmyLayer.document.link = this.menus[i].items[0].link;
  746.       this.menus[i].hdrDmmyLayer.document.captureEvents(Event.MOUSEUP);
  747.       this.menus[i].hdrDmmyLayer.document.onmouseup = navBarItemClick;
  748.     }
  749.     if (isMinIE4) {
  750.       this.menus[i].hdrDmmyLayer.highLayer = this.menus[i].hdrHighLayer;
  751.       this.menus[i].hdrDmmyLayer.link = this.menus[i].items[0].link;
  752.       this.menus[i].hdrDmmyLayer.onclick = navBarItemClick;
  753.     }
  754.   }
  755.   // Build the drop down menus.
  756.   norm = '<table border=0 cellpadding=' + this.padding
  757.        + ' cellspacing=0 width="100%"><tr><td>'
  758.        + '<span style="color:' + this.itmFgColor + ';'
  759.        + 'font-family:' + this.itmFontFamily + ';'
  760.        + 'font-size:' + this.itmFontSize + ';'
  761.        + 'font-style:' + this.itmFontStyle + ';'
  762.        + 'font-weight:' + this.itmFontWeight + ';">';
  763.   high = '<table border=0 cellpadding=' + this.padding
  764.        + ' cellspacing=0 width="100%"><tr><td>'
  765.        + '<span style="color:' + this.itmHiFgColor + ';'
  766.        + 'font-family:' + this.itmFontFamily + ';'
  767.        + 'font-size:' + this.itmFontSize + ';'
  768.        + 'font-style:' + this.itmFontStyle + ';'
  769.        + 'font-weight:' + this.itmFontWeight + ';">';
  770.   end  = '</span></td></tr></table>';
  771.   for (i = 0; i < this.menus.length; i++) {
  772.     width = this.menus[i].width - 2 * this.border;
  773.     str = "";
  774.     for (j = 1; j < this.menus[i].items.length; j++) {
  775.       if (isMinNS4)
  776.         str += '<layer name="navBar' + this.index + '_menu' + i + '_norm' + j + '"'
  777.             +  ' width=' + width + '>'
  778.             +  norm + this.menus[i].items[j].text + end
  779.             +  '</layer>\n'
  780.             +  '<layer name="navBar' + this.index + '_menu' + i + '_high' + j + '"'
  781.             +  ' width=' + width + '>'
  782.             +  high + this.menus[i].items[j].text + end
  783.             +  '</layer>\n'
  784.             +  '<layer name="navBar' + this.index + '_menu' + i + '_dmmy' + j + '"'
  785.             +  ' width=' + width + '>'
  786.             +  '</layer>\n';
  787.       if (isMinIE4) {
  788.         str += '<div id="navBar' + this.index + '_menu' + i + '_norm' + j + '"'
  789.             +  ' style="position:absolute;width:' + width + 'px;">'
  790.             +  norm + this.menus[i].items[j].text + end
  791.             +  '</div>\n'
  792.             +  '<div id="navBar' + this.index + '_menu' + i + '_high' + j + '"'
  793.             +  ' style="position:absolute;width:' + width + 'px;">'
  794.             +  high + this.menus[i].items[j].text + end
  795.             +  '</div>\n'
  796.             +  '<div id="navBar' + this.index + '_menu' + i + '_dmmy' + j + '"'
  797.             +  ' style="position:absolute;width:' + width + 'px;">';
  798.         if (isMinIE5_5)
  799.           str += '<table cellspacing=0 width="100%" height="100%"><tr><td></td></tr></table>';
  800.         str += '</div>\n';
  801.       }
  802.     }
  803.     if (isMinNS4) {
  804.       this.menus[i].baseLayer = new Layer(this.menus[i].width);
  805.       this.menus[i].baseLayer.document.open();
  806.       this.menus[i].baseLayer.document.write(str);
  807.       this.menus[i].baseLayer.document.close();
  808.     }
  809.     if (isMinIE4) {
  810.       str = '<div id="navBar' + this.index + '_menu' + i + '"'
  811.           + ' style="position:absolute;left:0px; top:0px;'
  812.           + 'width:' + this.menus[i].width + 'px;visibility:hidden;">\n'
  813.           + str
  814.           + '</div>\n';
  815.       document.body.insertAdjacentHTML("beforeEnd", str);
  816.       this.menus[i].baseLayer = getLayer("navBar" + this.index + "_menu" + i);
  817.     }
  818.   }
  819.   // Restore original scroll position in IE4.
  820.   if (isMinIE4 && !isMinIE5)
  821.     window.scrollTo(x, y);
  822.   // Position and initialize each menu.
  823.   for (i = 0; i < this.menus.length; i++) {
  824.     moveLayerTo(this.menus[i].baseLayer, this.menus[i].hdrDmmyLayer.offsetX, this.menus[i].hdrDmmyLayer.offsetY);
  825.     setBgColor(this.menus[i].baseLayer, this.borderColor);
  826.     if (this.menus[i].items.length > 1) {
  827.       this.menus[i].hdrDmmyLayer.menuLayer = this.menus[i].baseLayer;
  828.       if (isMinNS4)
  829.         this.menus[i].hdrDmmyLayer.document.menuLayer = this.menus[i].baseLayer;
  830.     }
  831.     else {
  832.       this.menus[i].hdrDmmyLayer.menuLayer = null;
  833.       if (isMinNS4)
  834.         this.menus[i].hdrDmmyLayer.document.menuLayer = this.menus[i].baseLayer;
  835.     }
  836.     // Position and initialize each item in the menu.
  837.     x = this.border;
  838.     y = this.border;
  839.     width = this.menus[i].width - 2 * this.border;
  840.     for (j = 1; j < this.menus[i].items.length; j++) {
  841.       this.menus[i].items[j].normLayer = getLayer('navBar' + this.index + '_menu' + i + '_norm' + j);
  842.       this.menus[i].items[j].highLayer = getLayer('navBar' + this.index + '_menu' + i + '_high' + j);
  843.       this.menus[i].items[j].dmmyLayer = getLayer('navBar' + this.index + '_menu' + i + '_dmmy' + j);
  844.       height = getHeight(this.menus[i].items[j].normLayer);
  845.       moveLayerTo(this.menus[i].items[j].normLayer, x, y);
  846.       setBgColor(this.menus[i].items[j].normLayer, this.itmBgColor);
  847.       clipLayer(this.menus[i].items[j].normLayer, 0, 0, width, height);
  848.       inheritLayer(this.menus[i].items[j].normLayer);
  849.       moveLayerTo(this.menus[i].items[j].highLayer, x, y);
  850.       setBgColor(this.menus[i].items[j].highLayer, this.itmHiBgColor);
  851.       clipLayer(this.menus[i].items[j].highLayer, 0, 0, width, height);
  852.       hideLayer(this.menus[i].items[j].highLayer);
  853.       // Set up event handling for each item.
  854.       moveLayerTo(this.menus[i].items[j].dmmyLayer, x, y);
  855.       if (isMinIE4)
  856.         navBarIEResizeLayer(this.menus[i].items[j].dmmyLayer, width, height);
  857.       clipLayer(this.menus[i].items[j].dmmyLayer, 0, 0, width, height);
  858.       inheritLayer(this.menus[i].items[j].dmmyLayer);
  859.       this.menus[i].items[j].dmmyLayer.highLayer = this.menus[i].items[j].highLayer;
  860.       this.menus[i].items[j].dmmyLayer.onmouseover = navBarItemOn;
  861.       this.menus[i].items[j].dmmyLayer.onmouseout = navBarItemOff;
  862.       if (isMinNS4) {
  863.         this.menus[i].items[j].dmmyLayer.document.highLayer = this.menus[i].items[j].highLayer;
  864.         this.menus[i].items[j].dmmyLayer.document.parentHighLayer = this.menus[i].hdrHighLayer;
  865.         this.menus[i].items[j].dmmyLayer.document.menuLayer = this.menus[i].baseLayer;
  866.         this.menus[i].items[j].dmmyLayer.document.link = this.menus[i].items[j].link;
  867.         this.menus[i].items[j].dmmyLayer.document.captureEvents(Event.MOUSEUP);
  868.         this.menus[i].items[j].dmmyLayer.document.onmouseup = navBarItemClick;
  869.       }
  870.       if (isMinIE4) {
  871.         this.menus[i].items[j].dmmyLayer.highLayer = this.menus[i].items[j].highLayer;
  872.         this.menus[i].items[j].dmmyLayer.parentHighLayer = this.menus[i].hdrHighLayer;
  873.         this.menus[i].items[j].dmmyLayer.menuLayer = this.menus[i].baseLayer;
  874.         this.menus[i].items[j].dmmyLayer.link = this.menus[i].items[j].link;
  875.         this.menus[i].items[j].dmmyLayer.onclick = navBarItemClick;
  876.       }
  877.       y += height + this.separator;
  878.     }
  879.     width = this.menus[i].width;
  880.     height = y - this.separator + this.border;
  881.     this.menus[i].baseLayer.width = this.menus[i].width;
  882.     this.menus[i].baseLayer.height = height;
  883.     if (isMinIE4)
  884.       navBarIEResizeLayer(this.menus[i].baseLayer, width, height);
  885.     clipLayer(this.menus[i].baseLayer, 0, 0, width, height);
  886.     // Set up event handling for the menu.
  887.     this.menus[i].baseLayer.parentHighLayer = this.menus[i].hdrHighLayer;
  888.     this.menus[i].baseLayer.onmouseout = navBarMenuOff;
  889.   }
  890.   this.created = true;
  891.   this.resize(this.width);
  892.   showLayer(this.baseLayer);
  893. }
  894. function navBarHide() {
  895.   if (this.created)
  896.     hideLayer(this.baseLayer);
  897. }
  898. function navBarShow() {
  899.   if (this.created)
  900.     showLayer(this.baseLayer);
  901. }
  902. function navBarMoveTo(x, y) {
  903.   this.x = x;
  904.   this.y = y;
  905.   if (this.created)
  906.     moveLayerTo(this.baseLayer, this.x, this.y);
  907. }
  908. function navBarMoveBy(dx, dy) {
  909.   this.x += dx;
  910.   this.y += dy;
  911.   if (this.created)
  912.     moveLayerTo(this.baseLayer, this.x, this.y);
  913. }
  914. function navBarGetzIndex() {
  915.   if (this.created)
  916.     return getzIndex(this.baseLayer);
  917.   return 0;
  918. }
  919. function navBarSetzIndex(z) {
  920.   var i;
  921.   if (this.created) {
  922.     setzIndex(this.baseLayer, z);
  923.     for (i = 0; i < this.menus.length; i++)
  924.       setzIndex(this.menus[i].baseLayer, z);
  925.   }
  926. }
  927. function navBarGetWidth() {
  928.   return this.width;
  929. }
  930. function navBarGetMinWidth() {
  931.   return this.minWidth;
  932. }
  933. function navBarGetAlign() {
  934.   return this.align;
  935. }
  936. function navBarSetAlign(align) {
  937.   this.align = align;
  938.   if (this.created)
  939.     this.resize(this.width);
  940. }
  941. function navBarResize(width) {
  942.   if (this.created) {
  943.     this.width = Math.max(width, this.minWidth);
  944.     if (isMinIE4) {
  945.       navBarIEResizeLayer(this.fillerLayer, this.width - 2 * this.border, this.height - 2 * this.border);
  946.       navBarIEResizeLayer(this.baseLayer, this.width, this.height);
  947.     }
  948.     clipLayer(this.fillerLayer, 0, 0, this.width - 2 * this.border, this.height - 2 * this.border);
  949.     clipLayer(this.baseLayer, 0, 0, this.width, this.height);
  950.     if (this.align == "left")
  951.       this.hdrsOffsetX = 0;
  952.     else if (this.align == "center")
  953.       this.hdrsOffsetX = Math.round((this.width - this.minWidth) / 2);
  954.     else if (this.align == "right")
  955.       this.hdrsOffsetX = this.width - this.minWidth;
  956.     else
  957.       this.hdrsOffsetX = Math.min(parseInt(this.align, 10), this.width - this.minWidth);
  958.     moveLayerTo(this.hdrsBaseLayer, this.hdrsOffsetX, 0);
  959.     for (i = 0; i < this.menus.length; i++) {
  960.       this.menus[i].hdrDmmyLayer.offsetX = this.menus[i].hdrLeft - this.border;
  961.       if (this.hdrsOffsetX + this.menus[i].hdrDmmyLayer.offsetX + this.menus[i].width > this.width)
  962.         this.menus[i].hdrDmmyLayer.offsetX = this.menus[i].hdrRight - this.menus[i].width;
  963.     }
  964.   }
  965.   else
  966.     this.width = width;
  967. }
  968. function navBarInvert() {
  969.   this.inverted = !this.inverted;
  970. }
  971. function navBarIsInverted() {
  972.   return this.inverted;
  973. }
  974. //*****************************************************************************
  975. // Layer resize function for IE.
  976. //*****************************************************************************
  977. function navBarIEResizeLayer(layer, width, height) {
  978.   layer.style.pixelWidth = width;
  979.   layer.style.pixelHeight = height;
  980. }
  981. //*****************************************************************************
  982. // Event handlers for the navigation bar.
  983. //*****************************************************************************
  984. function navBarHeaderOn(e) {
  985.   var bar;
  986.   var x, y;
  987.   bar = navBars[this.index];
  988.   // Position drop down menu.
  989.   if (this.menuLayer != null) {
  990.     x = bar.x + bar.hdrsOffsetX + this.offsetX;
  991.     y = bar.y + this.offsetY;
  992.     if (bar.inverted)
  993.       y = bar.y - this.menuLayer.height + bar.border;
  994.     moveLayerTo(this.menuLayer, x, y);
  995.     // Save drop down menu position and show it. Need to fudge values for IE
  996.     // for reasons unknown.
  997.     this.menuLayer.left = x;
  998.     this.menuLayer.top = y;
  999.     this.menuLayer.right = this.menuLayer.left + this.menuLayer.width;
  1000.     this.menuLayer.bottom = this.menuLayer.top + this.menuLayer.height;
  1001.     if (isMinIE4) {
  1002.       this.menuLayer.left += 2;
  1003.       this.menuLayer.right -= 2;
  1004.       if (bar.inverted) {
  1005.         this.menuLayer.top += 2;
  1006.         this.menuLayer.bottom += 2;
  1007.       }
  1008.       else {
  1009.         this.menuLayer.top -= 2;
  1010.         this.menuLayer.bottom -= 2;
  1011.       }
  1012.     }
  1013.   }
  1014.   // Hide any currently active header and drop down.
  1015.   if (isMinIE4) {
  1016.     if (bar.activeHeader != null && bar.activeHeader != this) {
  1017.       hideLayer(bar.activeHeader.highLayer);
  1018.       if (bar.activeHeader.menuLayer != null)
  1019.         hideLayer(bar.activeHeader.menuLayer);
  1020.     }
  1021.     bar.activeHeader = this;
  1022.   }
  1023.   // Display the header highlight layer and drop down menu.
  1024.   showLayer(this.highLayer);
  1025.   if (this.menuLayer != null)
  1026.     showLayer(this.menuLayer);
  1027. }
  1028. function navBarHeaderOff(e) {
  1029.   // If over drop down menu, exit. Otherwise hide menu and highlight layers.
  1030.   if (this.menuLayer != null) {
  1031.     if (isMinIE4) {
  1032.       mouseX = window.event.clientX + document.body.scrollLeft;
  1033.       mouseY = window.event.clientY + document.body.scrollTop;
  1034.     }
  1035.     if (mouseX >= this.menuLayer.left  &&
  1036.         mouseX <= this.menuLayer.right &&
  1037.         mouseY >= this.menuLayer.top   &&
  1038.         mouseY <= this.menuLayer.bottom)
  1039.       return;
  1040.     hideLayer(this.menuLayer);
  1041.   }
  1042.   hideLayer(this.highLayer);
  1043. }
  1044. function navBarMenuOff(e) {
  1045.   // If over drop down menu, exit. Otherwise hide menu and header highlight
  1046.   // layers.
  1047.   if (isMinIE4) {
  1048.     mouseX = window.event.clientX + document.body.scrollLeft;
  1049.     mouseY = window.event.clientY + document.body.scrollTop;
  1050.     if (mouseX >= this.left  &&
  1051.         mouseX <= this.right &&
  1052.         mouseY >= this.top   &&
  1053.         mouseY <= this.bottom)
  1054.       return;
  1055.   }
  1056.   // Otherwise, hide menu and header highlight layers.
  1057.   hideLayer(this);
  1058.   hideLayer(this.parentHighLayer);
  1059. }
  1060. function navBarItemOn() {
  1061.   showLayer(this.highLayer);
  1062. }
  1063. function navBarItemOff() {
  1064.   hideLayer(this.highLayer);
  1065. }
  1066. function navBarItemClick(e) {
  1067.   // If there is no link, exit.
  1068.   if (this.link == "")
  1069.     return true;
  1070.   // Hide the drop down menu and highlight layer.
  1071.   if (this.menuLayer != null) {
  1072.     hideLayer(this.menuLayer);
  1073.   }
  1074.   if (this.parentHighLayer != null) {
  1075.     hideLayer(this.parentHighLayer);
  1076.   }
  1077.   hideLayer(this.highLayer);
  1078.   // If the link starts with "javascript:" execute the code. Otherwise just
  1079.   // link to the URL.
  1080.   if (this.link.indexOf("javascript:") == 0)
  1081.     eval(this.link);
  1082.   else
  1083.     window.location.href = this.link;
  1084.   return true;
  1085. }
  1086. //*****************************************************************************
  1087. // Code for tracking the mouse position.
  1088. //*****************************************************************************
  1089. // These variables will hold the current mouse pointer position.
  1090. var mouseX = 0;
  1091. var mouseY = 0;
  1092. // Set up event capturing.
  1093. if (isMinNS4)
  1094.   document.captureEvents(Event.MOUSEMOVE);
  1095. document.onmousemove = navBarGetMousePosition;
  1096. function navBarGetMousePosition(e) {
  1097.   // Save mouse pointer position.
  1098.   if (isMinNS4) {
  1099.     mouseX = e.pageX;
  1100.     mouseY = e.pageY;
  1101.   }
  1102.   if (isMinIE4) {
  1103.     mouseX = window.event.clientX + document.body.scrollLeft;
  1104.     mouseY = window.event.clientY + document.body.scrollTop;
  1105.   }
  1106. }
  1107. //*****************************************************************************
  1108. // Code to handle a window resize.
  1109. //*****************************************************************************
  1110. // These variables are used to determine if a resize event is a true one in
  1111. // older releases of NS4.
  1112. var origWidth;
  1113. var origHeight;
  1114. // Reload page in case of a browser resize.
  1115. if (isMinNS4) {
  1116.   origWidth  = window.innerWidth;
  1117.   origHeight = window.innerHeight;
  1118. }
  1119. window.onresize = navBarReload;
  1120. function navBarReload() {
  1121.   if (isMinNS4 && origWidth == window.innerWidth && origHeight == window.innerHeight)
  1122.     return;
  1123.   // For IE, reload on a timer in case the Windows 'Show window contents while
  1124.   // dragging' display option is on.
  1125.   if (isMinIE4)
  1126.     setTimeout('window.location.href = window.location.href', 2000);
  1127.   else
  1128.     window.location.href = window.location.href;
  1129. }
  1130.  
  1131.  
  1132.  
  1133.