rem:  this.EventSelection = new CalendarEventSelection( this ); calendarViewController.selectionManager = this.EventSelection;  
context: function CalendarWindow( ){   //setup the calendar event selection   this.EventSelection = new CalendarEventSelection( this );   calendarViewController.selectionManager = this.EventSelection;   // Extension authors can tweak this array to make gCalendarWindow.switchToView    // play nicely with any additional views   this.availableViews = ["day", "week", "multiweek", "month"];   /** This object only exists to keep too many things from breaking during the    *   switch to the new views   **/   this.currentView = {       hiliteTodaysDate: function() {           document.getElementById("view-deck").selectedPanel.goToDay(now());       },       // This will get converted again to a calDateTime, which is silly, but let's       // not change too much right now.       getNewEventDate: function() {           var d = document.getElementById("view-deck").selectedPanel.selectedDay;           if (!d)               d = now();           d = d.getInTimezone("floating");           d.hour = now().hour;           return d.jsDate;       },       get eventList() { return new Array(); },       goToNext: function() {           document.getElementById("view-deck").selectedPanel.moveView(1);       },       goToPrevious: function() {           document.getElementById("view-deck").selectedPanel.moveView(-1);       },       changeNumberOfWeeks: function(menuitem) {           var mwView = document.getElementById("view-deck").selectedPanel;           mwView.weeksInView = menuitem.value;       },       get selectedDate() { return this.getNewEventDate(); },       get displayStartDate() { return document.getElementById("view-deck").selectedPanel.startDay; },       get displayEndDate() { return document.getElementById("view-deck").selectedPanel.endDay; },       getVisibleEvent: function(event) {            var view = document.getElementById("view-deck").selectedPanel           if ((event.startDate.compare(view.endDay) != 1) &&               (event.endDate.compare(view.startDay) != -1)) {               return true;           }           return false;       },       goToDay: function(newDate) {           document.getElementById("view-deck").selectedPanel.goToDay(jsDateToDateTime(newDate));       },       refresh: function() {           this.goToDay(this.getNewEventDate());       }   };   // Get the last view that was shown before shutdown, and switch to it   var SelectedIndex = document.getElementById("view-deck").selectedIndex;      switch( SelectedIndex )   {      case "1":         this.switchToView('week');         break;      case "2":         this.switchToView('multiweek');         break;      case "3":         this.switchToView('month');         break;      case "0":      default:         this.switchToView('day');         break;   }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/daf762c7fca63c377d255ff7e70b1b7a4b4cb141/calendarWindow.js/clean/calendar/resources/content/calendarWindow.js