function CalendarioEventiSelect(date) {
  // If no parameter is passed use the current date.
  if(date == null)
     date = new Date();

  day = date.getDate();
  month = date.getMonth();
  year = date.getFullYear();

  months = new Array('Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre');

  this_month = new Date(year, month, 1);
  next_month = new Date(year, month + 1, 1);

  // Find out when this month starts and ends.
  first_week_day = this_month.getDay();
  days_in_this_month = Math.round((next_month.getTime() - this_month.getTime()) / (1000 * 60 * 60 * 24));
  
  var meseSEL = months[month]
if (months[month]=='Gennaio') meseSEL="1"
if (months[month]=='Febbraio') meseSEL="2"
if (months[month]=='Marzo') meseSEL="3"
if (months[month]=='Aprile') meseSEL="4"
if (months[month]=='Maggio') meseSEL="5"
if  (months[month]=='Giugno') meseSEL="6"
if  (months[month]=='Luglio') meseSEL="7"
if  (months[month]=='Agosto') meseSEL="8"
if  (months[month]=='Settembre') meseSEL="9"
if  (months[month]=='Ottobre') meseSEL="10"
if  (months[month]=='Novembre') meseSEL="11"
if (months[month]=='Dicembre') meseSEL="12"

  calendar_html = '<table style="border:#DEDECD solid 1px; background-color:#3A3A3A; color:#3A3A3A; font-family:Verdana,Arial,Helvetica,sans-serif; font-size:11px;" cellpadding="1" cellspacing="1">';
  calendar_html += '<tr style="background-color:#EFEFDF; color:#C93001;"><td colspan="7" align="center"><b>' + months[month] + ' ' + year + '</b></td></tr>';
  calendar_html += '<tr style="font-weight: bold; color:#FFFFFF"><td align="center">Do</td><td align="center">Lu</td><td align="center">Ma</td><td align="center">Me</td><td align="center">Gi</td><td align="center">Ve</td><td align="center">Sa</td></tr>';
	calendar_html += '<tr bgcolor="#FFFFFF" onMouseOver="this.bgColor=\'#EFEFDF\';" onMouseOut="this.bgColor=\'#FFFFFF\';">';

  // Fill the first week of the month with the appropriate number of blanks.
  for(week_day = 0; week_day < first_week_day; week_day++) {
    calendar_html += '<td>&nbsp;</td>';
  }

  week_day = first_week_day;
  for(day_counter = 1; day_counter <= days_in_this_month; day_counter++) {
    week_day %= 7;
    if(week_day == 0)
      calendar_html += '</tr><tr bgcolor="#FFFFFF" onMouseOver="this.bgColor=\'#EFEFDF\';" onMouseOut="this.bgColor=\'#FFFFFF\';">';

    // Do something different for the current day.
    if(day == day_counter)
      calendar_html += '<td style="text-align: center; border:#3A3A3A solid 1px; background-color:#C93001;"><a href=\'Calendario.php?year='+year+'&month='+meseSEL+'&day='+day_counter+'\' style=\'text-decoration:none\' title="Oggi è il '+day_counter+' '+months[month]+' '+year+' - Visualizza eventi della settimana" alt="Oggi è il '+day_counter+' '+months[month]+' '+year+' - Visualizza eventi della settimana"><span style="color:#FFFFFF; font-weight: bold;">' + day_counter + '</span></a></td>';
    else
      calendar_html += '<td style="text-align: center;"><a href=\'Calendario.php?year='+year+'&month='+meseSEL+'&day='+day_counter+'\' style=\'text-decoration:none\' title="'+day_counter+' '+months[month]+' '+year+' - Visualizza eventi della settimana" alt="'+day_counter+' '+months[month]+' '+year+' - Visualizza eventi della settimana"><span style="color:#3A3A3A;">' + day_counter + '</span></a></td>';

    week_day++;
  }

  calendar_html += '</tr>';
  calendar_html += '</table>';

  // Display the calendar.
  document.write(calendar_html);
}