add: } else { listbox.selectedIndex = oldIndex; 
context:     onCalendarUnregistering: function(aCalendar) {        var item = getListItem(aCalendar);        if (item) {            var listbox = document.getElementById("list-calendars-listbox");            listbox.removeChild(item);            // This is called before the calendar is actually deleted, so ==1 is correct            if (getCalendarManager().getCalendars({}).length <= 1) {                // If there are no calendars, you can't create events/tasks                document.getElementById("new_command").setAttribute("disabled", true);                document.getElementById("new_todo_command").setAttribute("disabled", true);            }        }        if (aCalendar.canRefresh) {            // We may have just removed our last remote cal.  Then we'd need to            // disabled the reload-remote-calendars command            var calendars = getCalendarManager().getCalendars({});            function calCanRefresh(cal) {                return (cal.canRefresh && !cal.uri.equals(aCalendar.uri));            }            if (!calendars.some(calCanRefresh)) {                var remoteCommand = document.getElementById("reload_remote_calendars");                remoteCommand.setAttribute("disabled", true);            }        }    },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/0f94860aad8be65abdcd9dac802ffb4a0e0fff58/calendarManagement.js/clean/calendar/resources/content/calendarManagement.js