var peClock = null;
var itMesi = ['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic'];
var itGiorni = ['Dom','Lun','Mart','Merc','Giov','Ven','Sab'];

function updateClock() {
var dtDataora = new Date();
var tmpMinutes = dtDataora.getMinutes();
tmpMinutes = (tmpMinutes > 9) ? tmpMinutes : ("0" + tmpMinutes);
var tmpSeconds = dtDataora.getSeconds();
tmpSeconds = (tmpSeconds > 9) ? tmpSeconds : ("0" + tmpSeconds);

var itDataora = itGiorni[dtDataora.getDay()] + " " + dtDataora.getDate() + " " + itMesi[dtDataora.getMonth()] + " " + dtDataora.getFullYear() + " :: ore " +
		dtDataora.getHours() + ":" + tmpMinutes + ":" + tmpSeconds;
$("data").innerHTML = itDataora;
}

function setClock() {
peClock = new PeriodicalExecuter(updateClock, 1);
updateClock();
}

Event.observe(window, 'load', setClock);
