// JavaScript Document - DATA ED ORARIO

function getObject(id) {
	if (ie4) {
		return document.all[id];
	} else {
		return document.getElementById(id);
	}
}

if(document.all) {
	ie4 = true;
}

function ToggleImage(imgId, img_block, img_none) {
	var d = getObject("div_"+imgId);
	var i = getObject("img_"+imgId);
	if (i != null) {
		if (d.style.display != "none")
			i.src = img_block;
		else
			i.src = img_none;
	}
}

function ToggleBlock(divId) {
	var d = getObject(divId);
	if (d != null) 	{
		if (d.style.display != 'none')
			d.style.display = 'none';
		else
			d.style.display = 'block';
	}
	SetCookie(divId,d.style.display,365);
}

function tS(){ x=new Date(); x.setTime(x.getTime()); return x; } 

function lZ(x){ return (x>9)?x:'0'+x; } 

function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; } 

function dE(x){ if(x==1||x==21||x==31){ return ''; } if(x==2||x==22){ return ''; } if(x==3||x==23){ return ''; } return ''; } 

function dT(){ if(fr==0){ fr=1; document.write('<div align="left" style="margin-left: 7px;"><b><span id="tP">'+eval(oT)+'</span></b></div></font></td><td><font size="2" face="verdana" color="#E7E7E7"><div align="right"><b><span id="tD">'+eval(oD)+'</span></b></div>'); } tP.innerText=eval(oT); tD.innerText=eval(oD);setTimeout('dT()',1000); } 

function aP(x){ return (x>11)?'pm':'am'; } 
function y4(x){ return (x<500)?x+1900:x; } 

var dN=new Array('Domenica','Lunedi','Martedì','Mercoledì','Giovedì','Venerdì','Sabato')

var mN=new Array
('Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre')

var fr=0

var oD="dN[tS().getDay()]+' '+tS().getDate()+dE(tS().getDate())+' '+mN[tS().getMonth()]+' '+y4(tS().getYear())";

var oT="tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '+aP(tS().getHours())";

