add:     if (!menu.parentNode) parentNode.insertBefore(menu, beforeNode);  
context: function mmgr_addsmenu (parentNode, beforeNode, menuName, domId, label, attribs){    var document = parentNode.ownerDocument;    /* sometimes the menu is already there, for overlay purposes. */    var menu = document.getElementById(domId);    if (!menu)    {        menu = document.createElement ("menu");        menu.setAttribute ("id", domId);        parentNode.insertBefore(menu, beforeNode);    }    var menupopup = menu.firstChild;    if (!menupopup)    {        menupopup = document.createElement ("menupopup");        menupopup.setAttribute ("id", domId + "-popup");        menu.appendChild(menupopup);        menupopup = menu.firstChild;    }    menupopup.setAttribute ("menuName", menuName);    menu.setAttribute ("accesskey", getAccessKey(label));    label = label.replace("&", "");    menu.setAttribute ("label", label);    menu.setAttribute ("isSeparator", true);    if (typeof attribs == "object")    {        for (var p in attribs)            menu.setAttribute (p, attribs[p]);    }    this.hookPopup (menupopup);    return menupopup;}
meta: 3298	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3298/67f49f7f04806f18e168078356ddd3b3a50c324c/menu-manager.js/buggy/js/lib/menu-manager.js