home *** CD-ROM | disk | FTP | other *** search
/ PC for Alla 2003 May / PFA0503.iso / fullversioner / webmenubuilder / WebMenuBuilderfull / WebMenuBuilder.exe / %MAINDIR% / samples / s4 / wmb_menu.js < prev    next >
Encoding:
Text File  |  2001-03-20  |  58.4 KB  |  1,494 lines

  1.  
  2. WmbConst = {
  3.    
  4.    // menu types
  5.    T_HOR : 1,
  6.    T_VER : 2,
  7.  
  8.    // menu item open events 
  9.    E_OVER : 'onmouseover',
  10.    E_CLICK : 'onclick',
  11.  
  12.    // cursor types
  13.    C_HAND : 'hand',
  14.    C_ARROW : 'arrow',
  15.    C_MOVE : 'move',
  16.    C_TEXT : 'text',
  17.    C_HOURGLASS : 'hourglass',
  18.    C_HELP : 'help',
  19.    C_NRESIZE : 'n-resize',
  20.    C_SRESIZE : 's-resize',
  21.    C_ERESIZE : 'e-resize',
  22.    C_WRESIZE : 'w-resize',
  23.    C_NERESIZE : 'ne-resize',
  24.    C_NWRESIZE : 'nw-resize',
  25.    C_SERESIZE : 'se-resize',
  26.    C_SWRESIZE : 'sw-resize',
  27.  
  28.    // placement
  29.    P_LEFT : 1,
  30.    P_RIGHT : 2, 
  31.    P_TOP : 3,
  32.    P_BOTTOM: 4,
  33.  
  34.    // alignment (hor & ver)
  35.    A_LEFT : 'left',
  36.    A_RIGHT : 'right',
  37.    A_CENTER : 'center',
  38.    A_TOP : 'top',
  39.    A_BOTTOM : 'bottom',
  40.  
  41.  
  42.    // submenu opening effects
  43.    EF_NORMAL : 1,
  44.    EF_SMOOTHHOR : 2,
  45.    EF_SMOOTHVER :  3,
  46.    EF_SMOOTHDIAG : 4,
  47.  
  48.    stub : 'end' // end stub.. ignore
  49. }
  50.  
  51.  
  52. var wmbBrowser = new WmbBrowser();
  53. var wmbLayers = [];
  54. var wmbSubLayers = [];
  55. var wmbMDStack = new WmbStack(); // to keep proper mousedown event handling
  56. var wmbMMStack = new WmbStack(); // to keep proper mousemove event handling
  57.  
  58.  
  59. function wmbMakeMenu(id, type, x, y, isMoveable, bgimg, bgcolor, border, borderColor, borderLightColor, borderDarkColor) {
  60.    var a = arguments;
  61.    var i = 0;
  62.    var m = new Menu(id, type, x, y);
  63.    _wmbsetval(m, "isMoveable", isMoveable);
  64.    _wmbsetval(m, "bgimg", bgimg);
  65.    m.bgcolor = bgcolor;
  66.    m.border = border;
  67.    _wmbsetval(m, "borderColor", borderColor);
  68.    _wmbsetval(m, "borderLightColor", borderLightColor);
  69.    _wmbsetval(m, "borderDarkColor", borderDarkColor);
  70.    
  71.  
  72.    return m;
  73. }
  74. function Menu(id, type, x, y) {
  75.     this.id = id || 'submenu' + Menu.idcount++;
  76.     this.type = type;// || WmbConst.T_HOR; 
  77.    this.x = x;
  78.    this.y = y;
  79.     this.items = [];
  80.    this.ancestor = this;
  81.  
  82.    // keep in master lists
  83.    Menu.menus[Menu.menus.length]=this;
  84.    Menu.menusbyid[this.id]=this;
  85.  
  86.    // set these individually if you want them to be different
  87.    this.isMoveable = false;
  88.    this.bgimg = null;
  89.    this.bgcolor = '#cccccc';
  90.     this.border = 2;
  91.    this.borderColor=null;
  92.     this.borderLightColor = '#eeeeee';     
  93.     this.borderDarkColor = '#aaaaaa';
  94.  
  95.    // not supported
  96.     this.roimg = null;
  97. }
  98. Menu.voidgif="void.gif";
  99. Menu.menus=[] //all menus 
  100. Menu.menusbyid=[] //a hash to all menus
  101. Menu.idcount=0 // for anonymous submenus
  102. Menu.oldonload=document.onload // keep for safekeeping
  103. Menu.shortonload=false // short circuit onload
  104. Menu.onload=function() {
  105.    // make sure this runs only once
  106.    if (Menu.shortonload) return;
  107.    Menu.shortonload = true;
  108.  
  109.    for (i = 0; i < Menu.menus.length; i++) {
  110.            menu = Menu.menus[i];
  111.            // if it is an ancestor write it
  112.            if (menu.ancestor == menu) menu.write();
  113.    }
  114.    if (wmbBrowser.is_nav) {
  115.            document.captureEvents(Event.CLICK);
  116.            document.captureEvents(Event.MOUSEDOWN);
  117.    }
  118.    // for some reason all browser will require two clicks unless mousedown
  119.    // is bound as well
  120.    if (document.onmousedown) {
  121.            wmbMDStack.push(document.onmousedown);
  122.    }
  123.    document.onmousedown=_wmbclosemenus;
  124.    document.onclick=_wmbclosemenus;
  125.  
  126.    // call old onload if there was one
  127.    if (Menu.oldonload && Menu.oldonload != Menu.onload) {
  128.            Menu.oldonload();
  129.    }
  130. }
  131. Menu.prototype.addChild=function(menuItem) { 
  132.    this.items[this.items.length]=menuItem; 
  133.    this.menuitemsbyid[menuItem.id] = menuItem;
  134.    menuItem.parent = this;
  135.    if (menuItem.submenu) menuItem.submenu.ancestor = this.ancestor;
  136. }
  137. Menu.prototype.menuitemsbyid=[] // a hash to all menuitems
  138. Menu.prototype.getChild=function(itemid) {
  139.    return this.menuitemsbyid[itemid];
  140. }
  141. Menu.prototype.render=function(type) {
  142.  
  143.    // debug check
  144.    if (type && type != "") {} else alert("Invalid type in Menu.render()");
  145.  
  146.    // adjust menu type to reasonable default
  147.    if (this.type != WmbConst.T_VER) this.type = WmbConst.T_HOR;
  148.  
  149.    // netscape border
  150.    var border = this.border || 0;
  151.    if (--border < 1) border++;
  152.    var debug=0;
  153.    var nsborder ='';
  154.    if (wmbBrowser.is_nav4 && this.border > 0) {
  155.            nsborder= '<tr bgcolor='+this.borderLightColor+'><td rowspan=2><table cellspacing=0 cellpadding='+border+' border='+debug+'><tr><td></td></tr></table></td><td colspan=2><table width=100% cellspacing=0 cellpadding='+border+' border='+debug+'><tr><td></td></tr></table></td></tr>';
  156.    }
  157.  
  158.    // the basic outer wrapper
  159.    var html = 
  160.                    '<table cellspacing=0 cellpadding=0 ' + 
  161.                            all_noth('bgcolor="', this.bgcolor, '" ')  + 
  162.                            (wmbBrowser.is_nav4?'border=0':all_noth('border=', this.border, ' ')) + 
  163.                            all_noth('borderColor="', this.borderColor, '" ') +
  164.                            all_noth('borderColorLight="', this.borderLightColor, '" ') +
  165.                            all_noth('borderColorDark="', this.borderDarkColor, '" ') +
  166.                            ((0==this.border)?' frame=void ': '') +
  167.                            ' rules=none class=wmbouter>' +
  168.  
  169.                            nsborder +
  170.                            '<tr><td><table cellspacing=0 cellpadding=0 border=0 class=tbl' + type + 
  171.                            ' ' + all_noth('background="',this.bgimg,'" ') +
  172.                            '><tr valign=center>';
  173.                    
  174.  
  175.    // Go to next line if vertical menu
  176.    var vopen=' '; var vclose= ' ';
  177.    if (this.type == WmbConst.T_VER) {
  178.            vclose = '</tr>';
  179.            vopen = '<tr valign=bottom>';
  180.    }
  181.  
  182.    // Render all items
  183.    var prefix = ""; // don't start new row on vertical if not necessary
  184.    for (var i = 0; i < this.items.length; i++) {
  185.            // leave the last row open on vertical menus
  186.            var suffix=(i + 1 < this.items.length) ? vclose : "";
  187.  
  188.            html += prefix + this.items[i].render() + suffix;
  189.            prefix = vopen; // after the first start opening new lines
  190.    }
  191.    
  192.    nsborder = '';
  193.    if (wmbBrowser.is_nav4 && this.border > 0) {
  194.            nsborder= '<td bgcolor='+this.borderDarkColor+' rowspan=3><table cellspacing=0 cellpadding='+border+' border='+debug+'><tr><td></td></tr></table></td></tr><tr><td colspan=2 bgcolor='+this.borderDarkColor+'><table width=100% cellspacing=0 cellpadding='+border+' border='+debug+'><tr><td></td></tr></table></td>';
  195.    }
  196.  
  197.    // close the tables
  198.    return html + '</tr></table></td>'+nsborder+'</tr></table>';
  199.    
  200. }
  201. Menu.prototype.write=function() {
  202.  
  203.    text = this.render('wmbmenubar');
  204.    if (wmbBrowser.is_ie4up)
  205.     {
  206.         document.all[this.id].innerHTML = text;
  207.    
  208.            // remember this baby
  209.            wmbLayers[this.id] = document.all[this.id];
  210.  
  211.     } else if (wmbBrowser.is_nav4 ) {
  212.         var lyr;
  213.            //alert(this.id + " " + this.ancestor.id);
  214.            lyr = document.layers[this.id].document;
  215.  
  216.            // remember this baby
  217.            wmbLayers[this.id] = document.layers[this.id];
  218.  
  219.         lyr.open();
  220.         lyr.write( text );
  221.         lyr.close();
  222.  
  223.     } else {
  224.  
  225.         document.getElementById(this.id).innerHTML = text;
  226.  
  227.            // remember this baby
  228.            //
  229.            wmbLayers[this.id] = document.getElementById(this.id);
  230.  
  231.    }
  232.  
  233.    // remember to use later
  234.    wmbLayers[this.id].items = this.items;
  235.  
  236.    // if we have a pin, then move the menu there
  237.    if (this.idpin) {
  238.            this.moveMenu(wmb_get_xpos(this.idpin), wmb_get_ypos(this.idpin));
  239.  
  240.    // move to my default position
  241.    } else if (!isNaN(this.x) && !isNaN(this.y) && 'null' != ''+this.x && 'null' != ''+this.y) {
  242.            this.moveMenu(this.x,this.y);
  243.    } 
  244.  
  245. }
  246. Menu.prototype.createLayer=function(layerID, text) {
  247.  
  248.    // All layers will be top-level for simpler repositioning
  249.    if (wmbBrowser.is_ie4up)
  250.     {
  251.            //alert(layerID + " " + this.ancestor + " " + text);
  252.         document.all[this.ancestor.id].insertAdjacentHTML("AfterEnd", 
  253.                    '<div id="' + layerID + '" class=wmbsubmenu>' +
  254.                    text +
  255.                    '</div>'
  256.            );
  257.  
  258.            // hide this layer
  259.            document.all[layerID].style.visibility = "hidden";
  260.  
  261.            // keep a ref for later
  262.            wmbLayers[layerID] = document.all[layerID];
  263.  
  264.     } else if (wmbBrowser.is_nav4){
  265.       
  266.            
  267.            var thisLayer = new Layer(1);
  268.         thisLayer.document.open();
  269.            
  270.        thisLayer.document.writeln(text);
  271.         thisLayer.document.close();
  272.  
  273.            // hide layer
  274.            thisLayer.visibility = "hidden";
  275.  
  276.            // keep a ref for later
  277.            wmbLayers[layerID] = thisLayer;
  278.     
  279.    } else {
  280.  
  281.            var newObj = document.createElement("div");
  282.            newObj.style.position="absolute";
  283.            newObj.setAttribute("id", layerID);
  284.            newObj.setAttribute("class", "wmbsubmenu");
  285.         document.documentElement.appendChild(newObj);
  286.            
  287.            var rng = newObj.ownerDocument.createRange();
  288.            rng.selectNodeContents(newObj);
  289.            rng.collapse(true);
  290.            
  291.            var frag = rng.createContextualFragment(text);
  292.            newObj.appendChild(frag);
  293.  
  294.            // hide this layer
  295.            newObj.style.visibility = "hidden";
  296.  
  297.            // keep a ref for later
  298.            wmbLayers[layerID] = newObj;
  299.  
  300.    } 
  301.    wmbSubLayers[wmbSubLayers.length] = layerID;
  302. }
  303. Menu.prototype.moveMenu=function(x,y) {
  304.  
  305.    if (wmbBrowser.is_nav4) {
  306.            eval("document." + this.id + ".moveTo(x,y)");
  307.    } else if (wmbBrowser.is_ie4up) {
  308.            document.all[this.id].style.pixelLeft = x;
  309.            document.all[this.id].style.pixelTop = y;
  310.    } else {
  311.            document.getElementById(this.id).style.left = '' + x + 'px';
  312.            document.getElementById(this.id).style.top =  '' + y + 'px';
  313.    }
  314.    this.x = x;
  315.    this.y = y;
  316. }
  317. Menu.prototype.setPin=function(pinname) {
  318.    this.idpin = pinname;
  319. }
  320.  
  321.  
  322. function wmbMakeMenuItem(title, description, link, target,
  323.            titleAlign, font, fontSize, isBold, isItalic, isUnderlined, color, rofont, 
  324.            rofontSize, roisBold, roisItalic, roisUnderlined, rocolor, icon, roicon, iconAlign, 
  325.            iconPlacement, bgcolor, robgcolor, cursor, paddingLeft, paddingRight, paddingBottom, paddingTop
  326. ) {
  327.  
  328.    var m = new MenuItem(title, description, link, target);
  329.    _wmbMakeBaseItem(m, 
  330.            titleAlign, font, fontSize, isBold, isItalic, isUnderlined, color, rofont, 
  331.            rofontSize, roisBold, roisItalic, roisUnderlined, rocolor, icon, roicon, iconAlign, 
  332.            iconPlacement, bgcolor, robgcolor, cursor, paddingLeft, paddingRight, paddingBottom, paddingTop
  333.    );
  334.  
  335.    return m;
  336. }
  337. function _wmbMakeBaseItem(m,
  338.            titleAlign, font, fontSize, isBold, isItalic, isUnderlined, color, rofont, 
  339.            rofontSize, roisBold, roisItalic, roisUnderlined, rocolor, icon, roicon, iconAlign, 
  340.            iconPlacement, bgcolor, robgcolor, cursor, paddingLeft, paddingRight, paddingBottom, paddingTop
  341. ) {
  342.  
  343.    _wmbsetval(m, "titleAlign", titleAlign);
  344.    _wmbsetval(m, "font", font);
  345.    _wmbsetval(m, "fontSize", fontSize);
  346.    _wmbsetval(m, "isBold", isBold);
  347.    _wmbsetval(m, "isItalic", isItalic);
  348.    _wmbsetval(m, "isUnderlined", isUnderlined);
  349.    _wmbsetval(m, "color", color);
  350.    _wmbsetval(m, "rofont", rofont);
  351.    _wmbsetval(m, "rofontSize", rofontSize);
  352.    _wmbsetval(m, "roisBold", roisBold);
  353.    _wmbsetval(m, "roisItalic", roisItalic);
  354.    _wmbsetval(m, "roisUnderlined", roisUnderlined);
  355.    _wmbsetval(m, "rocolor", rocolor);
  356.    _wmbsetval(m, "icon", icon);
  357.    _wmbsetval(m, "roicon", roicon);
  358.    _wmbsetval(m, "iconAlign", iconAlign);
  359.    _wmbsetval(m, "iconPlacement", iconPlacement);
  360.    _wmbsetval(m, "bgcolor", bgcolor);
  361.    _wmbsetval(m, "robgcolor", robgcolor);
  362.    _wmbsetval(m, "cursor", cursor);
  363.    _wmbsetval(m, "paddingLeft", paddingLeft);
  364.    _wmbsetval(m, "paddingRight", paddingRight);
  365.    _wmbsetval(m, "paddingBottom", paddingBottom);
  366.    _wmbsetval(m, "paddingTop", paddingTop);
  367.  
  368.    return m;
  369. }
  370.  
  371. function MenuItem(title, description, link, target)
  372. {
  373.    this.id = 'menuitem' + MenuItem.idcount++;
  374.    this.title = title;
  375.    this.description = description;
  376.    this.link = link;
  377.    this.target = target;
  378.    this.parent = null; // set when added to menu
  379.  
  380.    // set these individually if you want them to be different
  381.    this.titleAlign = WmbConst.A_LEFT;
  382.    this.font = null;
  383.    this.fontSize = null;
  384.    this.isBold = null;
  385.    this.isItalic = null;
  386.    this.isUnderlined = null;
  387.    this.color = null;
  388.    this.rofont = null;
  389.    this.rofontSize = null;
  390.    this.roisBold = null;
  391.    this.roisItalic = null;
  392.    this.roisUnderlined = null;
  393.    this.rocolor = null;
  394.    this.icon = null;
  395.    this.roicon = null;
  396.    this.iconAlign = WmbConst.A_CENTER;
  397.    this.iconPlacement = WmbConst.P_LEFT;
  398.    this.bgcolor = null;
  399.    this.robgcolor = null;
  400.    this.cursor = WmbConst.C_HAND;
  401.    this.paddingLeft = 5;
  402.    this.paddingRight = 5;
  403.    this.paddingBottom = 2;
  404.    this.paddingTop = 2;
  405. }
  406. MenuItem.idcount = 0 // to generate ids
  407. MenuItem.prototype.addSubMenu=function(submenu, suboptions) { 
  408.    this.submenu = submenu || new Menu(); 
  409.    this.suboptions = suboptions || new WmbSubOptions();
  410.    this.submenu.parent = this;
  411.    // adjust menu type to reasonable default
  412.    if (this.submenu.type != WmbConst.T_HOR) this.submenu.type =  WmbConst.T_VER;
  413.    if (this.parent) 
  414.            this.submenu.ancestor = this.parent.ancestor;
  415. }
  416. MenuItem.prototype.bindEvent=function(event, handler) {
  417. }
  418. MenuItem.tableidcount=0
  419. MenuItem.prototype.render=function() {
  420.  
  421.    
  422.    //////////////////////////////////////////////////
  423.    // calculate the submenu handler code (if any)
  424.    var submenuhandler = '';
  425.    var hoverhandler='wmbrolleffects(\'' + this.parent.id + '\', \'' + this.id + '\', true);'; 
  426.    var outhandler='wmbrolleffects(\'' + this.parent.id + '\', \'' + this.id + '\', false);';
  427.    var clickhandler='';
  428.    if (this.submenu) {
  429.            // call wmbopensubmenu(parentmenu, submenu, marker, ishorizontal)
  430.            submenuhandler ='wmbopensubmenu(\'' + 
  431.                            this.parent.id  +'\',\''+ this.submenu.id +'\',\''+ 'mark' + this.submenu.id +'\', ' + 
  432.                                    ((this.parent.type != WmbConst.T_VER)?'true':'false') + ', \'' + this.id +
  433.                            '\', event);';
  434.            // if submenus should open on hover.. use this
  435.            if (this.suboptions.openevent == WmbConst.E_OVER) {
  436.                    hoverhandler += submenuhandler;
  437.            } else {
  438.                    clickhandler += submenuhandler;
  439.            }
  440.            
  441.    } else {
  442.            hoverhandler += 'wmbclosemenus(\'' + this.parent.id +'\')';
  443.    }
  444.  
  445.    //////////////////////////////////////////////////
  446.    // implement padding 
  447.    //
  448.    var pad = this.computePadding(this.paddingLeft, this.paddingTop, this.paddingRight, this.paddingBottom);
  449.    var style = this.computeStyle();
  450.    //////////////////////////////////////////////////
  451.    // menu item header
  452.    
  453.    var tableid = 'tableid'+MenuItem.tableidcount++;
  454.    var html = 
  455.            '<table id=\'' + tableid + '\'' + all_noth(' bgcolor=\'', this.bgcolor, '\' ') +
  456.            ' onmouseover="wmbsetbg(\'' + tableid + '\'' + all_noth(',\'',this.robgcolor,'\'')+');' + 
  457.            hoverhandler +
  458.            '" onmouseout="wmbsetbg(\'' + tableid + '\'' + all_noth(',\'',this.bgcolor,'\'')+
  459.            ');' +
  460.            outhandler +
  461.            '" onclick="' + 
  462.            clickhandler +
  463.            '" onmousedown="wmbStopBubbling=true" cellspacing=0 cellpadding=0 border=0 width=100% height=100%><tr>';     
  464.  
  465.    //////////////////////////////////////////////////
  466.    // if there's a submenu, create a marker for it
  467.    var submenuStr = "";
  468.    //this.submenu.type = WmbConst.T_VER; // make submenu vertical
  469.  
  470.    // if there's a submenuimg use it
  471.    var submenuimg='';//'<img height=2 width=10 src="'+Menu.voidgif+'" border=0>';
  472.    if (this.suboptions && this.suboptions.submenuimg) {
  473.            submenuimg = '<img src="' + this.suboptions.submenuimg + '" border=0>';
  474.    } else if (wmbBrowser.is_nav4) {
  475.            // bug workaround: if there's nothing here the system won't work
  476.            submenuimg= '<table cellspacing=0 cellpadding=0><tr><td></td></tr></table>';
  477.    }
  478.  
  479.    // a submenu.. the marker will help us position the menu later
  480.    var submenuid = this.submenu?' id="mark'+this.submenu.id+'"':'';
  481.    var valign='top';//'center';
  482.    var align = 'right';
  483.    if (this.suboptions && this.suboptions.placement == WmbConst.P_BOTTOM) align='left';
  484.    var tmarker = '<tr height=0%><td><span ' + submenuid + ' class=wmbmarker></span></td></tr>';
  485.    var bmarker = '';
  486.  
  487.    if (this.parent.type == WmbConst.T_HOR || (this.suboptions && this.suboptions.placement == WmbConst.P_BOTTOM)) {
  488.            valign="bottom";
  489.            bmarker = tmarker;
  490.            tmarker = '';
  491.    }
  492.    if (this.parent.type == WmbConst.T_HOR) align="left";
  493.    submenuStr =  '<td valign=' + valign +' align='+align+' width="1px">' +
  494.            '<table cellspacing=0 cellpadding=1 border=0 height=100% valign=center>' + 
  495.            tmarker +
  496.            '<tr height=100%><td valign=center>'+ submenuimg+'</td></tr>' +
  497.            bmarker +
  498.            '</table></td>';
  499.  
  500.    if (this.submenu) {
  501.  
  502.            // creates a layer based on the recursive call
  503.            this.parent.createLayer(this.submenu.id, this.submenu.render("wmbsubmenu"));
  504.  
  505.            // make a pointer to subitems that we'll need later
  506.            wmbLayers[this.submenu.id].items = this.submenu.items;
  507.    }
  508.    
  509.    // figure out where we'll need to place the submenu
  510.    var vsubmenu = ''; var hsubmenu = ""; var hsuffix= "";
  511.    if (this.submenu && (this.parent.type == WmbConst.T_HOR || this.suboptions.placement == WmbConst.P_LEFT) && this.suboptions.placement != WmbConst.P_RIGHT) { 
  512.            hsubmenu = submenuStr; 
  513.            hsuffix = '<td></td>';
  514.    } else { 
  515.            vsubmenu = submenuStr; 
  516.    }
  517.  
  518.  
  519.    // continue with the item itself
  520.    html += hsubmenu + '<td '+style+' nowrap align="' + this.titleAlign + '">' +
  521.            pad.beg + 
  522.            '<a class=wmbmenuitem onmousedown="wmbStopBubbling=true" ' + 
  523.                    ' onmouseover="' + hoverhandler + '" ' +
  524.                    ' onmouseout="' + outhandler + '" ' +
  525.                    all_noth(' title="', this.description, '" ');
  526.  
  527.    var href = '';
  528.    if (!wmbBrowser.is_ie4up) {
  529.            href = ' href="javascript:noop();" ';
  530.    }
  531.  
  532.    //////////////////////////////////////////////////
  533.    // link: if there's a submenu we need to catch 
  534.    // events otherwise just a standard link
  535.    if (this.submenu) {
  536.            html += 
  537.  
  538.                    // do nothing on click
  539.                    href +  
  540.  
  541.                    // use the spec'd event to open
  542.                    this.suboptions.openevent +             
  543.            
  544.                    '="' + submenuhandler + '"';
  545.  
  546.    } else {
  547.            html += ((this.link)?'href="'+this.link+'"':href) + 
  548.                    all_noth('target="',this.target, '" ') + 
  549.                    ' onmouseover="' + hoverhandler +'" ';
  550.    }
  551.    
  552.  
  553.    //////////////////////////////////////////////////
  554.    // text attributes
  555.    //
  556.    var title = MenuItem.renderTitle(this);
  557.  
  558.    
  559.    //////////////////////////////////////////////////
  560.    // icon and icon alignment
  561.    //
  562.  
  563.    // def placement: left
  564.    var iconPlacement = this.iconPlacement?this.iconPlacement:WmbConst.P_LEFT;
  565.    var iconStr = 
  566.            all_noth('<IMG BORDER=0 ' + 
  567.            all_noth(' align="',this.iconAlign,'" ') + 
  568.            all_noth(' valign="',this.iconAlign,'" ') + 
  569.            ' NAME="img' + this.id + '" SRC="', this.icon, '">');
  570.  
  571.    // figure out where it needs to go
  572.    var liconStr = iconPlacement == WmbConst.P_LEFT?iconStr:'';
  573.    liconStr = iconPlacement == WmbConst.P_TOP?iconStr+'<br>': liconStr;
  574.    var riconStr = iconPlacement == WmbConst.P_RIGHT?iconStr:'';
  575.    riconStr = iconPlacement == WmbConst.P_BOTTOM?'<br>'+iconStr: riconStr;
  576.  
  577.    //////////////////////////////////////////////////
  578.    // put it all together and send it
  579.    html += '>' + 
  580.            liconStr +
  581.            title + 
  582.            riconStr +
  583.            '</a>' + 
  584.            pad.end + 
  585.            '</td>' + hsuffix +
  586.            all_noth(null, vsubmenu) + 
  587.            '</tr></table>';
  588.    return '<td '+style+'>' + html + '</td>';
  589.  
  590. }
  591. MenuItem.prototype.computePadding=function() {
  592.  
  593.    var result = [];
  594.    result.beg='';
  595.    result.end='';
  596.    if (!wmbBrowser.is_nav4) return result;
  597.  
  598.    var paddingLeft = this.paddingLeft;//-4;
  599.    var paddingRight = this.paddingRight;//-4;
  600.    var paddingTop = this.paddingTop;//-4;
  601.    var paddingBottom = this.paddingBottom;//-4;
  602.  
  603.    paddingLeft = paddingLeft<0?0:paddingLeft;
  604.    paddingRight = paddingRight<0?0:paddingRight;
  605.    paddingTop = paddingTop<0?0:paddingTop;
  606.    paddingBottom = paddingBottom<0?0:paddingBottom;
  607.  
  608.    var isPadded = 
  609.                    paddingLeft || 
  610.                    paddingRight || 
  611.                    paddingTop || 
  612.                    paddingBottom;
  613.    var bpad='';
  614.    var epad='';
  615.    if (isPadded) {
  616.            var debug = 0;
  617.            bpad = '<table cellspacing=0 cellpadding=0 border='+debug+'><tr><td></td>';
  618.            if (paddingTop > 0) {
  619.                    bpad += '<td><table border='+debug+' cellspacing=0 cellpadding='+paddingTop+'><tr><td></td></tr></table></td>';
  620.            } else {
  621.                    bpad += '<td></td>';
  622.            }
  623.            bpad += '<td></td></tr><tr>';
  624.            if (paddingLeft > 0) {
  625.                    bpad += '<td><table border='+debug+' cellspacing=0 cellpadding='+paddingLeft+'><tr><td></td></tr></table></td>';
  626.            } else {
  627.                    bpad += '<td></td>';
  628.            }
  629.            bpad += '<td>';
  630.  
  631.            epad += '</td>';
  632.            if (paddingRight > 0) {
  633.                    epad += '<td><table border='+debug+' cellspacing=0 cellpadding='+paddingRight+'><tr><td></td></tr></table></td>';
  634.            } else {
  635.                    epad += '<td></td>';
  636.            }
  637.            epad += '</tr><tr><td></td>';
  638.            if (paddingBottom > 0) {
  639.                    epad += '<td><table border='+debug+' cellspacing=0 cellpadding='+paddingBottom+'><tr><td></td></tr></table></td>';
  640.            } else {
  641.                    epad += '<td></td>';
  642.            }
  643.            epad += '<td></td></tr></table>';
  644.  
  645.    }
  646.  
  647.    result.beg = bpad; 
  648.    result.end = epad;
  649.    return result;
  650.  
  651. }
  652. MenuItem.prototype.computeStyle=function() {
  653.    var style = '';
  654.    if (!wmbBrowser.is_nav4) {
  655.            style = ' style = "' +
  656.                    all_noth(' padding-top:', this.paddingTop,'px; ') +
  657.                    all_noth(' padding-left:',this.paddingLeft,'px; ') +
  658.                    all_noth(' padding-right:',this.paddingRight,'px; ') +
  659.                    all_noth(' padding-bottom:',this.paddingBottom,'px; ') +
  660.                    all_noth(' cursor:', this.cursor, ';') +
  661.            ' align: middle; " ';
  662.    }
  663.    return style;
  664. }
  665. MenuItem.renderTitle=function(menuItem) {
  666.  
  667.    var title = '';
  668.  
  669.    // netscape needs special handling because CSS doesn't work at
  670.    // this level 
  671.    if (wmbBrowser.is_nav4) {
  672.  
  673.            title ='<font ' + 
  674.                    all_noth(' face="',menuItem.font,'" ') +
  675.                    all_noth('point-size="', (parseInt(menuItem.fontSize) - 2), '" ') + // convert netscape point size to css point size
  676.                    all_noth('color="',menuItem.color,'" ') +
  677.                    '>' +
  678.                    true_noth(menuItem.isBold, '<b>') +
  679.                    true_noth(menuItem.isItalic, '<i>') +
  680.                    true_noth(menuItem.isUnderlined, '<u>') +
  681.                    all_noth(null, menuItem.title) + 
  682.                    true_noth(menuItem.isUnderlined, '</u>') +
  683.                    true_noth(menuItem.isItalic, '</i>') +
  684.                    true_noth(menuItem.isBold, '</b>') +
  685.                    '</font>';
  686.  
  687.    } else {
  688.  
  689.            title ='<span id="' + menuItem.id + '" style="' +
  690.                    all_noth('font-family: ',menuItem.font,'; ') +
  691.                    all_noth('font-size: ',menuItem.fontSize,'; ') +
  692.                    all_noth_conv('font-weight: ', menuItem.isBold,'; ','bold','normal') +
  693.                    all_noth_conv('font-style:  ', menuItem.isItalic,'; ','italic','normal') +
  694.                    all_noth_conv('text-decoration: ', menuItem.isUnderlined,'; ','underline','none') +
  695.                    all_noth('color: ',menuItem.color,'; ') +
  696.                    all_noth('cursor: ', menuItem.cursor,'; ') +
  697.                    '">' + 
  698.                    all_noth(null, menuItem.title) + 
  699.                    '</span>';
  700.    }
  701.    return title;
  702. }
  703.  
  704.  
  705. function wmbMakeDragItem(title, description,
  706.            titleAlign, font, fontSize, isBold, isItalic, isUnderlined, color, rofont, 
  707.            rofontSize, roisBold, roisItalic, roisUnderlined, rocolor, icon, roicon, iconAlign, 
  708.            iconPlacement, bgcolor, robgcolor, cursor, paddingLeft, paddingRight, paddingBottom, paddingTop
  709. ) {
  710.  
  711.    var m = new WmbDragItem(title, description);
  712.    _wmbMakeBaseItem(m, 
  713.            titleAlign, font, fontSize, isBold, isItalic, isUnderlined, color, rofont, 
  714.            rofontSize, roisBold, roisItalic, roisUnderlined, rocolor, icon, roicon, iconAlign, 
  715.            iconPlacement, bgcolor, robgcolor, cursor, paddingLeft, paddingRight, paddingBottom, paddingTop
  716.    );
  717.  
  718.    return m;
  719. }
  720. function WmbDragItem(title, description)
  721. {
  722.    this.id = 'dragitem' + WmbDragItem.idcount++;
  723.    this.title = title;
  724.    this.description = description;
  725.    this.parent = null; // set when added to menu
  726.  
  727.    // set these individually if you want them to be different
  728.    this.titleAlign = WmbConst.A_CENTER;
  729.    this.font = null;
  730.    this.fontSize = null;
  731.    this.isBold = null;
  732.    this.isItalic = null;
  733.    this.isUnderlined = null;
  734.    this.color = null;
  735.    this.rofont = null;
  736.    this.rofontSize = null;
  737.    this.roisBold = null;
  738.    this.roisItalic = null;
  739.    this.roisUnderlined = null;
  740.    this.rocolor = null;
  741.    this.icon = null;
  742.    this.roicon = null;
  743.    this.iconAlign = WmbConst.A_CENTER;
  744.    this.bgcolor = null;
  745.    this.robgcolor = null;
  746.    this.cursor = WmbConst.C_HAND;
  747.    this.paddingLeft = 5;
  748.    this.paddingRight = 5;
  749.    this.paddingBottom = 2;
  750.    this.paddingTop = 2;
  751. }
  752. WmbDragItem.idcount = 0 // to generate ids
  753. WmbDragItem.tableidcount=0
  754. WmbDragItem.prototype.render=function() {
  755.  
  756.    //////////////////////////////////////////////////
  757.    // implement padding 
  758.    //
  759.    var pad = this.computePadding();
  760.    var style = this.computeStyle();
  761.  
  762.  
  763.    //////////////////////////////////////////////////
  764.    // menu item header
  765.    
  766.    var tableid = 'dragtableid'+MenuItem.tableidcount++;
  767.  
  768.    var hoverhandler='wmbrolleffects(\'' + this.parent.id + '\', \'' + this.id + '\', true);'; 
  769.    var outhandler='wmbrolleffects(\'' + this.parent.id + '\', \'' + this.id + '\', false);';
  770.    var html = 
  771.            '<table id=\'' + tableid + '\'' + all_noth(' bgcolor=\'', this.bgcolor, '\' ') +
  772.            ' onmouseover="wmbsetbg(\'' + tableid + '\'' + all_noth(',\'',this.robgcolor,'\'')+');' + 
  773.            hoverhandler +
  774.            '" onmouseout="wmbsetbg(\'' + tableid + '\'' + all_noth(',\'',this.bgcolor,'\'')+
  775.            ');' +
  776.            outhandler +
  777.            '" cellspacing=0 cellpadding=0 border=0 width=100% height=100%><tr>';  
  778.  
  779.    //////////////////////////////////////////////////
  780.    // event handling
  781.    //
  782.  
  783.    // error checks
  784.    if (!this.parent.isMoveable) alert("Error: why have a drag item if you can't move the menu?");
  785.  
  786.    var href = '';
  787.    if (!wmbBrowser.is_ie4up) {
  788.            href = ' href="javascript:noop();" ';
  789.    }
  790.  
  791.    // header for moveable menus
  792.    html += 
  793.            '<td '+style+' nowrap align="' + this.titleAlign + '">' +
  794.            pad.beg +
  795.            '<a class=wmbmenuitem ' + 
  796.            all_noth(' title="', this.description, '" ') +
  797.            href +
  798.            ' onclick="return false;"' +
  799.            ' onmouseover="' + hoverhandler + '" ' +
  800.            ' onmouseout="' + outhandler + '" ' +
  801.            ' onmousedown="wmbfloatmenu(event, \''+ this.parent.id +'\')"';
  802.  
  803.    //////////////////////////////////////////////////
  804.    // text attributes
  805.    //
  806.    var title = MenuItem.renderTitle(this);
  807.  
  808.    //////////////////////////////////////////////////
  809.    // icon and icon alignment
  810.    //
  811.  
  812.    // def placement: left
  813.    var iconPlacement = this.iconPlacement?this.iconPlacement:WmbConst.P_LEFT;
  814.    var iconStr = 
  815.            all_noth('<IMG BORDER=0 ' + 
  816.            all_noth(' align="',this.iconAlign,'" ') + 
  817.            all_noth(' valign="',this.iconAlign,'" ') + 
  818.            ' NAME="img' + this.id + '" SRC="', this.icon, '">');
  819.  
  820.    // figure out where it needs to go
  821.    var liconStr = iconPlacement == WmbConst.P_LEFT?iconStr:'';
  822.    liconStr = iconPlacement == WmbConst.P_TOP?iconStr+'<br>': liconStr;
  823.    var riconStr = iconPlacement == WmbConst.P_RIGHT?iconStr:'';
  824.    riconStr = iconPlacement == WmbConst.P_BOTTOM?'<br>'+iconStr: riconStr;
  825.    
  826.    //////////////////////////////////////////////////
  827.    // put it all together and send it
  828.    html += '>' + 
  829.            liconStr +
  830.            title + 
  831.            riconStr +
  832.            '</a>' +
  833.            pad.end +
  834.            '</td>' +  
  835.            '</tr></table>';
  836.  
  837.  
  838.    return '<td '+style+'>' + html + '</td>';
  839.  
  840. }
  841. WmbDragItem.prototype.computePadding=MenuItem.prototype.computePadding
  842. WmbDragItem.prototype.computeStyle=MenuItem.prototype.computeStyle
  843. function WmbSubOptions(effect, speed, openevent, submenuimg, distX, distY, placement) {
  844.    // override these for different effects
  845.    // supported attributes
  846.    this.effect = effect || WmbConst.EF_NORMAL; 
  847.    this.speed = speed || 20; 
  848.    this.openevent = openevent || WmbConst.E_OVER;
  849.    this.submenuimg = submenuimg || null;
  850.    this.distX = distX || 0; 
  851.    this.distY = distY || 0;
  852.    this.placement = placement || null;
  853.  
  854. }
  855.  
  856. WmbSubOptions.prototype.doClipStep=function(submenuid, top, right, bottom, left) {
  857.    
  858.    // do some validation
  859.    //
  860.    if (this.speed < 1) this.speed = 20;
  861.  
  862.    if (this.effect == WmbConst.EF_SMOOTHHOR) {
  863.  
  864.            if (100 <= right) return null;
  865.  
  866.            top = 0;
  867.            right += this.speed;
  868.            if (right > 100) right = 100;
  869.            bottom = 100;
  870.            left = 0;
  871.  
  872.    } else if (this.effect == WmbConst.EF_SMOOTHVER) {
  873.  
  874.            if (100 <= bottom) return null;
  875.  
  876.            top = 0;
  877.            right = 100;
  878.            bottom += this.speed;
  879.            if (bottom > 100) bottom = 100;
  880.            left = 0;
  881.                    
  882.    } else if (this.effect == WmbConst.EF_SMOOTHDIAG) {
  883.  
  884.            if (100 <= right && 100 <= bottom) return null;
  885.  
  886.            top = 0;
  887.            right += this.speed;
  888.            if (right > 100) right = 100;
  889.            bottom += this.speed;
  890.            if (bottom > 100) bottom = 100;
  891.            left = 0;
  892.    
  893.    } else {
  894.  
  895.            wmbclip(wmbLayers[submenuid], 0, 100, 100, 0);
  896.            return null;
  897.    };
  898.  
  899.    wmbclip(wmbLayers[submenuid], top, right, bottom, left);
  900.    return new WmbRect(top, right, bottom, left);
  901.  
  902. }
  903.  
  904. function WmbSeparator(firstColor, secondColor) {
  905.    this.firstColor = firstColor || '#999999';
  906.    this.secondColor = secondColor || '#cccccc';
  907. }
  908. WmbSeparator.prototype.render=function() {
  909.  
  910.     if (WmbConst.T_HOR != this.parent.type) {
  911.  
  912.            if (wmbBrowser.is_nav5up) {
  913.                    return '<tr><td><div style="position: relative; background-color: '+this.secondColor+'; height: 2px; width: 100%; "><div style="position: relative; background-color: '+this.firstColor+'; height: 1px; width: 100%;"></div></div></td></tr>';
  914.            } else {
  915.                    return '<tr><td><table width=100% height=2 cellpadding=0 cellspacing=0 border=0><tr align=left valign=bottom><td bgcolor=' + this.firstColor + '><img src="'+Menu.voidgif+'" width=1 height=1 border=0></td></tr><tr align=left valign=top><td bgcolor=' + this.secondColor+ '><img src="'+Menu.voidgif+'" width=1 height=1 border=0></td></tr></table></td></tr>';
  916.            }
  917. /*
  918.            if (wmbBrowser.is_nav4) {
  919.                    return '<tr><td><table width=100% height=2 cellpadding=0 cellspacing=0 border=0><tr align=left valign=bottom><td bgcolor=' + this.firstColor + '><img src="'+Menu.voidgif+'" width=1 height=1 border=0></td></tr><tr align=left valign=top><td bgcolor=' + this.secondColor+ '><img src="'+Menu.voidgif+'" width=1 height=1 border=0></td></tr></table></td></tr>';
  920.            } else if (wmbBrowser.is_nav5up) {
  921.                    return '<tr><td><div style="position: relative; background-color: '+this.secondColor+'; height: 2px; width: 100%; "><div style="position: relative; background-color: '+this.firstColor+'; height: 1px; width: 100%;"></div></div></td></tr>';
  922.            } else {
  923.                    return '<tr height=1px><td bgcolor="'+this.firstColor+'"></td></tr><tr height=1px><td bgcolor="'+this.secondColor+'"></td></tr>';
  924.            }
  925. */
  926.    } else {
  927.            if (wmbBrowser.is_nav4) {
  928.                    return '<td height=100% width=1 bgcolor="'+ this.firstColor+'"><table height=100% cellspacing=0 cellpadding=1 border=0><tr><td></td></tr></table></td><td height=100% width=1 bgcolor="'+ this.secondColor+'"><table height=100% cellspacing=0 cellpadding=1 border=0><tr><td></td></tr></table></td>';
  929.            } else if (wmbBrowser.is_nav5up) {
  930.                    return '<td><div style="position: relative; background-color: '+this.secondColor+'; height: 100%; width: 2px; padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 0px;"><div style="position: relative; background-color: '+this.firstColor+'; height: 100%; width: 1px;padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 0px;"><hr height=0 width=0></div></div></td>'
  931.            } else {
  932.                    return '<td><table width=2 height=100% cellpadding=0 cellspacing=0 border=0><tr height=100% align=left><td bgcolor=' + this.firstColor + '><img src="'+Menu.voidgif+'" width=1 height=100% border=0></td><td bgcolor=' + this.secondColor+ '><img src="'+Menu.voidgif+'" width=1 height=100% border=0></td></tr></table></td>';
  933.            }
  934. /*
  935.            if (wmbBrowser.is_nav4) {
  936.                    return '';//return '<td bgcolor="'+ this.firstColor+'" width=1px></td><td bgcolor="'+ this.secondColor+'" width=1px></td>';
  937.            } else if (wmbBrowser.is_nav5up) {
  938.                    return '<td><div style="position: relative; background-color: '+this.secondColor+'; height: 100%; width: 2px; padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 0px;"><div style="position: relative; background-color: '+this.firstColor+'; height: 100%; width: 1px;padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 0px;"><hr height=0 width=0></div></div></td>';
  939.            } else {
  940.                    return '<td><div style="position: relative; background-color: '+this.secondColor+'; height: 100%; width: 2px; "><div style="position: relative; background-color: '+this.firstColor+'; height: 100%; width: 1px;"></div></div></td>';
  941.            }
  942. */
  943.    } 
  944. }
  945.  
  946. function WmbBrowser() {
  947.    var agt=navigator.userAgent.toLowerCase(); 
  948.    this.is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
  949.                                    && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
  950.                                    && (agt.indexOf('webtv')==-1)); 
  951.    var is_major = parseInt(navigator.appVersion); 
  952.     var is_minor = parseFloat(navigator.appVersion);       
  953.    this.is_ie   = (agt.indexOf("msie") != -1);
  954.    this.is_nav4 = (this.is_nav && (is_major == 4)); 
  955.    this.is_nav5up = (this.is_nav && (is_major >= 5)); 
  956.    var is_ie3  = (this.is_ie && (is_major < 4)); 
  957.     var is_ie4  = (this.is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) ); 
  958.    this.is_ie4up  = (this.is_ie  && (is_major >= 4)); 
  959.     this.is_ie5up  = (this.is_ie  && !is_ie3 && !is_ie4); 
  960. }
  961.  
  962. function WmbStack() { this.arr=[]; }
  963. WmbStack.prototype.pt=0
  964. WmbStack.prototype.push=function(value) { this.arr[this.pt++]=value; }
  965. WmbStack.prototype.pop=function(defvalue) { 
  966.    --this.pt; 
  967.    if (this.pt < 0) {
  968.            this.pt=0;
  969.            return defvalue;
  970.    }
  971.    return this.arr[this.pt]; 
  972. }
  973. WmbStack.prototype.size=function() { return this.pt; }
  974.  
  975. function all_noth(pref, value, suff) {
  976.    pref = pref || "";
  977.    suff = suff || "";
  978.    if (value && value != "") {
  979.            return pref + value + suff;
  980.    }
  981.    return "";
  982. }
  983.  
  984. function true_noth(expr, text) {
  985.    return (expr && expr == true)?text:"";
  986. }
  987.  
  988. function all_noth_conv(pref, value, suff, trueVal, falseVal) {
  989.    pref = pref || "";
  990.    suff = suff || "";
  991.    if (value && value != "") {
  992.            return pref + (value?trueVal:falseVal) + suff;
  993.    }
  994.    return "";
  995. }
  996.  
  997. function _wmbsetval(obj, item, value) {
  998.    if ("" != value && null != value) {
  999.            // NN 4.7x bug workaround: nulls are marked as 'undefined'
  1000.            if (!wmbBrowser.is_nav4 || 'undefined' != ''+value) {
  1001.                    obj[item] = value;
  1002.            }
  1003.    }
  1004. }
  1005.  
  1006. function wmb_get_xpos(idobj) {
  1007.    var x = 0;
  1008.    if (wmbBrowser.is_ie4up) {
  1009.            var obj = document.all[idobj];
  1010.            while(obj) {
  1011.                    x += obj.offsetLeft;
  1012.                    obj = obj.offsetParent;
  1013.            }
  1014.    } else if (wmbBrowser.is_nav4) {
  1015.            x = document[idobj].pageX;
  1016.  
  1017.    } else {
  1018.            x = parseInt(document.getElementById(idobj).style.left);
  1019.    }
  1020.    return x;
  1021. }
  1022.  
  1023. function wmb_get_ypos(idobj) {
  1024.    var y = 0;
  1025.    if (wmbBrowser.is_ie4up) {
  1026.            var obj = document.all[idobj];
  1027.            while(obj) {
  1028.                    y += obj.offsetTop;
  1029.                    obj = obj.offsetParent;
  1030.            }
  1031.    } else if (wmbBrowser.is_nav4) {
  1032.            y = document[idobj].pageY;
  1033.    } else {
  1034.            y = parseInt(document.getElementById(idobj).style.top);
  1035.    }
  1036.    return y;
  1037. }
  1038.  
  1039.  
  1040. var menuinmotion;
  1041. var wmbmotionoffset=[];
  1042. function wmbfloatmenu(event, menu) {
  1043.    wmbclosemenus();
  1044.    if (wmbBrowser.is_nav) {
  1045.            document.captureEvents(Event.MOUSEMOVE);
  1046.    }
  1047.    menuinmotion = menu;
  1048.  
  1049.    // calc offset
  1050.    if (wmbBrowser.is_nav4) {
  1051.            wmbmotionoffset.x = event.pageX - document[menuinmotion].left;
  1052.            wmbmotionoffset.y = event.pageY - document[menuinmotion].top;
  1053.    } else if (wmbBrowser.is_ie4up) {
  1054.            wmbmotionoffset.x = window.event.clientX - document.all[menuinmotion].offsetLeft;
  1055.            wmbmotionoffset.y = window.event.clientY - document.all[menuinmotion].offsetTop;
  1056.    } else {
  1057.            wmbmotionoffset.x = event.pageX - parseInt(document.getElementById(menuinmotion).style.left);
  1058.            wmbmotionoffset.y = event.pageY - parseInt(document.getElementById(menuinmotion).style.top);
  1059.    }       
  1060.  
  1061.    // bug fix: Netscape 6 doesn't seem to have a notion of offsetLeft and offsetTop
  1062.    if (null == wmbmotionoffset.x || isNaN(wmbmotionoffset.x)) {wmbmotionoffset.x = 0;}
  1063.    if (null == wmbmotionoffset.y || isNaN(wmbmotionoffset.y)) {wmbmotionoffset.y = 0;}
  1064.    
  1065.    if (document.onmousemove && document.onmousemove != wmbmovemenu) { 
  1066.            wmbMMStack.push(document.onmousemove); // remember old value
  1067.    }
  1068.    document.onmousemove=wmbmovemenu;
  1069. }
  1070.  
  1071. function wmbhide(sub, hide) {
  1072.    if (sub && wmbLayers[sub.id]) {
  1073.            wmbhidelyr(wmbLayers[sub.id], hide);
  1074.    }
  1075. }
  1076. function wmbhidelyr(lyr, hide) {
  1077.    if (wmbBrowser.is_nav4) {
  1078.            lyr.visibility = (hide)?"hidden":"visible";
  1079.    } else {
  1080.            lyr.style.visibility = (hide)?"hidden":"visible";
  1081.    }
  1082.  
  1083.    // bug fix: move layer so it disappears in NS 6
  1084.    if (wmbBrowser.is_nav5up) {
  1085.            lyr.style.left = parseInt(lyr.style.left) + 5 + 'px';
  1086.    }
  1087.  
  1088. }
  1089.  
  1090. var wmbStopBubbling=false;
  1091. function _wmbclosemenus(evt) {
  1092.    if (wmbBrowser.is_nav) {
  1093.            document.routeEvent(evt);
  1094.    }
  1095.    if (!wmbStopBubbling) {
  1096.            wmbclosemenus();
  1097.    } 
  1098.    wmbStopBubbling=false;
  1099. }
  1100.  
  1101. function wmbclosemenus(menuid) {
  1102.  
  1103.    // if called for a specific subset
  1104.    if (menuid && wmbLayers[menuid]) {
  1105.            for(var i=0; i < wmbLayers[menuid].items.length; i++) {
  1106.                    wmbhide(wmbLayers[menuid].items[i].submenu, true);
  1107.                    // if there is a submenu.. recursively close its children
  1108.                    if (wmbLayers[menuid].items[i].submenu) {
  1109.                            wmbclosemenus(wmbLayers[menuid].items[i].submenu.id, true);
  1110.                    }
  1111.            }
  1112.    // to close all submenus
  1113.    } else {
  1114.            for(var i=0; i < wmbSubLayers.length; i++) {
  1115.                    wmbhidelyr(wmbLayers[wmbSubLayers[i]], true);
  1116.            }
  1117.    }
  1118. }
  1119.  
  1120. function wmbmovemenu(event) {
  1121.  
  1122.    if (wmbBrowser.is_nav4) {
  1123.            Menu.menusbyid[menuinmotion].moveMenu(event.pageX-wmbmotionoffset.x, event.pageY-wmbmotionoffset.y);
  1124.            document.captureEvents(Event.MOUSEDOWN);
  1125.    } else if (wmbBrowser.is_ie4up) {
  1126.            Menu.menusbyid[menuinmotion].moveMenu(window.event.clientX - wmbmotionoffset.x, window.event.clientY - wmbmotionoffset.y);
  1127.    } else {
  1128.            Menu.menusbyid[menuinmotion].moveMenu(event.pageX-wmbmotionoffset.x, event.pageY-wmbmotionoffset.y);
  1129.    }
  1130.    if (document.onmousedown != wmbsinkmenu) {
  1131.            if (document.onmousedown) {
  1132.                    wmbMDStack.push(document.onmousedown); // preserve handler
  1133.            }
  1134.            document.onmousedown=wmbsinkmenu;
  1135.    }
  1136. }
  1137.  
  1138.  
  1139. function wmbsinkmenu() {
  1140.    if (wmbBrowser.is_nav) {
  1141.            document.releaseEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
  1142.    }
  1143.    document.onmousemove=wmbMMStack.pop(noop); // restore to prev handler
  1144.    document.onmousedown=wmbMDStack.pop(noop); // restore to prev handler
  1145. }
  1146. function noop() {}
  1147.  
  1148. function wmbopensubmenu(parentmenu, submenu, marker, ishorizontal, itemid, event) {
  1149.    // look up menu info
  1150.    if (!Menu.menusbyid[submenu]) alert("Could not find " + submenu);
  1151.    if (!Menu.menusbyid[submenu].parent) alert("Expected a parent item in " + submenu);
  1152.    var suboptions = Menu.menusbyid[submenu].parent.suboptions || new WmbSubOptions();
  1153.    var borderOffset = Menu.menusbyid[parentmenu].border;
  1154.    var subBorderOffset = Menu.menusbyid[submenu].border;
  1155.  
  1156.    // placement defaults
  1157.    var placement = suboptions.placement;
  1158.    if (!placement) {
  1159.            placement = ishorizontal?WmbConst.P_BOTTOM:WmbConst.P_RIGHT;
  1160.    }
  1161.  
  1162.    // if already open.. don't reopen (because effects will make this look dumb)
  1163.    if (wmbBrowser.is_nav4) {
  1164.            if (wmbLayers[submenu].visibility != 'hide') return;
  1165.    } else {
  1166.            if (wmbLayers[submenu].style.visibility != 'hidden') return;
  1167.    }
  1168.  
  1169.    // stop further event processing (for onclick it may interfere)
  1170.    wmbStopBubbling=true;
  1171.  
  1172.    wmbclosemenus(parentmenu);
  1173.  
  1174.    if (wmbBrowser.is_nav4) {
  1175.    
  1176.            var verpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingBottom + Menu.menusbyid[parentmenu].getChild(itemid).paddingTop;
  1177.            var horpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingLeft;
  1178.  
  1179.            // position the submenu
  1180.            // submenu.moveToAbsolute(parentmenu.marker.pageX, parentmenu.marker.pageY + parentmenu.marker.clip.height);
  1181.            //
  1182.            var mrkLyr = wmbLayers[parentmenu].document.layers[marker];
  1183.  
  1184.            if (placement == WmbConst.P_BOTTOM) {
  1185.                    var verpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingBottom;
  1186.                    var horpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingLeft;
  1187.                    var pixelLeft = (ishorizontal?mrkLyr.pageX- horpadding - borderOffset:wmbLayers[parentmenu].pageX) + suboptions.distX;
  1188.                    var pixelTop = (ishorizontal?wmbLayers[parentmenu].pageY + wmbLayers[parentmenu].clip.height:mrkLyr.clip.height+mrkLyr.pageY+verpadding) + suboptions.distY;//  + subBorderOffset;
  1189.                    wmbLayers[submenu].moveToAbsolute(pixelLeft, pixelTop);
  1190.  
  1191.                    //                      wmbLayers[submenu].moveToAbsolute(mrkLyr.pageX + suboptions.distX - horpadding - subBorderOffset,       wmbLayers[parentmenu].clip.height + wmbLayers[parentmenu].pageY + suboptions.distY/*mrkLyr.pageY + mrkLyr.clip.height + suboptions.distY + verpadding + borderOffset + subBorderOffset*/);
  1192.            } else if (placement == WmbConst.P_TOP) {
  1193.                    var verpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingTop-1; // -1 to compensate for padding in menu marker table 
  1194.                    var horpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingLeft;
  1195.                    var pixelLeft = (ishorizontal?mrkLyr.pageX- horpadding - borderOffset:wmbLayers[parentmenu].pageX) + suboptions.distX;
  1196.                    var pixelTop = (ishorizontal?wmbLayers[parentmenu].pageY:mrkLyr.pageY - verpadding - borderOffset) + suboptions.distY - wmbLayers[submenu].clip.height;
  1197.                    wmbLayers[submenu].moveToAbsolute(pixelLeft, pixelTop);
  1198.  
  1199.                    //                      wmbLayers[submenu].moveToAbsolute(mrkLyr.pageX + suboptions.distX - horpadding - subBorderOffset,       mrkLyr.pageY + suboptions.distY - verpadding - borderOffset - subBorderOffset - wmbLayers[submenu].clip.height);
  1200.            } else if (placement == WmbConst.P_RIGHT) {
  1201.                    var verpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingTop-1;
  1202.                    var horpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingRight;
  1203.                    var pixelLeft = (ishorizontal?mrkLyr.pageX + horpadding:wmbLayers[parentmenu].pageX + wmbLayers[parentmenu].clip.width) + suboptions.distX;
  1204.                    var pixelTop = (ishorizontal?wmbLayers[parentmenu].pageY + borderOffset - subBorderOffset:mrkLyr.pageY - subBorderOffset - verpadding)  + suboptions.distY ;  
  1205.                    wmbLayers[submenu].moveToAbsolute(pixelLeft, pixelTop);
  1206. /*
  1207.                    var verpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingTop-1;
  1208.                    var horpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingRight+2;
  1209.                    wmbLayers[submenu].moveToAbsolute((ishorizontal?mrkLyr.pageX+horpadding:wmbLayers[parentmenu].clip.width + wmbLayers[parentmenu].pageX)  + suboptions.distX, 
  1210.                            (ishorizontal?wmbLayers[parentmenu].pageY:mrkLyr.pageY - verpadding - subBorderOffset)  + suboptions.distY);
  1211. */
  1212.            } else if (placement == WmbConst.P_LEFT) {
  1213.                    verpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingTop-1; 
  1214.                    var horpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingLeft;
  1215.                    var pixelLeft = (ishorizontal?mrkLyr.pageX - horpadding:wmbLayers[parentmenu].pageX) + suboptions.distX - wmbLayers[submenu].clip.width;
  1216.                    var pixelTop = (ishorizontal?wmbLayers[parentmenu].pageY + borderOffset - subBorderOffset:mrkLyr.pageY - subBorderOffset - verpadding)  + suboptions.distY;  
  1217.                    wmbLayers[submenu].moveToAbsolute(pixelLeft, pixelTop);
  1218.  
  1219. /*                 var verpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingTop-1;
  1220.                    var horpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingRight+2;
  1221.                    wmbLayers[submenu].moveToAbsolute(mrkLyr.pageX + suboptions.distX + horpadding + borderOffset, 
  1222.                            (ishorizontal?wmbLayers[parentmenu].pageY:mrkLyr.pageY - verpadding - subBorderOffset)  + suboptions.distY);
  1223. */         } else {
  1224.                    alert("Unexpected submenu placement: " + placement);
  1225.            }
  1226.            
  1227.            // adjust z order
  1228.            //
  1229.            wmbLayers[submenu].moveAbove(wmbLayers[parentmenu]);
  1230.            
  1231.  
  1232.    } else if (wmbBrowser.is_ie4up) {
  1233.    
  1234.            // position submenu
  1235.            var mrkLyr = document.all[marker];
  1236.            
  1237.            if (placement == WmbConst.P_BOTTOM) {
  1238.                    var verpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingBottom + Menu.menusbyid[parentmenu].getChild(itemid).paddingTop;
  1239.                    var horpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingLeft;
  1240.                    wmbLayers[submenu].style.pixelLeft = (ishorizontal?mrkLyr.offsetLeft- horpadding - borderOffset:0) + mrkLyr.offsetParent.offsetLeft + suboptions.distX;
  1241.                    wmbLayers[submenu].style.pixelTop = mrkLyr.offsetParent.offsetTop + (ishorizontal?mrkLyr.offsetParent.offsetHeight:mrkLyr.offsetHeight+mrkLyr.offsetTop+verpadding+2) + suboptions.distY;//  + subBorderOffset;
  1242.            } else if (placement == WmbConst.P_TOP) {
  1243.                    var verpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingBottom + Menu.menusbyid[parentmenu].getChild(itemid).paddingTop-1; // -1 to compensate for padding in menu marker table 
  1244.                    var horpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingLeft;
  1245.                    wmbLayers[submenu].style.pixelLeft = (ishorizontal?mrkLyr.offsetLeft- horpadding - borderOffset:0) + mrkLyr.offsetParent.offsetLeft + suboptions.distX;
  1246.                    wmbLayers[submenu].style.pixelTop = mrkLyr.offsetParent.offsetTop + (ishorizontal?0:mrkLyr.offsetTop - verpadding - borderOffset) + suboptions.distY - wmbLayers[submenu].offsetHeight;
  1247.            } else if (placement == WmbConst.P_RIGHT) {
  1248.                    verpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingTop+1; // +1 to compensate for padding in menu marker table 
  1249.                    var horpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingRight;
  1250.                    wmbLayers[submenu].style.pixelLeft = mrkLyr.offsetParent.offsetLeft + (ishorizontal?mrkLyr.offsetLeft + horpadding:mrkLyr.offsetParent.offsetWidth) + suboptions.distX;
  1251.                    wmbLayers[submenu].style.pixelTop = mrkLyr.offsetParent.offsetTop + (ishorizontal?borderOffset - subBorderOffset:mrkLyr.offsetTop - subBorderOffset - verpadding)  + suboptions.distY ;  
  1252.            } else if (placement == WmbConst.P_LEFT) {
  1253.                    verpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingTop+1; // +1 to compensate for padding in menu marker table
  1254.                    var horpadding = Menu.menusbyid[parentmenu].getChild(itemid).paddingLeft;
  1255.                    wmbLayers[submenu].style.pixelLeft = mrkLyr.offsetParent.offsetLeft + (ishorizontal?mrkLyr.offsetLeft - horpadding:0) + suboptions.distX - wmbLayers[submenu].offsetWidth;
  1256.                    wmbLayers[submenu].style.pixelTop = mrkLyr.offsetParent.offsetTop + (ishorizontal?borderOffset - subBorderOffset:mrkLyr.offsetTop - subBorderOffset - verpadding)  + suboptions.distY ;  
  1257.            } else {
  1258.                    alert("Unexpected submenu placement: " + placement);
  1259.            }
  1260.  
  1261.            // adjust z order
  1262.            wmbLayers[submenu].style.zIndex = wmbLayers[parentmenu].style.zIndex + 1;
  1263.    
  1264.  
  1265.    } else {
  1266.  
  1267.            // position submenu
  1268.            var mrkLyr = document.getElementById(marker);
  1269.            document.getElementById(submenu).style.left='' + (event.pageX + suboptions.distX) + 'px';
  1270.            document.getElementById(submenu).style.top='' + (event.pageY + suboptions.distY) + 'px';
  1271.  
  1272.            // adjust z order
  1273.            document.getElementById(submenu).style.zIndex = document.getElementById(parentmenu).style.zIndex + 1;
  1274.  
  1275.    }
  1276.  
  1277.    // for NN 4.x we need to record the clip size because
  1278.    // it doesn't understand percentages so wmbclip will need this
  1279.    //
  1280.    wmbrecordclipsize(wmbLayers[submenu]);
  1281.  
  1282.    // clip the menu so it doesn't become visible too fast
  1283.    //
  1284.    wmbclip(wmbLayers[submenu], 0,0,0,0);
  1285.  
  1286.    // make visible
  1287.    //
  1288.    wmbhidelyr(wmbLayers[submenu],false);
  1289.  
  1290.    
  1291.    // now open with the appropriate effect
  1292.    //
  1293.    wmbopeneffect(submenu);
  1294.  
  1295. }
  1296.  
  1297. function WmbRect(top, right, bottom, left) {
  1298.    this.top = top || 0;
  1299.    this.right = right || 0;
  1300.    this.bottom = bottom || 0;
  1301.    this.left = left || 0;
  1302. }
  1303.  
  1304. var wmbTimeOut;
  1305. function wmbopeneffect(submenu) {
  1306.  
  1307.    // some validity checks
  1308.    //
  1309.    if (!Menu.menusbyid[submenu]) alert("Unexpected error: Expected to find " + submenu);
  1310.    if (!Menu.menusbyid[submenu].parent) alert("Unexpected error: Expected to find " + submenu + " parent");
  1311.    
  1312.    // lookup effect info (if none.. create one)
  1313.    //
  1314.    var suboptions = Menu.menusbyid[submenu].parent.suboptions;
  1315.    if (!suboptions) {
  1316.            Menu.menusbyid[submenu].parent.suboptions= new WmbSubOptions();
  1317.    }
  1318.    
  1319.    // now recursively adjust the clipping
  1320.    //
  1321.    wmbTimeOut= setTimeout("_wmbopeneffect('" + submenu + "', 0,0,0,0)", 10);
  1322. }
  1323.  
  1324. function _wmbopeneffect(submenu, top, right, bottom, left) {
  1325.  
  1326.    // clear the old timeout
  1327.    //
  1328.    clearTimeout(wmbTimeOut);
  1329.  
  1330.    // lookup effect info (if none.. create one)
  1331.    //
  1332.    var suboptions = Menu.menusbyid[submenu].parent.suboptions;
  1333.  
  1334.    // returns null if there's no more to do
  1335.    //
  1336.    var rect = suboptions.doClipStep(submenu, top, right, bottom, left);
  1337.    
  1338.    // if there's more work.. do it
  1339.    //
  1340.    if (rect) {
  1341.            wmbTimeOut= setTimeout("_wmbopeneffect('" + submenu + "'," + 
  1342.                            rect.top + "," +
  1343.                            rect.right + "," +
  1344.                            rect.bottom + "," +
  1345.                            rect.left + 
  1346.                            ")", 
  1347.                    25);
  1348.    }
  1349.  
  1350. }
  1351.  
  1352.  
  1353. function wmbsetbg(id,color) {
  1354.    color = color || "";
  1355.    if (wmbBrowser.is_nav5up) {
  1356.            document.getElementById(id).style.backgroundColor=color;
  1357.    } else if(wmbBrowser.is_ie4up) {
  1358.            if (color=="hand")
  1359.            alert("" + id + " " + color);
  1360.            document.all[id].style.backgroundColor=color;
  1361.    }
  1362. }
  1363.  
  1364. function wmbrolleffects(menuid, itemid, isover) {
  1365.    
  1366.    // find the menu structure we're referring to
  1367.    //
  1368.    if (!Menu.menusbyid[menuid]) alert("Invalid menu id " + menuid);
  1369.    if (!Menu.menusbyid[menuid].items) alert("No menu items in " + menuid);
  1370.  
  1371.    var menuItem;
  1372.    for (var i = 0; i < Menu.menusbyid[menuid].items.length; i++) {
  1373.            if (itemid == Menu.menusbyid[menuid].items[i].id) {
  1374.                    menuItem = Menu.menusbyid[menuid].items[i];
  1375.                    break;
  1376.            }
  1377.    }
  1378.    if (!menuItem) alert("Could not find " + itemid);
  1379.  
  1380.    ///////////////////////////////////////////////////////////////////////////
  1381.    // icon changes
  1382.    //
  1383.    if (menuItem.roicon) {
  1384.            if (isover) {
  1385.                    if (wmbBrowser.is_nav4) {
  1386.                            wmbLayers[menuid].document.images["img" + itemid].src = menuItem.roicon;
  1387.                    } else {
  1388.                            document.images["img" + itemid].src = menuItem.roicon;
  1389.                    }
  1390.            } else {
  1391.                    if (wmbBrowser.is_nav4) {
  1392.                            wmbLayers[menuid].document.images["img" + itemid].src = menuItem.icon;
  1393.                    } else {
  1394.                            document.images["img" + itemid].src = menuItem.icon;
  1395.                    }
  1396.            }
  1397.    }
  1398.  
  1399.    
  1400.    ///////////////////////////////////////////////////////////////////////////
  1401.    // scroll changes
  1402.    //
  1403.  
  1404.    if (isover) {
  1405.            window.status = menuItem.description||window.defaultStatus;
  1406.    } else {
  1407.            window.status = window.defaultStatus;
  1408.    }
  1409.  
  1410.    ///////////////////////////////////////////////////////////////////////////
  1411.    // text changes
  1412.    //
  1413.    
  1414.    // text changes won't work for NN 4.x so don't bother
  1415.    if (wmbBrowser.is_nav4) return;
  1416.  
  1417.    // find the object
  1418.    //
  1419.    var obj;
  1420.    if (wmbBrowser.is_nav4) {
  1421.            obj = eval("document." + itemid);
  1422.    } else if (wmbBrowser.is_ie4up) {
  1423.            obj = document.all[itemid].style;
  1424.    } else {
  1425.            obj = document.getElementById(itemid).style;
  1426.    }
  1427.  
  1428.    // modify the attributes (only if there is rollover behavior defined)
  1429.    //
  1430.    if (!isover) {
  1431.            if (menuItem.rofont) obj.fontFamily = menuItem.font;
  1432.            if (menuItem.rofontSize) obj.fontSize = menuItem.fontSize;
  1433.            if (null != menuItem.roisBold) obj.fontWeight = menuItem.isBold?'bold':'normal';
  1434.            if (null != menuItem.roisItalic) obj.fontStyle = menuItem.isItalic?'italic':'normal';
  1435.            if (null != menuItem.roisUnderlined) obj.textDecoration = menuItem.isUnderlined?'underline':'none';
  1436.            if (menuItem.rocolor) obj.color = menuItem.color;
  1437.    } else {
  1438.            if (menuItem.rofont) obj.fontFamily = menuItem.rofont;
  1439.            if (menuItem.rofontSize) obj.fontSize = menuItem.rofontSize;
  1440.            if (null != menuItem.roisBold) obj.fontWeight = menuItem.roisBold?'bold':'normal';
  1441.            if (null != menuItem.roisItalic) obj.fontStyle = menuItem.roisItalic?'italic':'normal';
  1442.            if (null != menuItem.roisUnderlined) obj.textDecoration = menuItem.roisUnderlined?'underline':'none';
  1443.            if (menuItem.rocolor) obj.color = menuItem.rocolor;
  1444.    }
  1445. }
  1446.  
  1447. function wmbclip(lyr, top, right, bottom, left) {
  1448.  
  1449.    if (wmbBrowser.is_nav4) {
  1450.            lyr.clip.top = lyr.clip.orgTop * top / 100;
  1451.            lyr.clip.right = lyr.clip.orgRight * right / 100;
  1452.            lyr.clip.bottom = lyr.clip.orgBottom * bottom / 100;
  1453.            lyr.clip.left = lyr.clip.orgLeft * left / 100;
  1454.    } else {
  1455.            lyr.style.clip = "rect(" + top + "% " + right + "% " + bottom + "% " + left + "%)";
  1456.    } 
  1457.    
  1458. }
  1459.  
  1460. function wmbrecordclipsize(lyr) {
  1461.  
  1462.    if (wmbBrowser.is_nav4) {
  1463.            
  1464.            lyr.clip.orgTop = lyr.clip.top;
  1465.            lyr.clip.orgRight = lyr.clip.right;
  1466.            lyr.clip.orgBottom = lyr.clip.bottom;
  1467.            lyr.clip.orgLeft = lyr.clip.left;
  1468.    } 
  1469. }
  1470.  
  1471.  
  1472. window.onload=Menu.onload
  1473.  
  1474. function wmbwritestyles(wnd, style) {
  1475.    wnd.document.writeln('<style type="text/css"><!--');
  1476.    wnd.document.writeln('div.wmbmenubar { width: 4px; position: absolute;}');
  1477.    wnd.document.writeln('.wmbmenupin { position: relative;}');
  1478.    wnd.document.writeln('table.tblwmbmenubar { border-collapse: collapse; }');
  1479.    wnd.document.writeln('table.wmbouter {border-collapse: collapse; }');
  1480.    wnd.document.writeln('table.tblwmbsubmenu {border-collapse: collapse;}');
  1481.    wnd.document.writeln('table.tblwmbmenubar td, table.tblwmbsubmenu td {align: middle; }');
  1482.    wnd.document.writeln('.wmbsubmenu { width: 4px; position: absolute; visibility: hidden; z-index: 10; }');
  1483.    wnd.document.writeln('.wmbmarker {position: relative; font-size: 1pt; height: 0; width: 0; }');
  1484.    wnd.document.writeln('.wmbmenuitem:link { text-decoration: none; font-size: 8pt; font-family: verdana, arial, helvetica, sans serif; color: black; }');
  1485.    wnd.document.writeln('.wmbmenuitem:visited { text-decoration: none; font-size: 8pt; font-family: verdana, arial, helvetica, sans serif; color: black; }');
  1486.    wnd.document.writeln('.wmbmenuitem:hover { text-decoration: none;}');
  1487.    if (style) {
  1488.            wnd.document.writeln(style);
  1489.    }
  1490.    wnd.document.writeln('--></style>');
  1491. }
  1492. wmbwritestyles(window);
  1493. onload=Menu.onload
  1494.