rem: { var folder = GetLoadedMsgFolder(); var folderResource = folder.QueryInterface(Components.interfaces.nsIRDFResource); uriToOpen = folderResource.Value; } 
add:      uriToOpen = GetSelectedFolderURI(); 
context: function MsgOpenNewWindowForFolder(uri, key){  var uriToOpen = uri;  var keyToSelect = key;  if (!uriToOpen)  {    var folder = GetLoadedMsgFolder();    var folderResource = folder.QueryInterface(Components.interfaces.nsIRDFResource);    uriToOpen = folderResource.Value;  }  if (uriToOpen) {    var layoutType = gPrefs.getIntPref("mail.pane_config");    if(layoutType == 0)      window.openDialog("chrome://messenger/content/messenger.xul", "_blank", "all,chrome,dialog=no,status,toolbar", {uri: uriToOpen, key: keyToSelect});    else      window.openDialog("chrome://messenger/content/mail3PaneWindowVertLayout.xul", "_blank", "all,chrome,dialog=no,status,toolbar", {uri: uriToOpen, key: keyToSelect});  }}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/f19d0ad6e5a0ad62ce5a846d44da84a39ed50186/mailWindowOverlay.js/clean/mailnews/base/resources/content/mailWindowOverlay.js