<!--
/*
################################################################################
#
# Asylum Telecom Reporting System - JavaScript functions for calendar
#
# Copyright Sandor Szabo, (c) 2006-2008.
# Subversion ID: $Id$
# Revised: 2008.06.14.
#
################################################################################
*/

   function dateChanged(calendar)
   {
      // Beware that this function is called even if the end-user only
      // changed the month/year.  In order to determine if a date was
      // clicked you can use the dateClicked property of the calendar:
      if (calendar.dateClicked)
      {
         // OK, a date was clicked, redirect to /yyyy/mm/dd/index.php
         var y = calendar.date.getFullYear();
         var m = calendar.date.getMonth();     // integer, 0..11
         var d = calendar.date.getDate();      // integer, 1..31
         m++;
         // redirect...
         //window.location = "/index.php?sStartDate=" + y + "/" + ((m < 10)?("0" + m):m) + "/" + ((d < 10)?("0" + d):d);
      }
   };

   Calendar.setup(
      {
         flat           : "calendar_container", // ID of the parent element
         flatCallback   : dateChanged,          // our callback function
         firstDay       : 1,                    // First day of week
         date           : InitDate
      }
   );

//-->

