rem: if(tab == tabs.selectedItem && tab.previousSibling) tabs.selectedItem = tab.previousSibling;   
add: if(tab == tabs.selectedItem) if(tab.previousSibling) { tabs.selectedItem = tab.previousSibling; } else if(tab.nextSibling) { tabs.selectedItem = tab.nextSibling; }  
context:     deck.removeTab = function(tab) {        if(tab == tabs.selectedItem && tab.previousSibling)            tabs.selectedItem = tab.previousSibling;            // Force unload event.        tab.linkedBrowser.loadURI('about:blank');        this.removeChild(tab.linkedBrowser);        tabs.removeChild(tab);    };
meta: 1705	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1705/63a3464e9be63b71cb7e1259793cc647ca7ec657/tabbed_area.js/clean/chrome/content/lib/tabbed_area.js