rem: calendar = createCalendar(); 
add: var calendar = createCalendar(); 
context: function WeekView( calendarWindow ){    this.superConstructor( calendarWindow );       //set the time on the left hand side labels    //need to do this in JavaScript to preserve formatting    for (var i = 0; i < 24; i++) {        var TimeToFormat = new Date();        TimeToFormat.setHours( i );        TimeToFormat.setMinutes( "0" );              var FormattedTime = calendarWindow.dateFormater.getFormatedTime( TimeToFormat );              var Label = document.getElementById( "week-view-hour-" + i );        Label.setAttribute( "value", FormattedTime );    }       // get week view header items    gHeaderDateItemArray = new Array();    for (var dayIndex = 1; dayIndex <= 7; ++dayIndex) {        var headerDateItem = document.getElementById( "week-header-date-" + dayIndex );        gHeaderDateItemArray[ dayIndex ] = headerDateItem;    }      var weekViewEventSelectionObserver =    {      onSelectionChanged: function( EventSelectionArray ) {          if( EventSelectionArray.length > 0 ) {             //for some reason, this function causes the tree to go into a select / unselect loop             //putting it in a settimeout fixes this.             setTimeout( "gCalendarWindow.weekView.clearSelectedDate();", 1 );                         var i = 0;             for( i = 0; i < EventSelectionArray.length; i++ ) {                 gCalendarWindow.weekView.selectBoxForEvent( EventSelectionArray[i] );             }          } else {             //select the proper day             gCalendarWindow.weekView.hiliteSelectedDate();          }      }   }    calendarWindow.EventSelection.addObserver( weekViewEventSelectionObserver );    var savedThis = this;    var calendarObserver = {        onStartBatch: function() { },        onEndBatch: function() { },        onLoad: function() { },        onAddItem: function(aItem) { savedThis.refreshEvents(); },        onModifyItem: function(aNewItem, aOldItem) { savedThis.refreshEvents(); },        onDeleteItem: function(aDeletedItem) { savedThis.refreshEvents(); },        onAlarm: function(aAlarmItem) {},        onError: function(aErrNo, aMessage) { }    }    calendar = createCalendar();    calendar.addObserver(calendarObserver, calendar.ITEM_FILTER_TYPE_ALL);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/0d3123d1651e988752f5bc0fe68fcd41deb42790/weekView.js/buggy/calendar/resources/content/weekView.js