rem: windowID.UpdateMailToolbar('MsgOpenExistingWindowForMessage'); 
context: function MsgOpenExistingWindowForMessage(aMessageUri){    var messageUri;    var msgHdr = null;    var windowID = GetWindowByWindowType("mail:messageWindow");    if (!windowID)      return false;    if (!aMessageUri) {        var currentIndex = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView).outlinerView.selection;        messageUri = gDBView.getURIForViewIndex(currentIndex);    }    else        messageUri = aMessageUri;    // be sure to pass in the current view....    if (!messageUri)        return false;    try {        msgHdr = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri);        if (!msgHdr)            return false;        // even if the folder uri's match, we can't use the existing view        // (msgHdr.folder.URI == windowID.gCurrentFolderUri)        // the reason is quick search and mail views.        // see bug #187673        //        // for the sake of simplicity,        // let's always call CreateView(gDBView)        // which will clone gDBView        if ("CreateView" in windowID) {          // Reset the window's message uri and folder uri vars, and          // update the command handlers to what's going to be used.          // This has to be done before the call to CreateView().          windowID.gCurrentMessageUri = messageUri;          windowID.gCurrentFolderUri = msgHdr.folder.URI;          windowID.UpdateMailToolbar('MsgOpenExistingWindowForMessage');          windowID.CreateView(gDBView);          windowID.LoadMessageByMsgKey(msgHdr.messageKey);        }        else          return false;    }    catch (ex) {        dump("reusing existing standalone message window failed: " + ex + "\n");        return false;    }    // bring existing window to front    windowID.focus();    return true;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/bd9dba1753db2b5f4ac00462a70e72b6b40078a8/mailWindowOverlay.js/buggy/mailnews/base/resources/content/mailWindowOverlay.js