rem: window.onAcceptCallback = args.onOk; window.calendarItem = args.calendarEvent; window.accept = [true, true]; 
add: var item = args.calendarEvent; var calendar = item.calendar; var recinfo = args.recurrenceInfo;  gStartTime = args.startTime; gEndTime = args.endTime;   document.getElementById("period-list").selectedIndex = 0;  onChangeCalendar(calendar);   setElementValue("repeat-until-date", gStartTime);  if (item.parentItem != item) { item = item.parentItem; }  if (recinfo) {  var rrules = splitRecurrenceRules(recinfo); var rules = rrules[0]; var exceptions = rrules[1];   if (rules.length > 0) {  var rule = rules[0]; if (rule instanceof Ci.calIRecurrenceRule) { switch (rule.type) { case "DAILY": document.getElementById("period-list").selectedIndex = 0; setElementValue("daily-days", rule.interval); var ruleComp = rule.getComponent("BYDAY", {}); if (ruleComp.length > 0) { document.getElementById("daily-group").selectedIndex = 1; } else { document.getElementById("daily-group").selectedIndex = 0; } break; case "WEEKLY": document.getElementById("period-list").selectedIndex = 1; setElementValue("weekly-weeks", rule.interval); var days = rule.getComponent("BYDAY", {}); document.getElementById("datepicker-weekday").days = days; break; case "MONTHLY": document.getElementById("period-list").selectedIndex = 2; setElementValue("monthly-interval", rule.interval); var ruleComp = rule.getComponent("BYDAY", {}); if (ruleComp.length > 0) { document.getElementById("monthly-group").selectedIndex = 0; var byday = ruleComp[0]; var occurrence = (byday - (byday % 8)) / 8; var weekday = byday % 8; setElementValue("monthly-ordinal", occurrence); setElementValue("monthly-weekday", weekday); } else { var ruleComp = rule.getComponent("BYMONTHDAY", {}); if (ruleComp.length > 0) { document.getElementById("monthly-group").selectedIndex = 1; document.getElementById("monthly-days").days = ruleComp; } } break; case "YEARLY": document.getElementById("period-list").selectedIndex = 3; setElementValue("yearly-interval", rule.interval); var byMonthRule = rule.getComponent("BYMONTH", {}); var byDayRule = rule.getComponent("BYDAY", {}); var byMonthDayRule = rule.getComponent("BYMONTHDAY", {}); if (byMonthRule.length > 0) { if (byMonthDayRule.length > 0) { document.getElementById("yearly-group").selectedIndex = 0; setElementValue("yearly-month-ordinal", byMonthRule[0]); setElementValue("yearly-days", byMonthDayRule[0]); } else if (byDayRule.length > 0) { document.getElementById("yearly-group").selectedIndex = 1; var byday = byDayRule[0]; var occurrence = (byday - (byday % 8)) / 8; var weekday = byday % 8; setElementValue("yearly-ordinal", occurrence); setElementValue("yearly-weekday", weekday); setElementValue("yearly-month-rule", byMonthRule[0]); } } break; default: dump("unable to handle your rule type!\n"); break; }  /* load up the duration of the event radiogroup */ if (rule.isByCount) { if (rule.count == -1) { setElementValue("recurrence-duration", "forever"); } else { setElementValue("recurrence-duration", "ntimes"); setElementValue("repeat-ntimes-count", rule.count ); } } else { var endDate = rule.endDate; if (!endDate) { setElementValue("recurrence-duration", "forever"); } else {  endDate = endDate.getInTimezone(calendarDefaultTimezone()); setElementValue("recurrence-duration", "until"); setElementValue("repeat-until-date", endDate.jsDate); } } } } }   updateRecurrenceDeck();  
context: function onLoad() {    var args = window.arguments[0];    window.onAcceptCallback = args.onOk;    window.calendarItem = args.calendarEvent;    window.accept = [true, true];    opener.setCursor("auto");    self.focus();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/5ad249d310bc7692bf197bf61f3eebe13873ecae/sun-calendar-event-dialog-recurrence.js/buggy/calendar/prototypes/wcap/sun-calendar-event-dialog-recurrence.js