rem: var parentPrefWindow = document.getElementById("CalendarPreferences"); 
add: var parentPrefWindow = document.getElementById("CalendarPreferences") || document.getElementById("MailPreferences"); 
context:     init: function () {        // On non-instant-apply platforms, once this pane has been loaded,        // attach our "revert all changes" function to the parent prefwindow's        // "ondialogcancel" event.        var parentPrefWindow = document.getElementById("CalendarPreferences");        if (!parentPrefWindow.instantApply) {            var existingOnDialogCancel = parentPrefWindow.getAttribute("ondialogcancel");            parentPrefWindow.setAttribute("ondialogcancel",                                          "gCategoriesPane.panelOnCancel(); " +                                           existingOnDialogCancel);        }        // A list of preferences to be reverted when the dialog is cancelled.        // It needs to be a property of the parent to be visible onCancel        if (!parent.backupPrefList) {            parent.backupPrefList = [];        }        var categories = document.getElementById("calendar.categories.names").value;        gCategoryList = categories.split(",");        this.updateCategoryList();    },
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8395/031d5088853d280bd785a4ac0825fe5ebf3746a6/categories.js/buggy/calendar/base/content/preferences/categories.js