rem: var threadMenuItem = document.getElementById("sortByThreadMenuitem"); threadMenuItem.setAttribute("disabled", !gDBView.supportsThreading); 
add: var threaded = ((gDBView.viewFlags & nsMsgViewFlagsType.kThreadedDisplay) != 0); var sortThreadedMenuItem = document.getElementById("sortThreaded"); var sortUnthreadedMenuItem = document.getElementById("sortUnthreaded");  sortThreadedMenuItem.setAttribute("checked", threaded); sortUnthreadedMenuItem.setAttribute("checked", !threaded);  sortThreadedMenuItem.setAttribute("disabled", !gDBView.supportsThreading); sortUnthreadedMenuItem.setAttribute("disabled", !gDBView.supportsThreading); 
context: function InitViewSortByMenu(){    var sortType = gDBView.sortType;    setSortByMenuItemCheckState("sortByDateMenuitem", (sortType == nsMsgViewSortType.byDate));    setSortByMenuItemCheckState("sortByFlagMenuitem", (sortType == nsMsgViewSortType.byFlagged));    setSortByMenuItemCheckState("sortByOrderReceivedMenuitem", (sortType == nsMsgViewSortType.byId));    setSortByMenuItemCheckState("sortByPriorityMenuitem", (sortType == nsMsgViewSortType.byPriority));    setSortByMenuItemCheckState("sortBySizeMenuitem", (sortType == nsMsgViewSortType.bySize));    setSortByMenuItemCheckState("sortByStatusMenuitem", (sortType == nsMsgViewSortType.byStatus));    setSortByMenuItemCheckState("sortBySubjectMenuitem", (sortType == nsMsgViewSortType.bySubject));    setSortByMenuItemCheckState("sortByThreadMenuitem", (sortType == nsMsgViewSortType.byThread));    setSortByMenuItemCheckState("sortByUnreadMenuitem", (sortType == nsMsgViewSortType.byUnread));    setSortByMenuItemCheckState("sortByLabelMenuitem", (sortType == nsMsgViewSortType.byLabel));    setSortByMenuItemCheckState("sortByJunkStatusMenuitem", (sortType == nsMsgViewSortType.byJunkStatus));    setSortByMenuItemCheckState("sortBySenderMenuitem", (sortType == nsMsgViewSortType.byAuthor));    setSortByMenuItemCheckState("sortByRecipientMenuitem", (sortType == nsMsgViewSortType.byRecipient));     setSortByMenuItemCheckState("sortByAttachmentsMenuitem", (sortType == nsMsgViewSortType.byAttachments)); 	    var sortOrder = gDBView.sortOrder;    setSortByMenuItemCheckState("sortAscending", (sortOrder == nsMsgViewSortOrder.ascending));    setSortByMenuItemCheckState("sortDescending", (sortOrder == nsMsgViewSortOrder.descending));    var threadMenuItem = document.getElementById("sortByThreadMenuitem");    threadMenuItem.setAttribute("disabled", !gDBView.supportsThreading);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/2a90cb5f9981300a1c3fa50788f7af4968a5a124/mailWindowOverlay.js/buggy/mail/base/content/mailWindowOverlay.js