rem: if (!this.allstories.size() || !this.preferences.get("archive")) 
add: if (!this.allstories.size() || !this.properties.get("archive")) 
context: Site.prototype.calendar_macro = function(param) {   // do nothing if there is not a single story :-))   // or if archive of this site is disabled   if (!this.allstories.size() || !this.preferences.get("archive"))      return;   // define variables needed in this function   var calParam = new Object();   var dayParam = new Object();   var weekParam = new Object();   res.push();   // create new calendar-object   var cal = java.util.Calendar.getInstance(this.getTimeZone(), this.getLocale());   var symbols = this.getDateSymbols();   // render header-row of calendar   var firstDayOfWeek = cal.getFirstDayOfWeek();   var weekdays = symbols.getShortWeekdays();   res.push();   for (var i=0;i<7;i++) {      dayParam.day = weekdays[(i+firstDayOfWeek-1)%7+1];      this.renderSkin("calendardayheader", dayParam);   }   weekParam.week = res.pop();   this.renderSkin("calendarweek", weekParam);   cal.set(java.util.Calendar.DATE, 1);   // check whether there's a day or a story in path   // if so, use it to determine the month to render   if (path.Story)      var today = path.Story.day.toString();   else if (path.Day && path.Day._prototype == "Day")      var today = path.Day.groupname.toString();   if (today) {      // instead of using String.toDate      // we do it manually here to avoid that a day like 20021001      // would be changed to 20020930 in some cases      cal.set(java.util.Calendar.YEAR, parseInt(today.substring(0, 4), 10));      cal.set(java.util.Calendar.MONTH, parseInt(today.substring(4, 6), 10)-1);   }   // nr. of empty days in rendered calendar before the first day of month appears   var pre = (7-firstDayOfWeek+cal.get(java.util.Calendar.DAY_OF_WEEK)) % 7;   var days = cal.getActualMaximum(java.util.Calendar.DATE);   var weeks = Math.ceil((pre + days) / 7);   var daycnt = 1;   var monthNames = symbols.getMonths();   calParam.month = monthNames[cal.get(java.util.Calendar.MONTH)];   calParam.year =  cal.get(java.util.Calendar.YEAR);   // pre-render the year and month so we only have to append the days as we loop   var currMonth = formatTimestamp(new Date(cal.getTime().getTime()), "yyyyMM");   // remember the index of the first and last days within this month.   // this is needed to optimize previous and next month links.   var lastDayIndex = 9999999;   var firstDayIndex = -1;   for (var i=0;i<weeks;i++) {      res.push();      for (var j=0;j<7;j++) {         dayParam.skin = "calendarday";         if ((i == 0 && j < pre) || daycnt > days)            dayParam.day = "&nbsp;";         else {            var currGroupname = currMonth+daycnt.format("00");            var linkText = daycnt < 10 ? "&nbsp;" + daycnt + "&nbsp;" : daycnt.toString();            var currGroup = this.get(currGroupname);            if (currGroup) {               var idx = this.contains(currGroup);               if (idx > -1) {                  if  (idx > firstDayIndex)                     firstDayIndex = idx;                  if (idx < lastDayIndex)                     lastDayIndex = idx;               }               dayParam.day = Html.linkAsString({href: currGroup.href()}, linkText);            } else {               dayParam.day = linkText;            }            if (currGroupname == today)               dayParam.skin = "calendarselday";            daycnt++;         }         this.renderSkin(dayParam.skin, dayParam);      }      weekParam.week = res.pop();      this.renderSkin("calendarweek", weekParam);   }   // set day to last day of month and try to render next month   // check what the last day of the month is   calParam.back = this.renderLinkToPrevMonth(firstDayIndex, currMonth + "01", monthNames);   calParam.forward = this.renderLinkToNextMonth(lastDayIndex, currMonth + "31", monthNames);   calParam.calendar = res.pop();   this.renderSkin("calendar", calParam);   return;};
meta: 993	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/993/d46237ae5555045222f493137c5c51dbcd7b4033/Site.js/clean/code/Site/Site.js