// Add a new parameter identifier. This will be used to find an Menu item. // If it is missing, a simple one will be generated. The identifier will be the // return value function MTMenuItem(text, url, target, tooltip, icon, openIcon, identifier) { this.text = text; this.url = url ? url : ""; this.target = target ? target : (MTMDefaultTarget ? MTMDefaultTarget : ""); this.tooltip = tooltip; this.icon = icon ? icon : ""; this.openIcon = openIcon ? openIcon : ""; // used for addSubItem this.identifier = identifier ? identifier : this.text+"#"+this.url; this.number = MTMNumber++; this.parentNode = null; this.submenu = null; this.expanded = false; this.MTMakeSubmenu = MTMakeSubmenu; this.makeSubmenu = MTMakeSubmenu; this.addSubItem = MTMAddSubItem; MTMLastItem = this; return this.identifier; } // create a new array to find the items. function MTMenu() { this.items = new Array(); this.identHash = new Array(); this.MTMAddItem = MTMAddItem; this.addItem = MTMAddItem; this.makeLastSubmenu = MTMakeLastSubmenu; this.MTMFindItem = MTMFindItem; this.findItem = MTMFindItem; } // The method which do the work. First look at the childs. If it is not // found start looking in the submenus function MTMFindItem(identifier) { var node = null, i; if (this.identHash[identifier]) { node = this.identHash[identifier]; } else { i = 0; while (node == null && i