rem: var relation = "START"; 
add: var relation = "END"; 
context: function loadReminder(item){  // select 'no reminder' by default  var reminderPopup = document.getElementById("item-alarm");  reminderPopup.selectedIndex = 0;  gLastAlarmSelection = 0;  if (!item.alarmOffset)    return;    // try to match the reminder setting with the available popup items  var matchingItem = null;    var menuItems = reminderPopup.getElementsByTagName("menuitem");  var numItems = menuItems.length;  for(var i=0; i<numItems; i++) {    var menuitem = menuItems[i];    if(menuitem.hasAttribute("length")) {      var origin = "1";      if(item.alarmRelated == Components.interfaces.calIItemBase.ALARM_RELATED_END)        origin = "-1";      var duration = item.alarmOffset.clone();      var relation = "START";      if(duration.isNegative) {        duration.isNegative = false;        duration.normalize();        relation = "END";      }      if(menuitem.getAttribute("origin") == origin) {        if(menuitem.getAttribute("relation") == relation) {          var unit = menuitem.getAttribute("unit");          var length = menuitem.getAttribute("length");          if(unit == "minutes" && item.alarmOffset.minutes == length) {            matchingItem = menuitem;            break;          } else if(unit == "hours" && item.alarmOffset.hours == length) {            matchingItem = menuitem;            break;          } else if(unit == "days" && item.alarmOffset.days == length) {            matchingItem = menuitem;            break;          }        }      }    }  }  if(matchingItem) {      var numChilds = reminderPopup.childNodes[0].childNodes.length;    for(var i=0; i<numChilds; i++) {      var node = reminderPopup.childNodes[0].childNodes[i];      if(node == matchingItem) {        reminderPopup.selectedIndex = i;        break;      }    }  }  else {      reminderPopup.value = 'custom';    var customReminder = document.getElementById("reminder-custom-menuitem");    var reminder = {};    if(item.alarmRelated == Components.interfaces.calIItemBase.ALARM_RELATED_START) {      reminder.origin = "1";    } else {      reminder.origin = "-1";    }    var offset = item.alarmOffset.clone();    var relation = "START";    if(offset.isNegative) {      offset.isNegative = false;      offset.normalize();      relation = "END";    }    reminder.relation = relation;    if (offset.minutes) {      var minutes = offset.minutes + offset.hours*60 + offset.days*24*60 + offset.weeks*60*24*7;      reminder.unit = 'minutes';      reminder.length = minutes;    } else if (offset.hours) {      var hours = offset.hours + offset.days*24 + offset.weeks*24*7;      reminder.unit = 'hours';      reminder.length = hours;    } else {      var days = offset.days + offset.weeks*7;      reminder.unit = 'days';      reminder.length = days;    }    customReminder.reminder = reminder;  }  // remember the selected index  gLastAlarmSelection = reminderPopup.selectedIndex;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/867bfb0900d1ea596d81462142bd2b6ef5dd9e7a/sun-calendar-event-dialog.js/clean/calendar/prototypes/wcap/sun-calendar-event-dialog.js