// Clock Script Generated By Maxx Blade's Clock v2.0d
// http://www.maxxblade.co.uk/clock
// modified by	G.Amadei http://www.pitchputt.it
//
//
function timeSource(){
   x=new Date(timeNow().getUTCFullYear(),timeNow().getUTCMonth(),timeNow().getUTCDate(),timeNow().getUTCHours(),timeNow().getUTCMinutes(),timeNow().getUTCSeconds());
   x.setTime(x.getTime()+daylightSaving()+3600000);
   return x;
}
function timeNow(){
   return new Date();
}
function daylightSaving(){
   return ((timeNow().getTime()>findDay(0,2,3,-1).getTime())&&(timeNow().getTime()<findDay(0,9,4,-1).getTime()))?3600000:0;
}
function findDay(d,m,h,p){
   var week=(p<0)?7*(p+1):7*(p-1),nm=(p<0)?m+1:m,x=new Date(timeNow().getUTCFullYear(),nm,1,h,0,0),dOff=0;
   if(p<0){
      x.setTime(x.getTime()-86400000);
   }
   if(x.getDay()!=d){
      dOff=(x.getDay()<d)?(d-x.getDay()):0-(x.getDay()-d);
      if(p<0&&dOff>0){
         week-=7;
      }
      if(p>0&&dOff<0){
         week+=7;
      }
      x.setTime(x.getTime()+((dOff+week)*86400000));
   }
   return x;
}
function leadingZero(x){
   return (x>9)?x:'0'+x;
}
function displayTime(){
   var div=document.getElementById("tP").innerHTML=eval(outputTime);
   setTimeout('displayTime()',1000);
}
function fixYear4(x){
   return (x<500)?x+1900:x;
}
var dayNames=new Array('Dom','Lun','Mar','Mer','Gio','Ven','Sab');
var outputTime="dayNames[timeSource().getDay()]+' '+leadingZero(timeSource().getDate())+'.'+leadingZero((timeSource().getMonth()+1))+'.'+fixYear4(timeSource().getYear())+' '+'-'+' '+leadingZero(timeSource().getHours())+':'+leadingZero(timeSource().getMinutes())";
if(!document.all){ window.onload=displayTime; }else{ displayTime(); }


// Put the following HTML on your page where you would like the Clock to be displayed:
// <span id="tP">&nbsp;</span>

