rem: { var item = document.createElement('menuitem'); if ( item ) { popup.appendChild(item); item.setAttribute('label', name); item.setAttribute('oncommand', oncommand); } 
add: { var item = document.createElement('menu'); if ( item ) { item = popup.appendChild(item); item.setAttribute('label', name);  var openpopup = document.createElement('menupopup'); openpopup = item.appendChild(openpopup);  var menuitementry = document.createElement('menuitem'); menuitementry.setAttribute('oncommand', 'openAttachment' + oncommandPrefix); menuitementry.setAttribute('label', "Open"); menuitementry = openpopup.appendChild(menuitementry);  var menuseparator = document.createElement('menuseparator'); openpopup.appendChild(menuseparator);  menuitementry = document.createElement('menuitem'); menuitementry.setAttribute('oncommand', 'saveAttachment' + oncommandPrefix); menuitementry.setAttribute('label', "Save"); menuitementry = openpopup.appendChild(menuitementry); } 
context: function AddAttachmentToMenu(name, oncommand){  var popup = document.getElementById("attachmentPopup");  if (popup)  {    var item = document.createElement('menuitem');    if ( item )    {      popup.appendChild(item);      item.setAttribute('label', name);      item.setAttribute('oncommand', oncommand);    }    var button = document.getElementById("attachmentButton");    if (button)    {       button.setAttribute("label", popup.childNodes.length);    }  }  var attachBox = document.getElementById("attachmentBox");  if (attachBox)    attachBox.removeAttribute("collapsed");}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/c686cc9c61e4bd3b66ea3bb1d7571dee2ed4a77c/msgHdrViewOverlay.js/buggy/mailnews/base/resources/content/msgHdrViewOverlay.js