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: 1622	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1622/e52953c6618f2fc5b528118c07a23734a5789615/menu-manager.js/clean/js/lib/menu-manager.js