<!--
 var mese;
 var anno;

function getEasterSunday(yeare)
{
	dayeaster = 0;
	correction = 0;
	if (yeare < 1700) correction = 4;
		else if (yeare < 1800) correction = 5;
		else if (yeare < 1900) correction = 6;
		else if (yeare < 2100) correction = 0;
		else if (yeare < 2200) correction = 1;
		else if (yeare < 2300) correction = 2;
		else if (yeare < 2500) correction = 3;

	dayeaster = (19 * (yeare % 19) + 24) % 30;
	dayeaster = 22 + dayeaster + ((2 * (yeare % 4) + 4 * (yeare % 7) + 6 * dayeaster + 5 + correction) % 7);
	if (dayeaster >= 31) {
		montheaster = 4;
		dayeaster = dayeaster - 31;
	} else {
		montheaster = 3;
	}

  feste[feste.length-4] = yeare;
  feste[feste.length-3] = montheaster;
  feste[feste.length-2] = dayeaster + 1;
}	
 
function fill_table(m,month_length,y,m1)
{ 
  var myc = "<br>"
  var myc1
  day = 1
  
//**********************************************************************//
// per variare i colori del calendario agire sulle seguenti variabili 
  
  var c1 = "#4040FF"      // colore del nome dei giorni della settimana; 
  var c2 = "#C00000"       // colore del nome del giorno "dom";
  var c3 = "#FFFFEF"   // colore di fondo del calendario;
  var c4 = "#993300"   // colore dell'intestazione (nome mese e anno);
  var c5 = "#89FF00"   // colore dello sfondo se vacanza e giorno corrente

//**********************************************************************//
  
  var data_oggi = new Date()
  var gg_oggi = data_oggi.getDate()
  var mm_oggi = data_oggi.getMonth()
  var aa_oggi = data_oggi.getFullYear()

  getEasterSunday (y);
  
  if (start_day == 0)
     start_day = 7;
  
  myc = myc + ("<table border=1 cellspacing=1 cellpadding=0 bgcolor="+c3+">")
  myc = myc + ("<TR><TD COLSPAN=7 ALIGN=center><B><font color="+c4+">"+m+"   "+y+"</font></B></TR><TR>")

  myc = myc + ("<TD ALIGN=center><font size=-1><font color="+c1+"><b>Lu</b></font></font></TD>")
  myc = myc + ("<TD ALIGN=center><font size=-1><font color="+c1+"><b>Ma</b></font></font></TD>")
  myc = myc + ("<TD ALIGN=center><font size=-1><font color="+c1+"><b>Me</b></font></font></TD>")
  myc = myc + ("<TD ALIGN=center><font size=-1><font color="+c1+"><b>Gi</b></font></font></TD>")
  myc = myc + ("<TD ALIGN=center><font size=-1><font color="+c1+"><b>Ve</b></font></font></TD>")
  myc = myc + ("<TD ALIGN=center><font size=-1><font color="+c1+"><b>Sa</b></font></font></TD>")
  myc = myc + ("<TD ALIGN=center><font size=-1><font color="+c2+"><b>Do</b></font></font></TD>")
      
  myc = myc + ("</TR><TR>")
  for (var i=1;i<start_day;i++){
       myc = myc + ("<td bgcolor="+c3+"></td>")
  }
  
  for (var i=start_day;i<8;i++){
	   trovato = 0;
	   eoggi = 0;
	   h = 0;
	   if ((day == gg_oggi) && (m1 == mm_oggi) && (y == aa_oggi)) {
	        myc1 = ("<TD ALIGN=center bgcolor="+c5+"><font size=-1><b>"+day+"</b></font></TD>");   
		eoggi = 1;
		}
	   while (h<feste.length) {
	   	if ((day == feste[h+2]) && (m1 == feste[h+1]-1) && ((feste[h]) == 200 ||(feste[h]) == y)) {
		myc1 = ("<TD class='chie' ALIGN=center "+feste[h+3]+"><font size=-1><b>"+day+"</b></font></TD>");
		trovato = 1;
		if (eoggi) myc1 = ("<TD class='chie' ALIGN=center "+feste[h+3]+" bgcolor="+c5+"><font size=-1><b>"+day+"</b></font></TD>");
		}
	   h=h+4;
	   }	
	   domenica = new Date (y, m1, day);
	   if (domenica.getDay()==0) {
		myc1 = ("<TD ALIGN=center><font size=-1><b><font color="+c2+">"+day+"</font></b></font></TD>");
		trovato = 1;
		if (eoggi) myc1 = ("<TD ALIGN=center bgcolor="+c5+"><font size=-1><b><font color="+c2+">"+day+"</font></b></font></TD>");
		}	      
	   if (!trovato && !eoggi) {
	       myc1 = ("<TD ALIGN=center><font size=-1><b>"+day+"</b></font></TD>");
		}

	   myc = myc + myc1
       day++
  }
  myc = myc + ("</TR><TR>")

  
  while (day <= month_length) {

     for (var i=1;i<=7 && day<=month_length;i++){
	   trovato = 0;
	   eoggi = 0;
	   h = 0;
	   if ((day == gg_oggi) && (m1 == mm_oggi) && (y == aa_oggi)) {
	        myc1 = ("<TD ALIGN=center bgcolor="+c5+"><font size=-1><b>"+day+"</b></font></TD>");
		eoggi = 1;
		}   
	   while (h<feste.length) {
	   	if ((day == feste[h+2]) && (m1 == feste[h+1]-1) && ((feste[h]) == 200 || (feste[h]) == y)) {
		myc1 = ("<TD class='chie' ALIGN=center "+feste[h+3]+"><font size=-1><b>"+day+"</b></font></TD>");
		trovato = 1;
		if (eoggi) myc1 = ("<TD class='chie' ALIGN=center "+feste[h+3]+" bgcolor="+c5+"><font size=-1><b>"+day+"</b></font></TD>");
		}
	   h=h+4;
	   }	
	   domenica = new Date (y, m1, day);
	   if (domenica.getDay()==0) {
		myc1 = ("<TD ALIGN=center><font size=-1><b><font color="+c2+">"+day+"</font></b></font></TD>");
		trovato = 1;
		if (eoggi) myc1 = ("<TD ALIGN=center bgcolor="+c5+"><font size=-1><b><font color="+c2+">"+day+"</font></b></font></TD>");
		}
	   if (!trovato && !eoggi) {
	        myc1 = ("<TD ALIGN=center><font size=-1><b>"+day+"</b></font></TD>");
		}

	   myc = myc + myc1
        day++

     }
	 
     myc = myc + ("</TR><TR>")
//     start_day = i
  }
  myc = myc + ("</TR></TABLE>")
  
  if (document.layers){
      document.layers.bc.document.write(myc)
	  document.layers.bc.document.close()
   }
  else if (document.all)
      bc.innerHTML=myc;
  else {
       var e=document.getElementById("titles");
       e.style.visibility="hidden";
function innerCalendarCode() {
function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11) {
this[0] = m0;
this[1] = m1;
this[2] = m2;
this[3] = m3;
this[4] = m4;
this[5] = m5;
this[6] = m6;
this[7] = m7;
this[8] = m8;
this[9] = m9;
this[10] = m10;
this[11] = m11;
}
function calendar() {
var monthNames = "GenFebMarAprMagGiuLugAgoSetOttNovDic";
var today = new Date();
var thisDay;
var monthDays = new montharr(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
year = today.getYear();
if (year <= 200) {
year += 1900;
}
thisDay = today.getDate();
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {
monthDays[1] = 29;
}
nDays = monthDays[today.getMonth()];
firstDay = today;
firstDay.setDate(1);
testMe = firstDay.getDate();
if (testMe == 2) {
firstDay.setDate(0);
}
startDay = firstDay.getDay();
document.writeln("<CENTER>");
document.write("<TABLE BORDER='1' BGCOLOR=#FFFFEF>");
document.write("<TR><TH COLSPAN=7>");
document.write(monthNames.substring(today.getMonth() * 3, (today.getMonth() + 1) * 3));
document.write(". ");
document.write(year);
document.write("<TR><TH><font size=-2>Do</font><TH><font size=-2>Lu</font><TH><font size=-2>Ma</font><TH><font size=-2>Me</font><TH><font size=-2>Gi</font><TH><font size=-2>Ve</font><TH><font size=-2>Sa</font>");
document.write("<TR>");
column = 0;
for (i = 0; i < startDay; i++) {
document.write("<TD>");
column++;
}
for (i = 1; i <= nDays; i++) {
document.write("<TD>");
if (i == thisDay) {
document.write("<FONT COLOR='#C00000'>");
}
document.write("<font size=-2>"+i+"</font>");
if (i == thisDay) {
document.write("</FONT>");
}
column++;
if (column == 7) {
document.write("<TR>");
column = 0;
}
}
document.write("</TABLE>");
document.writeln("</CENTER>");
}
calendar();
}
innerCalendarCode();
       }
  
}

 
function carica_mese(n)
{
 
 var mydate = new Date()
 var year = mydate.getFullYear()
 var month = mydate.getMonth()
 
 if (n == 0) {
  mese = 0
  anno = 0 }
 else {
  month = mese + n
  year = year + anno }
  
 if (month == 12) {
  anno++
  year++
  month = 0 } 
  
 if (month < 0) {
  anno--
  year--
  month = 11 }   

 if (month == 0) {
   today= new Date("January 1, "+year)
   start_day = today.getDay()
   fill_table("Gennaio",31,year,month) }

 if (month == 1) {
   mfebbraio=28;
	if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {
	mfebbraio = 29;
   }
   today= new Date("February 1, "+year)
   start_day = today.getDay()
   fill_table("Febbraio",mfebbraio,year,month) }
   
 if (month == 2) {
   today= new Date("March 1, "+year)
   start_day = today.getDay()
   fill_table("Marzo",31,year,month) }
 
 if (month == 3) {
   today= new Date("April 1, "+year)
   start_day = today.getDay()
   fill_table("Aprile",30,year,month) } 
   
 if (month == 4) {
   today= new Date("May 1, "+year)
   start_day = today.getDay()
   fill_table("Maggio",31,year,month) }      
 
 if (month == 5) {
   today= new Date("June 1, "+year)
   start_day = today.getDay()
   fill_table("Giugno",30,year,month) }
 
 if (month == 6) {
   today= new Date("July 1, "+year)
   start_day = today.getDay()
   fill_table("Luglio",31,year,month) }

 if (month == 7) {
   today= new Date("August 1, "+year)
   start_day = today.getDay()
   fill_table("Agosto",31,year,month) }
 
 if (month == 8) {
   today= new Date("September 1, "+year)
   start_day = today.getDay()
   fill_table("Settembre",30,year,month) }
 
 if (month == 9) {
   today= new Date("October 1, "+year)
   start_day = today.getDay()
   fill_table("Ottobre",31,year,month) }
 
 if (month == 10) {
   today= new Date("November 1, "+year)
   start_day = today.getDay()
   fill_table("Novembre",30,year,month) }
 
 if (month == 11) {
   today= new Date("December 1, "+year)
   start_day = today.getDay()
   fill_table("Dicembre",31,year,month) }
        
 mese = month;	 
 
}
//--