rem: var msgFolders = GetSubFoldersInFolderPaneOrder(parent); for (var i = 0; i < msgFolders.length; i++) if (msgFolders[i].URI == folder.URI) break;    while (++i < msgFolders.length) { folder = FindNextChildFolder(msgFolders[i]); if (folder) return folder; } 
add: folder = FindNextChildFolder(parent, folder); if (folder) return folder; 
context: function FindNextFolder(){  // look for the next folder, this will only look on the current account  // and below us, in the folder pane  // note use of gDBView restricts this function to message folders  // otherwise you could go next unread from a server  var folder = FindNextChildFolder(gDBView.msgFolder);  if (folder)    return folder;  // didn't find folder in children  // go up to the parent, and start at the folder after the current one  // unless we are at a server, in which case bail out.  for (folder = gDBView.msgFolder; !folder.isServer; ) {    var parent = folder.parent;    var msgFolders = GetSubFoldersInFolderPaneOrder(parent);    for (var i = 0; i < msgFolders.length; i++)      if (msgFolders[i].URI == folder.URI)        break;        // the current folder is at index i    // start at the next folder after that, if there is one    while (++i < msgFolders.length) {      folder = FindNextChildFolder(msgFolders[i]);      if (folder)        return folder;    }     // none at this level after the current folder.  go up.    folder = parent;  }  // nothing in the current account, start with the next account (below)  // and try until we hit the bottom of the folder pane  // start at the account after the current account  var rootFolders = GetRootFoldersInFolderPaneOrder();  for (i = 0; i < rootFolders.length; i++) {    if (rootFolders[i].URI == gDBView.msgFolder.server.serverURI)      break;  }    for (var j = i + 1; j < rootFolders.length; j++) {    folder = FindNextChildFolder(rootFolders[j]);    if (folder)      return folder;  }    // if nothing from the current account down to the bottom  // (of the folder pane), start again at the top.  for (j = 0; j <= i; j++) {    folder = FindNextChildFolder(rootFolders[j]);    if (folder)      return folder;  }  return null;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/8a0d01776d330b88544cca5166180b8d6bf18bd1/msgViewNavigation.js/clean/mailnews/base/resources/content/msgViewNavigation.js