$religious = array();
}
*/
$year = $_REQUEST['year'];
if (!$year) {
    $year = date('Y', time());
}
$next = $year + 1;
$prev = $year - 1;
$holidays = AcademicCalendar::get_holidays($year);
$nav_links = array();
if ($_REQUEST['page'] == 'religious') {
    require "{$page->branch}/religious_text.html";
    //$has_next = isset($religious_days[$next]);
    //$has_prev = isset($religious_days[$prev]);
} else {
    // we should save this data as session variables if we don't
    // want to calculate 3 sets of dates for each page load
    $prev_holidays = AcademicCalendar::get_holidays($prev);
    if (count($prev_holidays) > 0) {
        $prev_url = holidaysURL($prev);
        $nav_links[] = "<a href=\"{$prev_url}\">&lt; {$prev}</a>";
    }
    $next_holidays = AcademicCalendar::get_holidays($next);
    if (count($next_holidays) > 0) {
        $next_url = holidaysURL($next);
        $nav_links[] = "<a href=\"{$next_url}\">{$next} &gt;</a>";
    }
    require "{$page->branch}/holidays.html";
}
$page->output();
					     'catid' => $subcatObject->catid);
       }
     }
     $data[] = $catData;
   }
   break;

 case 'holidays': case 'academic':
   // TODO: see whether any of this code can be consolidated with
   // mobi-web/calendar/academic.php and mobi-web/calendar/holidays.php
   require_once LIBDIR . "AcademicCalendar.php";
   $month = isset($_REQUEST['month']) ? $_REQUEST['month'] : date('n');
   $year = isset($_REQUEST['year']) ? $_REQUEST['year'] : date('Y');

   if ($_REQUEST['command'] == 'holidays') {
     $events = AcademicCalendar::get_holidays($year);
   } else {
     $events = AcademicCalendar::get_events($month, $year);
   }

   foreach ($events as $event) {
     /*
     $event_dict = Array();
     // we'll give the event a random unique ID since there's nothing
     // useful we can do with it on the backend
     $event_dict['id'] = crc32($event->get_uid()) >> 1; // 32 bit unsigned before shift
     $event_dict['title'] = $event->get_summary();
     $event_dict['start'] = $event->get_start();
     $event_dict['end'] = $event->get_end();
     // location and description are always blank but just for completeness...
     if ($location = $event->get_location()) {