rem: document.getElementById("list-calendars-listbox").removeChild(item); 
add: var listbox = document.getElementById("list-calendars-listbox"); listbox.removeChild(item);  if (getCalendarManager().getCalendars({}).length <= 1) {  document.getElementById("new_command").setAttribute("disabled", true); document.getElementById("new_todo_command").setAttribute("disabled", true); } 
context:     onCalendarUnregistering: function(aCalendar) {        var item = getListItem(aCalendar);        if (item) {            document.getElementById("list-calendars-listbox").removeChild(item);        }    },
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/7c27092a43b9ed14f3d3d9b2bb546e9d24ddbc5c/calendarManagement.js/buggy/calendar/resources/content/calendarManagement.js