


// DO NOT EDIT BELOW THIS POINT



function CheckDate(month,dayno)

{

   var retval = new String(dayno);

   var m = month + 1;

   

   for(var app = 0; app < apps.length; app++)

   {

      if(m == apps[app][1] ) //first month

      {

         if(apps[app][3] - apps[app][1] > 0)

         {

            if(dayno >= apps[app][0])

            {

               retval = "<div class='hol' title='" + apps[app][4] + "'>" + dayno + "</div>";

            }

         }

         else

         {

            if(dayno >= apps[app][0] && dayno <= apps[app][2])

            {

               retval = "<div class='hol' title='" + apps[app][4] + "'>" + dayno + "</div>";

            }

         }

      }

      else if(m == apps[app][3]) // second month

      {

         if(dayno <= apps[app][2])

         {

            retval = "<div class='hol' title='" + apps[app][4] + "'>" + dayno + "</div>";

         }

      }

      else if( m > apps[app][1] && m < apps[app][3] )

      {    

         retval = "<div class='hol' title='" + apps[app][4] + "'>" + dayno + "</div>";

      }

   }



   return retval;

}



function PrintMonth(month)

{

   var done = false;

   var day = 0;



   document.write("<table class='inner'><caption><b>" + months[month] + "</b></caption><thead>");

   document.write("<th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th><span class=sat>Sat</div></th><th>Sun</th></thead>");

   while(!done)

   {

      document.write("<tr>");

      PrintWeek(month,day, firstdays[month], daycounts[month]);

      document.write("</tr>");

      day = day + 7;

      if( day > daycounts[month] + firstdays[month])

      {

         done = true;

      }

   }

   document.write("</tbody></table><p>");

}





function PrintWeek(monthno,start,min,max)

{

   var d;

   var desc;

   for(var j = 0; j < 7; j++)

   {

      document.write("<td>");

      d = start + j;

      if(d >= min && d < max + min)

      {

         desc = CheckDate(monthno,d - min + 1);

         document.write(desc);

      }

      document.write("</td>");

   }

}
