rem: setElementValue("percent-complete-menulist", item.getProperty("PERCENT-COMPLETE")); 
add: var percentCompleteInteger = 0; var percentCompleteProperty = item.getProperty("PERCENT-COMPLETE"); if (percentCompleteProperty != null) { percentCompleteInteger = parseInt(percentCompleteProperty); } if (percentCompleteInteger < 0) { percentCompleteInteger = 0; } else if (percentCompleteInteger > 100) { percentCompleteInteger = 100; } setElementValue("percent-complete-textbox", percentCompleteInteger); 
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);    }    /* Task percent complete */    if (isToDo(item)) {        setElementValue("percent-complete-menulist", item.getProperty("PERCENT-COMPLETE"));    }    /* 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.alarmOffset) {        var alarmRelatedStart = (item.alarmRelated == item.ALARM_RELATED_START);        if (alarmRelatedStart) {            setElementValue("alarm-trigger-relation", "START");        } else {            setElementValue("alarm-trigger-relation", "END");        }        var offset = item.alarmOffset;        if (offset.minutes) {            var minutes = offset.minutes + offset.hours*60 + offset.days*24*60 + offset.weeks*60*24*7;            // Special cases for the common alarms            if ((minutes == 15) && alarmRelatedStart) {                document.getElementById("item-alarm").selectedIndex = 2;            } else if ((minutes == 30) && alarmRelatedStart) {                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 { // days            var days = offset.days + offset.weeks*7;            setElementValue("alarm-length-field", days);            setElementValue("alarm-length-units", "days");            setElementValue("item-alarm", "custom");        }    }    // update alarm checkbox/label/settings button    updateAlarm();    updateTaskAlarmWarnings();}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/0b2d2bb554a6d3d9f4a4ace64372d39935a45385/calendar-event-dialog.js/clean/calendar/base/content/calendar-event-dialog.js