After SP1 for SharePoint 2010 some calendar scripts may stop working. We are using this script to determine when calendar loaded (it includes your expand all requirement):
_spBodyOnLoadFunctionNames.push('WaitForCalendarToLoad');
function WaitForCalendarToLoad() {
if (typeof SP.UI.ApplicationPages.CalendarNotify.$4a == 'undefined') {
// post SP1
var pwold$4b = SP.UI.ApplicationPages.CalendarNotify.$4b;
SP.UI.ApplicationPages.CalendarNotify.$4b = function () {
pwold$4b();
ColourCalendar();
}
}
else {
// pre SP1
var pwold$4a = SP.UI.ApplicationPages.CalendarNotify.$4a;
SP.UI.ApplicationPages.CalendarNotify.$4a = function () {
pwold$4a();
ColourCalendar();
}
}
}
function ColourCalendar() {
SP.UI.ApplicationPages.CalendarInstanceRepository.firstInstance().expandAll();
}
It works for me on December 2011 CU.