rem: var imagePtr = window.editorShell.GetSelectedElement(objectName); 
add: var imagePtr = window.editorShell.GetSelectedElement(objectName); 
context: function EditorFillContextMenu(event, contextMenuNode){  if ( event.target != contextMenuNode )    return;  goUpdateCommand("cmd_undo");  goUpdateCommand("cmd_redo");  goUpdateCommand("cmd_cut");  goUpdateCommand("cmd_copy");  goUpdateCommand("cmd_paste");  goUpdateCommand("cmd_delete");  // Setup object property menuitem  var objectName = InitObjectPropertiesMenuitem("objectProperties_cm");  InitRemoveStylesMenuitems("removeStylesMenuitem_cm", "removeLinksMenuitem_cm");  var inCell = IsInTableCell();  // Set appropriate text for join cells command  InitJoinCellMenuitem("joinTableCells_cm");  // Update enable states for all table commands    goUpdateTableMenuItems(document.getElementById("composerTableMenuItems"));  // Loop through all children to hide disabled items  var children = contextMenuNode.childNodes;  if (children)  {    var count = children.length;    for (var i = 0; i < count; i++)      HideDisabledItem(children.item(i));  }  // Remove separators if all items in immediate group above are hidden  // A bit complicated to account if multiple groups are completely hidden!  var haveUndo =     IsMenuItemShowing("menu_undo_cm") ||    IsMenuItemShowing("menu_redo_cm");  var haveEdit =     IsMenuItemShowing("menu_cut_cm")   ||		IsMenuItemShowing("menu_copy_cm")  ||		IsMenuItemShowing("menu_paste_cm") ||		IsMenuItemShowing("menu_delete_cm");  var haveStyle =     IsMenuItemShowing("removeStylesMenuitem_cm") ||    IsMenuItemShowing("createLink_cm") ||    IsMenuItemShowing("removeLinksMenuitem_cm");  var haveProps =    IsMenuItemShowing("objectProperties_cm") ||    IsMenuItemShowing("menu_saveImage_cm")  ShowMenuItem("undoredo-separator", haveUndo && haveEdit);  ShowMenuItem("edit-separator", haveEdit || haveUndo);	               //The following is for the 'save image (imagename)' contextmenuitem   var isImage = (objectName=="img");  ShowMenuItem("menu_saveImage_cm", isImage);  if (isImage)   //we have an image  {      var saveImageMenuItem= document.getElementById("menu_saveImage_cm");     var imagePtr = window.editorShell.GetSelectedElement(objectName);          var imageName = extractFileNameFromUrl(imagePtr.getAttribute("src"));     var menutext = window.editorShell.GetString("SaveImageAs").replace(/%NAME%/,imageName);     saveImageMenuItem.setAttribute('value',menutext);     var onCommand = "savePage('"+ imagePtr.getAttribute("src") + "',true)";       saveImageMenuItem.setAttribute('oncommand',onCommand);     }  // Note: Item "menu_selectAll_cm" and   // following separator are ALWAYS enabled,  // so there will always be 1 separator here//dump("haveStyle = "+haveStyle+", "+haveProps+", inCell"+inCell+"\n");  ShowMenuItem("styles-separator", haveStyle && (haveProps || inCell));  ShowMenuItem("property-separator", (haveProps && inCell) || !haveStyle);  // Remove table submenus if not in table  ShowMenuItem("tableInsertMenu_cm",  inCell);  ShowMenuItem("tableSelectMenu_cm",  inCell);  ShowMenuItem("tableDeleteMenu_cm",  inCell);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/0b2dd2b2d2fd037df917e07645fa019a963332a5/EditorContextMenu.js/buggy/editor/ui/composer/content/EditorContextMenu.js