rem: else 
add: else { document.getElementById('advancedButton').setAttribute("disabled" , !(IsCanSearchMessagesEnabled())); 
context: function FolderPaneSelectionChange(){    var folderOutliner = GetFolderOutliner();    var folderSelection = folderOutliner.outlinerBoxObject.selection;    // This prevents a folder from being loaded in the case that the user    // has right-clicked on a folder different from the one that was    // originally highlighted.  On a right-click, the highlight (selection)    // of a row will be different from the value of currentIndex, thus if    // the currentIndex is not selected, it means the user right-clicked    // and we don't want to load the contents of the folder.    if (!folderSelection.isSelected(folderSelection.currentIndex))      return;    if(gTimelineEnabled) {      gTimelineService.startTimer("FolderLoading");      gTimelineService.enter("FolderLoading has Started");    }    if (folderSelection.count == 1)    {        var startIndex = {};        var endIndex = {};        folderSelection.getRangeAt(0, startIndex, endIndex);        var folderResource = GetFolderResource(folderOutliner, startIndex.value);        var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);        if (msgFolder == msgWindow.openFolder)            return;        else        {            var sortType = 0;            var sortOrder = 0;            var viewFlags = 0;            var viewType = 0;            // don't get the db if this folder is a server            // we're going to be display account central            if (!(msgFolder.isServer))             {              try               {                var msgDatabase = msgFolder.getMsgDatabase(msgWindow);                if (msgDatabase)                {                  var dbFolderInfo = msgDatabase.dBFolderInfo;                  sortType = dbFolderInfo.sortType;                  sortOrder = dbFolderInfo.sortOrder;                  viewFlags = dbFolderInfo.viewFlags;                  viewType = dbFolderInfo.viewType;                  msgDatabase = null;                  dbFolderInfo = null;                }              }              catch (ex)              {                dump("failed to get view & sort values.  ex = " + ex +"\n");              }            }            if (gDBView && gDBView.isSearchView)            {              gDBView.isSearchView = false;  //reset the search input on folder switch              var searchInput = document.getElementById("searchInput");              if (searchInput)                 searchInput.value = "";            }            ChangeFolderByURI(folderResource.Value, viewType, viewFlags, sortType, sortOrder);        }    }    else    {        msgWindow.openFolder = null;        ClearThreadPane();    }    if (gAccountCentralLoaded)      UpdateMailToolbar("gAccountCentralLoaded");    else      ClearMessagePane();    if (gDisplayStartupPage)    {        loadStartPage();        gDisplayStartupPage = false;        UpdateMailToolbar("gDisplayStartupPage");    }    }
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/65d20cc280a152b552ffab6306bea0b601bfef7f/commandglue.js/clean/mailnews/base/resources/content/commandglue.js