rem:  globalElement = anchorElement.cloneNode(false);  
context: function Startup(){  if (!InitEditorShell())    return;  doSetOKCancel(onOK, null);  nameInput = document.getElementById("nameInput");  dump("tagName = "+tagName+"\n");  // Get a single selected element of the desired type  anchorElement = editorShell.GetSelectedElement(tagName);  if (anchorElement) {    // We found an element and don't need to insert one    insertNew = false;    dump("Found existing anchor\n");  } else {    insertNew = true;    // We don't have an element selected,     //  so create one with default attributes    dump("Element not selected - calling createElementWithDefaults\n");    anchorElement = editorShell.CreateElementWithDefaults(tagName);    // Use the current selection as suggested name    var name = GetSelectionAsText();    // Get 40 characters of the selected text and don't add "..."    name = TruncateStringAtWordEnd(name, 40, false);    // Replace whitespace with "_"    name = ReplaceWhitespace(name, "_");    //Be sure the name is unique to the document    if (AnchorNameExists(name))      name += "_"    anchorElement.setAttribute("name",name);  }  if(!anchorElement)  {    dump("Failed to get selected element or create a new one!\n");    window.close();  }  // Make a copy to use for AdvancedEdit  globalElement = anchorElement.cloneNode(false);  InitDialog();    nameInput.focus();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/6df53d78e87da76212f26738e05ec918d9d1125c/EdNamedAnchorProps.js/buggy/editor/ui/dialogs/content/EdNamedAnchorProps.js