function getElement(id) {return document.getElementById ? document.getElementById(id) : document.all[id];};
function buildCal(m, y, cM, cH, cDW, cD, brdr, id){
if (m>12){m=1; y++;}
if (m<1){m=12; y--;}
var mn=['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'];
var dim=[31,0,31,30,31,30,31,31,30,31,30,31];
var oD = new Date(y, m-1, 0); //DD replaced line to fix date bug when current day is 31st
oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st
var lunedi=0;
var todaydate=new Date() //DD added
var scanfortoday=(y==todaydate.getFullYear() && m==todaydate.getMonth()+1)? todaydate.getDate() : 0 //DD added
dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
var t='
';
t+=' ';
t+=' | ';
t+=''+mn[m-1]+' - '+y+'';
t+=' | ';
t+=' ';
t+=' |
';
for(s=0;s<7;s++)t+='| '+"LMMGVSD".substr(s,1)+' | ';
t+='
';
for(i=1;i<=42;i++){
var x='';
if ((i-oD.od>=0)&&(i-oD.od' //DD added
else if (x=='')
x=' ';
if ((xold==' ')&&(x!=' '))
lunedi++;
n_cD=((i)%7==1)?'first':cD;
t+='| '+x+' | ';
if(((i)%7==0)&&(i<36)){t+='
';lunedi=nday+1}
}
t+='
';
getElement(id).innerHTML=t;
}
var todaydate=new Date()
var curmonth=todaydate.getMonth()+1 //get current month (1-12)
var curyear=todaydate.getFullYear() //get current year
function calendar_on_load(){
buildCal(curmonth, curyear, "calendar", "month", "daysofweek", "days", 1,'calendar');
}
/* for Mozilla/Opera9 */
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", calendar_on_load, false);
}
/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
document.write("