
function print_calendar(the_index)
{
      var now = new Date();
      var months = new Array( "January", "February", "March", "April",
                                "May", "June", "July", "August", "September",
                                "October", "November", "December" );
      numCalendarMonths = 12;
	  firstIndex = -1;
      function fixYear( year )
      {
        return( year < 1000 ? year + 1900 : year );
      }
      
      function getNumberDays( d )
      {
        switch( d.getMonth() + 1 )
        {
          case 1: case 3: case 5: case 7:
          case 8: case 10: case 12:
            return( 31 );
          case 4: case 6: case 9: case 11:
            return( 30 );
          case 2:
            return( 28 + ( d.getYear % 4 == 0 ? 1 : 0 ) );
        }
      }

document.write('<table border="1" cellpadding="2">');

for (monthIndex = firstIndex; monthIndex < numCalendarMonths; monthIndex++)
{
  document.write('<tr><td colspan="7" align="center"> <b><i><font size="1"> ');
  month = new Date( fixYear( now.getYear() ), now.getMonth() + monthIndex, 1 );
  document.write( months[month.getMonth()] + " " +  
  fixYear( month.getYear() ) );
  document.write('</font></i></b></td></tr><tr>');
  document.write('<td width="14%"><i><font size="1">Su</font></i></td>' +
    '<td width="14%"><i><font size="1">Mo</font></i></td>' +
    '<td width="14%"><i><font size="1">Tu</font></i></td>' +
    '<td width="14%"><i><font size="1">We</font></i></td>' +
    '<td width="14%"><i><font size="1">Th</font></i></td>' +
    '<td width="14%"><i><font size="1">Fr</font></i></td>' +
    '<td width="14%"><i><font size="1">Sa</font></i></td>');
  document.write('</tr><tr>');

  var startDay = month.getDay();
  for( i = 0 ; i < startDay ; i++ )
  {
    document.write( "<td></td>" );
  }

  var numDays = getNumberDays( month );
  for( i = 0 ; i < numDays ; i++ )
  {
    if( ( i + startDay + 1 ) % 7 == 1 )
    {
      document.write( "</tr><tr>" );
    }
  if (!((i == (now.getDate() - 1)) && (monthIndex == 0)))
    document.write( "<td height='20' valign='top'> <font size='1'>" +
                                     (i+1) + "</font></td>" ); 
  else
    document.write( "<td height='20' bgcolor='#CCFFCC' valign='top'> <font size='1'><b><u>" +
                                     (i+1) + "</font></b></u></td>" ); 
  }
  document.write('</tr>');
}
document.write('</table>');

}


