/*visualizzazione della data con invocazione dell'ora*/

function showDate() {
	
	browserVersion = navigator.appVersion.substring(0,1);

	if (browserVersion > 3) browser = true;
	
	else browser = false;
	
	today = new Date;

	day = today.getDate();
	
	if (day<10) day = "0"+day;
	
	month = today.getMonth();
	
	if (browser) year = today.getFullYear();
	
	else year = today.getYear();
	
	month++;
	
	if (month < 10) month = "0" + month;
	
	
	giorno=showDay();
	
	
	messageDate = giorno + " " + day + "/" + month + "/" + year;
	which = messageDate;
	
	if (document.getElementById) document.getElementById("data").innerHTML=which;

	showTime();

}



/*calcolo del giorno in lettere*/

function showDay() {

	dayName = new Array ("domenica", "luned&iacute;", "marted&iacute;", "mercoled&iacute;", "gioved&iacute", "venerd&iacute", "sabato");

	now = new Date;
	
	thisDay = dayName[now.getDay()];
	
	return thisDay;


}



/*visualizzazione dell'ora*/

function showTime() {
	
	tmp = new Date;
	hour = tmp.getHours();
	min = tmp.getMinutes();
	sec = tmp.getSeconds();
	day = tmp.getDate();
	mois = tmp.getMonth()+1;
	year = tmp.getFullYear();
	
	if (sec < 10) sec0 = "0";
	else sec0 = "";
	
	if (min < 10) min0 = "0";
	
	else min0 = "";
	
	if (hour < 10) hour0 = "0";
	
	else hour0 = "";
	
	timeNow = hour0 + hour + ":" + min0 + min + ":" + sec0 + sec;
	
	which = timeNow;
	
	if (document.getElementById) document.getElementById("ora").innerHTML=which;

	setTimeout("showTime()", 1000);
	
}


window.onload = showDate;