rem: var tree = GetFolderTree(); if (tree) 
add: var folderOutliner = GetFolderOutliner(); var startIndex = {}; var endIndex = {}; folderOutliner.outlinerBoxObject.selection.getRangeAt(0, startIndex, endIndex); if (startIndex.value >= 0) 
context: function MsgEmptyTrash() {    var tree = GetFolderTree();    if (tree)    {        var folderList = tree.selectedItems;        if (folderList)        {            var folder;            folder = folderList[0];            if (folder)			{                var trashUri = GetSelectTrashUri(folder);                if (trashUri)                {                    var trashElement = document.getElementById(trashUri);                    if (trashElement)                    {                        dump ('found trash folder\n');                        trashElement.setAttribute('open','');                    }                    var trashSelected = IsSpecialFolderSelected(MSG_FOLDER_FLAG_TRASH);                    if(trashSelected)                    {                        tree.clearItemSelection();                    }                    try {                          messenger.EmptyTrash(tree.database, folder.resource);                      }                      catch(e)                       {                            dump ("Exception : messenger.EmptyTrash \n");                       }                    if (trashSelected)                    {                        trashElement = document.getElementById(trashUri);                        if (trashElement)                            ChangeSelection(tree, trashElement);                    }                }			}        }    }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/938770831965cde1ef5c4ce945b768186518efae/widgetglue.js/buggy/mailnews/base/resources/content/widgetglue.js