<!--

var months = ["January","February","March","April","May","June","July","August","September","October","November","December"];

var daycounts = [31,28,31,30,31,30,31,31,30,31,30,31]; //for leap years, remember to set february to 29 days

//2002 firstdays = [1,4,4,0,2,5,0,3,6,1,4,6] 1=Tue,2=Wed,3=Thu,4=Fri,5=SAT,6=sUN,7=MON;

//2004 firstdays = [3,6,7,3,5,1,3,6,2,4,0,2];

//2005 firstdays = [5,1,1,4,6,2,4,7,3,5,1,3];

//2006 firstdays = [6,2,2,5,7,3,5,1,4,6,2,4];

//2007 firstdays = [7,3,3,6,1,4,6,2,5,7,3,5];

//2008 firstdays = [1,4,5,1,3,6,1,4,7,2,5,7];

//2009 firstdays = [3,6,6,2,4,7,2,5,1,3,6,1];

//2010 firstdays = [4,7,7,3,5,1,3,6,2,4,7,2];

var firstdays = [5,1,1,4,6,2,4,7,3,5,1,3];


//=====================================================
//		CUSTOMIZE THE CALENDAR
//=====================================================
// This is where you can put in the appointments.  
//follow pattern [from day,from month,to day,to month, message]


var apps = [ 
[17,04,01,05,"Booked by Rorvik Family"],
[15,05,22,05,"Booked by Rorvik Family"],
[29,05,05,06,"Booked by Rorvik Family"]
];

//=====================================================
//		END CUSTOMIZATION
//=====================================================


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='giorno_evento' title='" + apps[app][4] + "'>" + dayno + "</div>";

            }

         }

         else

         {

            if(dayno >= apps[app][0] && dayno <= apps[app][2])

            {

               retval = "<div class='giorno_evento' title='" + apps[app][4] + "'>" + dayno + "</div>";

            }

         }

      }

      else if(m == apps[app][3]) // second month

      {

         if(dayno <= apps[app][2])

         {

            retval = "<div class='giorno_evento' title='" + apps[app][4] + "'>" + dayno + "</div>";

         }

      }

      else if( m > apps[app][1] && m < apps[app][3] )

      {    

         retval = "<div class='giorno_evento' title='" + apps[app][4] + "'>" + dayno + "</div>";

      }

   }



   return retval;

}



function PrintMonth(month){
   var done = false;
   var day = 0;

   document.write("<table class='tab_interna' border=0 bordercolor='red' valign='top'>");
   document.write("<tr><td align='center' colspan='7'><span class='txt_month'>");
   document.write("" + months[month] + "</span></td></tr>");
   document.write("<tr><td><b>Mon</b></td><td><b>Tue</b></td><td><b>Wed</b></td>");
   document.write("<td><b>Thu</b></td><td><b>Fri</b></td><td><b>Sat</b></td><td><b>Sun</b></td></tr>");
   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>");
}


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>");
   }
}
// -->
