      function webMenu() {
        this.activatesWithClick = false;
        this.selfRef = null;
        this.mxTracking = false;
        this.menuBoxes = new Array();
        this.minWidth = 160;
        this.zIndex = 2000;
        this.vertical = true;
        this.topItems = new Array();
        // default css names
        this.css_menuitem    = "mxwebmenuitem";
        this.css_menutopitem = "mxwebmenutopitem";
        this.css_menubar     = "mxwebmenubar";
        this.css_menubox     = "mxwebmenubox";
      }

      webMenu.prototype.init = function(ABase) {
        var x,e,s,mitems,eles,i,w,xw,cn,atag;
        this.menuBase = documentX.getElementById(ABase);
        if (this.menuBase) {
          this.xall = documentX.getElementsByTagName('',this.menuBase);
          for (x=0;x<this.xall.length;x++) {
            e = this.xall[x];
            if (e) {
              e.mxmenu = this.selfRef;
              cn = e.className;
              atag = e.tagName;
              if (utilsX.isString(atag)) {
                atag = atag.toLowerCase();
                if (atag=="select") {
                  e.isMxMenuSelect = true;
                }
              }
              if ((cn == this.css_menuitem) || ((cn == this.css_menutopitem))) {
                if (cn == this.css_menutopitem) {
                  if (this.vertical) {
                    e.style.display = "block";
                  }
                  this.topItems[this.topItems.length] = e;
                }
                e.isMenuItem = true;
                if (utilsX.isString(e.id) && (e.id != "") ) {
                  s = e.id + "items";
                  mitems = documentX.getElementById(s);
                  if (mitems) {
                    e.webMenuItems = mitems;
                    mitems.donePointers = false;
                    mitems.webMenuItem = e;
                    this.menuBoxes[this.menuBoxes.length] = mitems;
                    eles = documentX.getElementsByClassName(this.css_menuitem,mitems);
                    w = 0;
                    for (i=0;i<eles.length;++i) {
                      eles[i].webMenuBox = mitems;
                      xw = documentX.elementWidth(eles[i]);
                      if (w < xw) {w = xw;}
                    }
                    if (w < this.minWidth) {
                      w = this.minWidth;
                    }
                    for (i=0;i<eles.length;++i) {
                      eles[i].style.width = w + 'px';
                    }

                    //mitems.style.zindex = 2000;
                    //xHide(mitems);
                    this.hideMenuBox(mitems);
                  }
                }
              }
            }
          }
          this.menuBoxes[this.menuBoxes.length] = this.menuBase;
          this.menuBase.donePointers = false;
          mxmenuManager.addMenu(this.selfRef);
          if (this.vertical) {
            w = 0;
            for (x=0;x < this.topItems.length;x++) {
              xw = documentX.elementWidth(this.topItems[x]);
              if (x < xw) {
                w = xw;
              }
            }
            //if (w < this.minWidth) {
            //  w = this.minWidth;
            //}
            for (x=0;x < this.topItems.length;x++) {
              documentX.elementWidth(this.topItems[x],w);
            }
          }
        }
      }

      webMenu.prototype.doMouseMove = function(evt) {
        if ((!evt) || (evt.isxEvent && !evt.target)) {
          return;
        }
        var e;
        if (evt.target) {
          e = evt.target;
        } else {
          e = evt;
        }

        if (!e.isMenuItem) {return};
        var mitems,baseBox,aLevel;
        if (e.webMenuBox) {
          baseBox = e.webMenuBox;
          aLevel = true;
        } else {
          baseBox = this.menuBase;
          aLevel = false;
        }
        if (this.vertical) {
          aLevel = true;
        }
        if (e.webMenuItems) {
          mitems = e.webMenuItems;
          if (baseBox.activeItems != mitems) {
            this.hideMenuBox(baseBox.activeItems);
          }
          if (this.activatesWithClick && (!this.mxTracking)) {
            return false;
          }

            baseBox.activeItems = mitems;
            documentX.showElement(mitems);
            //mitems.style.display = "table";
            if (aLevel) {
              // show items off menu box
              documentX.moveElement(mitems,documentX.elementX(e) + documentX.elementWidth(baseBox) -2,documentX.elementY(e)+4);
              this.activatePointers(mitems);
            } else {
              documentX.moveElement(mitems,documentX.elementX(e) ,documentX.elementY(e) + documentX.elementHeight(e));
              this.activatePointers(mitems);
              // show items off menu bar
            }
          //}
        } else {
          this.hideMenuBox(baseBox.activeItems);
        }
      }

      webMenu.prototype.activatePointers = function(mb) {
        //if (!mb.donePointers) {
          var col = documentX.getElementsByClassName('mxwebmenuitemsptr',mb);
          var i,e,ep,xw,xl;
          for (i=0;i<col.length;++i) {
            e  = col[i];
            ep = documentX.getParentElement(e);
            xw = (documentX.elementWidth(ep));
            xl = documentX.elementLeft(ep);
            documentX.moveElement(e,0+xw-documentX.elementWidth(e)-2);
          }
          mb.donePointers = true;
        //}
      }

      webMenu.prototype.hideMenuBox = function(mb) {
        if (mb && (mb != this.menuBase)) {
          if (mb.activeItems) {
            this.hideMenuBox(mb.activeItems);
          }
          mb.activeItems=null;
          mb.activeItem=null;
          documentX.moveElement(mb,-5000,-5000);
          documentX.hideElement(mb);
        }
      }

      webMenu.prototype.deactivateAll = function() {
        var i;
        this.mxTracking = false;
        if (this.menuBoxes) {
          for (i=0; i<this.menuBoxes.length; ++i) {
            this.hideMenuBox(this.menuBoxes[i]);

          }
        }
      }

      webMenu.prototype.doOnWinResize = function() {
        //xMoveTo(this.menuBarBase.id, xLeft(this.menuBarBase.id), 0);
      }

      webMenu.prototype.doOnScroll = function() {
        this.deactivateAll();
      }
