rem: setElementValue("item-alarm", "custom"); 
add:  var offset = item.alarmOffset; if (offset.minutes) { var minutes = offset.minutes + offset.hours*60 + offset.days*24*60 + offset.weeks*60*24*7;  if (minutes == 15) { document.getElementById("item-alarm").selectedIndex = 2; } else if (minutes == 30) { document.getElementById("item-alarm").selectedIndex = 3; } else { setElementValue("alarm-length-field", minutes); setElementValue("alarm-length-units", "minutes"); setElementValue("item-alarm", "custom"); } } else if (offset.hours) { var hours = offset.hours + offset.days*24 + offset.weeks*24*7; setElementValue("alarm-length-field", hours); setElementValue("alarm-length-units", "hours"); setElementValue("item-alarm", "custom"); } else { var days = offset.days + offset.weeks*7; setElementValue("alarm-length-field", days); setElementValue("alarm-length-units", "days"); setElementValue("item-alarm", "custom"); } 
context: function loadDetails() {    gDetailsShown = true;    var item = window.calendarItem;    /* attendence */    var attendeeString = "";    var attendeeListBox = document.getElementById("attendees-listbox");    var child;    while ((child = attendeeListBox.lastChild) && (child.tagName == "listitem")) {        attendeeListBox.removeChild(child);    }    for each (var attendee in item.getAttendees({})) {        var listItem = document.createElement("listitem");        var nameCell = document.createElement("listcell");        nameCell.setAttribute("label", attendee.id.split("MAILTO:")[1]);        listItem.appendChild(nameCell);        listItem.attendee = attendee;        attendeeListBox.appendChild(listItem);    }    /* Status */    setElementValue("item-url",         item.getProperty("URL"));    setElementValue("item-description", item.getProperty("DESCRIPTION"));    if (isEvent(item)) {        setElementValue("event-status", item.getProperty("STATUS"));    } else {        setElementValue("todo-status", item.getProperty("STATUS"));    }    /* Task completed date */    if (item.completedDate) {        updateToDoStatus(item.status, item.completedDate.jsDate);    } else {        updateToDoStatus(item.status);    }    /* Priority */    var priorityInteger = parseInt(item.priority);    if (priorityInteger >= 1 && priorityInteger <= 4) {        document.getElementById("priority-levels").selectedIndex = 3; // high priority    } else if (priorityInteger == 5) {        document.getElementById("priority-levels").selectedIndex = 2; // medium priority    } else if (priorityInteger >= 6 && priorityInteger <= 9) {        document.getElementById("priority-levels").selectedIndex = 1; // low priority    } else {        document.getElementById("priority-levels").selectedIndex = 0; // not defined    }    /* Privacy */    switch (item.privacy) {        case "PUBLIC":        case "PRIVATE":        case "CONFIDENTIAL":            setElementValue("privacy-menulist", item.privacy);            break;        case "":            setElementValue("private-menulist", "PUBLIC");            break;        default:  // bogus value            dump("ERROR! Event has invalid privacy string: " + item.privacy + "\n");            break;    }    /* alarms */    if (item.alarmTime) {        var alarmLength = item.getProperty("alarmLength");        if (alarmLength != null) {            setElementValue("alarm-length-field", alarmLength);            setElementValue("alarm-length-units", item.getProperty("alarmUnits"));            setElementValue("alarm-trigger-relation", item.getProperty("alarmRelated"));        }        setElementValue("item-alarm", "custom");    }    // update alarm checkbox/label/settings button    updateAlarm();    updateTaskAlarmWarnings();}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/24e6bb82600f00466ed33ae7f2c3b625e5f5591c/calendar-event-dialog.js/clean/calendar/base/content/calendar-event-dialog.js