<!-- Begin
function makecal(act,year,month,today){

//  SET ARRAYS
var day_of_week = new Array('Do','Lu','Ma','Me','Gi','Ven','Sa'); 
var month_of_year =new Array('Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre');

//  DECLARE AND INITIALIZE VARIABLES
var Calendar = new Date();
var giorno ="";
var argnum = makecal.arguments.length;
if(argnum >1)
{
 Calendar.setYear(year)
 Calendar.setMonth(month);
 Calendar.setDate(today);
}

if((argnum == 4) || (argnum ==1))
{
var act_array = act.split(";");
var attivita=act_array.pop();
}

// Change this to your favourite font types and size for all the text
var fontface = 'Verdana, Arial, Helvetica';
var fontsize = '1'; 

var year = Calendar.getYear();	    // Returns year
var month = Calendar.getMonth();    // Returns month (0-11)
var today = Calendar.getDate();    // Returns day (1-31)
var weekday = Calendar.getDay();    // Returns day (1-31)

var DAYS_OF_WEEK = 7;    // "constant" for number of days in a week
var DAYS_OF_MONTH = 31;    // "constant" for number of days in a month
var cal;    // Used for printing

Calendar.setDate(1);    // Start the calendar day at '1'
Calendar.setMonth(month);    // Start the calendar month at now


/* VARIABLES FOR FORMATTING
NOTE: You can format the 'BORDER', 'BGCOLOR', 'CELLPADDING', 'BORDERCOLOR'
      tags to customize your calendar's look. */

var TR_start = '<TR>';
var TR_end = '</TR>';
var highlight_start = '<TD ALIGN="CENTER" ><TABLE CELLSPACING=0 BORDER=1 BGCOLOR=DEDEFF BORDERCOLOR=CCCCCC><TR><TD WIDTH=2><FONT FACE="' + fontface + '" SIZE="' + fontsize +'"><B>';
var highlight_end   = '</B></FONT></TD></TR></TABLE>';
var TD_start = '<TD ALIGN="CENTER"><FONT FACE="' + fontface + '" SIZE="' + fontsize +'">';
var TD_end = '</FONT></TD>';

/* BEGIN CODE FOR CALENDAR
NOTE: You can format the 'BORDER', 'BGCOLOR', 'CELLPADDING', 'BORDERCOLOR'
tags to customize your calendar's look.*/

cal =  '<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0 BORDERCOLOR=BBBBBB><TR><TD>';
cal += '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2>' + TR_start;
cal += '<TD ALIGN="CENTER" COLSPAN="' + DAYS_OF_WEEK + '" BGCOLOR="#EFEFEF"><FONT FACE="' + fontface + '" SIZE="' + fontsize +'"><B>';
cal += month_of_year[month]  + ' &nbsp;&nbsp;' + year + '</B>' + TD_end + TR_end;
cal += TR_start;

//   DO NOT EDIT BELOW THIS POINT  //


// LOOPS FOR EACH DAY OF WEEK: stampa la linea con i nomi dei giorni
for(index=0; index < DAYS_OF_WEEK; index++)
{

// BOLD TODAY'S DAY OF WEEK
if(weekday == index)
cal += TD_start + '<B>' + day_of_week[index] + '</B>' + TD_end;

// PRINTS DAY
else
cal += TD_start + day_of_week[index] + TD_end;
}
//--------------------


cal += TD_end + TR_end;
cal += TR_start;

// FILL IN BLANK GAPS UNTIL TODAY'S DAY
for(index=0; index < Calendar.getDay(); index++)
cal += TD_start + '&nbsp; ' + TD_end;
//--------------------

// LOOPS FOR EACH DAY IN CALENDAR: stampa i numeri dei giorni
for(index=0; index < DAYS_OF_MONTH; index++)
{
	if( Calendar.getDate() > index )
	{
		  // RETURNS THE NEXT DAY TO PRINT
		  week_day =Calendar.getDay();
		
		  // START NEW ROW FOR FIRST DAY OF WEEK
		  if(week_day == 0) cal += TR_start;
		
		  if(week_day != DAYS_OF_WEEK)
		  {
			  // SET VARIABLE INSIDE LOOP FOR INCREMENTING PURPOSES
			  var day  = Calendar.getDate();
			  giorno=day.toString();

			  if ((today>Calendar.getDate()) && (argnum == 1)) giorno=giorno.strike( ); //spunta giorni
			  
				  // Illumina oggi e/o giorni selezionati
				  if(( attivita==Calendar.getDate() )||( today==Calendar.getDate() ))
					{
					 if(attivita==Calendar.getDate()) giorno=giorno.link("attivita.asp#"+attivita)
					 cal += highlight_start + giorno + highlight_end + TD_end;
					 if ((act_array.length>0 )&( attivita==Calendar.getDate() )) attivita=act_array.pop();
					}
			  // PRINTS DAY
		  else
		  	cal += TD_start + giorno+ TD_end;
		  }
		
		  // END ROW FOR LAST DAY OF WEEK
		  if(week_day == DAYS_OF_WEEK) cal += TR_end;
	  }
	
	  // INCREMENTS UNTIL END OF THE MONTH
	  Calendar.setDate(Calendar.getDate()+1);
	
}// end for loop

cal += '</TD></TR></TABLE></TABLE>';
calender = cal;
//alert(cal)
return calender;

} //fine funzione


//  PRINT CALENDAR
//document.write(cal);

//inserire nel codice html:
//document.write(makecal("26;18;12")); 				attivitá nel calendario con data attuale
//document.write(makecal("26;18;12",2001,10,10));	attivitá nel calendario con data specifica
//document.write(makecal("")); 						nessuna attivitá nel calendario attuale (spunta)
//document.write(makecal()); 						nessuna attivitá nel calendario attuale (non spunta)


//  End -->

