rem: gContentWindow.focus(); 
add: window.content.focus(); 
context: function SetDisplayMode(mode){  if (gIsHTMLEditor)  {    // Already in requested mode:    //  return false to indicate we didn't switch    if (mode == gEditorDisplayMode)      return false;    gEditorDisplayMode = mode;    // Save the last non-source mode so we can cancel source editing easily    if (mode != DisplayModeSource)      PreviousNonSourceDisplayMode = mode;        // Editorshell does the style sheet loading/unloading    editorShell.SetDisplayMode(mode);    // Set the UI states    gPreviewModeButton.setAttribute("selected",Number(mode == DisplayModePreview));    gNormalModeButton.setAttribute("selected",Number(mode == DisplayModeNormal));    gTagModeButton.setAttribute("selected",Number(mode == DisplayModeAllTags));    gSourceModeButton.setAttribute("selected", Number(mode == DisplayModeSource));    if (mode == DisplayModeSource)    {      // Switch to the sourceWindow (second in the deck)      gContentWindowDeck.setAttribute("index","1");      // TODO: WE MUST DISABLE APPROPRIATE COMMANDS      // and change UI to appropriate      // THIS DOESN'T WORK!      gSourceContentWindow.focus();    }    else     {      // Switch to the normal editor (first in the deck)      gContentWindowDeck.setAttribute("index","0");      // TODO: WE MUST ENABLE APPROPRIATE COMMANDS      // and change UI back to "normal"      gContentWindow.focus();    }    return true;  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/18736fd80cfad5a0e611db473920c6e1a553b72a/editor.js/buggy/editor/ui/composer/content/editor.js