rem: if (messengerDisplayDeck.selectedPanel = calendarViewBox) showCalendar(false); else showCalendar(true); 
add: showCalendar(d1, d2);  calendarViewBox.selectedPanel.selectedDay = selectedDay; 
context: function switchView(type) {    var messengerDisplayDeck = document.getElementById("displayDeck");    var calendarViewBox = document.getElementById("calendar-view-box");    var monthView = document.getElementById("calendar-month-view");    var multidayView = document.getElementById("calendar-multiday-view");    // XXX we need a selectedDate in calICalendarView.idl!    var selectedDate = calendarViewBox.selectedPanel.startDate;    if (!selectedDate) {        var d = Components.classes['@mozilla.org/calendar/datetime;1'].createInstance(Components.interfaces.calIDateTime);        d.jsDate = new Date();        selectedDate = d.getInTimezone(calendarDefaultTimezone());    }    switch (type) {    case "month": {        monthView.showDate(selectedDate);        calendarViewBox.selectedPanel = monthView;    }        break;    case "week": {        var start = selectedDate.startOfWeek;        var end = selectedDate.endOfWeek.clone();        end.day += 1;        end.normalize();        multidayView.setDateRange(start, end);        calendarViewBox.selectedPanel = multidayView;    }        break;    case "day":    default: {        var start = selectedDate;        var end = selectedDate.clone();        end.day += 1;        end.normalize();        multidayView.setDateRange(start, end);        calendarViewBox.selectedPanel = multidayView;    }        break;    }    if (messengerDisplayDeck.selectedPanel = calendarViewBox)        showCalendar(false);    else        showCalendar(true);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/1e3a6865e69570d803ccf57385d5efae466534ea/messenger-overlay-sidebar.js/buggy/calendar/lightning/content/messenger-overlay-sidebar.js