rem: var calendar = ltnSelectedCalendar(); 
add: var calendar = getSelectedCalendar(); 
context: function agendaDoubleClick(event){    // We only care about left-clicks    if (event.button != 0)         return;    // Find the row clicked on, and the corresponding event    var tree = document.getElementById("agenda-tree");    var row = tree.treeBoxObject.getRowAt(event.clientX, event.clientY);    var calendar = ltnSelectedCalendar();    var calEvent = this.events[row];    if (!calEvent) { // Clicked in empty space, just create a new event        createEventWithDialog(calendar, today(), today());        return;    }    if (!this.isContainer(row)) { // Clicked on a task/event, edit it        var eventToEdit = getOccurrenceOrParent(calEvent);        modifyEventWithDialog(eventToEdit);    } else { // Clicked on a container, create an event that day        if (calEvent == this.today) {            createEventWithDialog(calendar, today(), today());        } else {            var tom = today().clone();            var offset = (calEvent == this.tomorrow) ? 1 : 2;            tom.day += offset;            tom.normalize()            createEventWithDialog(calendar, tom, tom);        }    }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/b8864004460ce22942cdc33e51e57d6af6e2fce2/agenda-tree.js/buggy/calendar/lightning/content/agenda-tree.js