rem:  var duration = Components.classes["@mozilla.org/calendar/duration;1"] .createInstance(Components.interfaces.calIDuration); if (item.alarmRelated == Components.interfaces.calIItemBase.ALARM_RELATED_START) { duration.isNegative = true; } duration[reminder.unit] = Number(reminder.length); duration.normalize();  item.alarmOffset = duration; 
context: function saveReminder(item) {    var reminderPopup = document.getElementById("item-alarm");  if (reminderPopup.value == 'none') {    item.alarmOffset = null;    item.alarmLastAck = null;    item.alarmRelated = null;  }  else {      var menuitem = reminderPopup.selectedItem;        // custom reminder entries carry their own reminder object    // with them, pre-defined entries specify the necessary information    // as attributes attached to the menuitem elements.    var reminder = menuitem.reminder;    if (!reminder) {      reminder = {};      reminder.length = menuitem.getAttribute('length');      reminder.unit = menuitem.getAttribute('unit');      reminder.relation = menuitem.getAttribute('relation');    }      if (reminder.relation == "START") {        item.alarmRelated = Components.interfaces.calIItemBase.ALARM_RELATED_START;    } else {        item.alarmRelated = Components.interfaces.calIItemBase.ALARM_RELATED_END;    }    var duration = Components.classes["@mozilla.org/calendar/duration;1"]                             .createInstance(Components.interfaces.calIDuration);    if (item.alarmRelated == Components.interfaces.calIItemBase.ALARM_RELATED_START) {        duration.isNegative = true;    }    duration[reminder.unit] = Number(reminder.length);    duration.normalize();    item.alarmOffset = duration;  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d57904dc7e20eb84ecd606bdbe53b35bd378e262/sun-calendar-event-dialog.js/buggy/calendar/prototypes/wcap/sun-calendar-event-dialog.js