function data_corrente() 
{
	var data_corrente = new Date();
	var giorno = data_corrente.getDate();
	var mese = data_corrente.getMonth();
	var anno = data_corrente.getFullYear();
	var giorno_settimana = data_corrente.getDay();
	var ora = data_corrente.getHours();
	if(ora<=9) ora = "0" + ora;
	var minuti = data_corrente.getMinutes();
	if(minuti<=9) minuti = "0" + minuti;
	var secondi = data_corrente.getSeconds();
    if(secondi<=9) secondi = "0" + secondi;
	var nome_giorno_settimana = ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'];
	var nome_mese = ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'];
	
	var s_data_corrente = nome_giorno_settimana[giorno_settimana] + " " + giorno + " " + nome_mese[mese] + " " + anno + " " + ora + ":" + minuti + ":" + secondi;
	return (s_data_corrente);	
}
function window_onload() {
	window.setInterval("scrivi_data()", 1000);	
}

function scrivi_data()
{
	document.getElementById("span_data_corrente").innerText = data_corrente();
}






function data (){
                        thisDate = new Date()
            giorno = thisDate.getDay();
                        oggi = thisDate.getDate();
                        monthNum = thisDate.getMonth();
            Year = thisDate.getYear();
            if (Year <=100)
              Year=1900+Year;
              
                    if (monthNum == 0) NomeMese = "Gennaio ";
                        else if (monthNum == 1) NomeMese = "Febbraio ";
                        else if (monthNum == 2) NomeMese = "Marzo ";
                        else if (monthNum == 3) NomeMese = "Aprile ";
                        else if(monthNum == 4) NomeMese = "Maggio ";
                        else if(monthNum == 5) NomeMese = "Giugno ";
                        else if (monthNum == 6) NomeMese = "Luglio ";
                        else if (monthNum == 7) NomeMese = "Agosto ";
                        else if (monthNum == 8) NomeMese = "Settembre ";
                        else if (monthNum == 9) NomeMese = "Ottobre ";
                        else if (monthNum == 10) NomeMese = "Novembre ";
                        else if (monthNum == 11) NomeMese = "Dicembre ";
                    if (giorno == 0) NomeGiorno = "Domenica";
            else if (giorno == 1) NomeGiorno = "Luned&igrave;";
            else if (giorno == 2) NomeGiorno = "Marted&igrave;";
            else if (giorno == 3) NomeGiorno = "Mercoled&igrave;";
            else if (giorno == 4) NomeGiorno = "Gioved&igrave;";
            else if (giorno == 5) NomeGiorno = "Venerd&igrave;";
            else if (giorno == 6) NomeGiorno = "Sabato";
                        document.write(NomeGiorno+' '+oggi+' '+NomeMese+ ' '+Year);
}






function saluto (){
            thisDate = new Date()
            ora = thisDate.getHours();           
            if ( ora <= 12) { salve = "Buongiorno";}
            if ( ora > 12 && ora <= 16) { salve = "Buon pomeriggio";}
            if ( ora > 16) { salve = "Buonasera";}
            document.write(salve);
}