 gIsReadOnly = false; if (calendar && calendar.readOnly) { gIsReadOnly = true; } else {  try { var userID = ""; var ownerID = ""; var organizerID = "";  var organizer = window.organizer; var provider = calendar.QueryInterface(Components.interfaces.calIWcapCalendar); ownerID = provider.ownerId; userID = provider.session.userId; organizerID = ((organizer == null || organizer.id == null) ? ownerID : organizer.id);  if(ownerID != organizerID) gIsReadOnly = true; } catch(e) {} } 
gIsReadOnly = true; if(calendar) gIsReadOnly = calendar.readOnly; 
function updateCalendar(){  var item = window.calendarItem;  var calendar = document.getElementById("item-calendar").selectedItem.calendar;  // set 'gIsReadOnly' if the calendar is read-only  gIsReadOnly = false;  if (calendar && calendar.readOnly) {    gIsReadOnly = true;  } else {      try {      var userID = "";      var ownerID = "";      var organizerID = "";          var organizer = window.organizer;      var provider = calendar.QueryInterface(Components.interfaces.calIWcapCalendar);      ownerID = provider.ownerId;      userID = provider.session.userId;      organizerID = ((organizer == null || organizer.id == null)                      ? ownerID // sensible default                      : organizer.id);      if(ownerID != organizerID)        gIsReadOnly = true;    }    catch(e) {}  }  // update the accept button  updateAccept();  // TODO: the code above decided about whether or not the item is readonly.  // below we enable/disable all controls based on this decision. unfortunately  // some controls need to be disabled based on some other criteria. this is why  // we enable all controls in case the item is *not* readonly and run through  // all those updateXXX() functions to disable them again based on the  // specific logic build into those function. is this really a good idea?  if(gIsReadOnly) {    var disableElements = document.getElementsByAttribute("disable-on-readonly", "true");    for (var i=0;i<disableElements.length;i++) {      disableElements[i].setAttribute('disabled', 'true');            // we mark link-labels with the hyperlink attribute, since we need to      // remove their class in case they get disabled. TODO: it would be better      // to create a small binding for those link-labels instead of adding      // those special stuff.      if(disableElements[i].hasAttribute('hyperlink')) {        disableElements[i].removeAttribute('class');        disableElements[i].removeAttribute('onclick');      }    }    var collapseElements = document.getElementsByAttribute("collapse-on-readonly", "true");    for (var i=0;i<collapseElements.length;i++) {      collapseElements[i].setAttribute('collapsed', 'true');    }      } else {      var enableElements = document.getElementsByAttribute("disable-on-readonly", "true");    for (var i=0;i<enableElements.length;i++) {      enableElements[i].removeAttribute('disabled');      if(enableElements[i].hasAttribute('hyperlink'))        enableElements[i].setAttribute('class','text-link');    }    var collapseElements = document.getElementsByAttribute("collapse-on-readonly", "true");    for (var i=0;i<collapseElements.length;i++) {      collapseElements[i].removeAttribute('collapsed');    }    // Task completed date    if (item.completedDate) {        updateToDoStatus(item.status, item.completedDate.jsDate);    } else {        updateToDoStatus(item.status);    }    // disable repeat menupopup if this is an occurrence    var item = window.calendarItem;    if(item.parentItem != item) {      disableElement("item-repeat");      var repeatDetails = document.getElementById("repeat-details");      var numChilds = repeatDetails.childNodes.length;      for (var i = 0; i < numChilds; i++) {        var node = repeatDetails.childNodes[i];        node.setAttribute('disabled', 'true');        node.removeAttribute('class');        node.removeAttribute('onclick');      }    }    // if the item is a proxy occurrence/instance, a few things aren't valid.    if (item.parentItem != item) {      setElementValue("item-calendar", "true", "disabled");      // don't allow to revoke the entrydate of recurring todo's.      disableElement("todo-has-entrydate");    }        // don't allow to revoke the entrydate of recurring todo's.    if(window.recurrenceInfo)      disableElement("todo-has-entrydate");        // update datetime pickers    updateDueDate();    updateEntryDate();    // update datetime pickers    updateAllDay();  }}
5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5872/1a240a4cb2ccad8965aa17a000d98f60ed7a1fef/sun-calendar-event-dialog.js/clean/calendar/prototypes/wcap/sun-calendar-event-dialog.js