
if (document.images){
        var num_0 = new Image(17,35);num_0.src="ImgContoAllaRovescia/0.gif";
        var num_1 = new Image(17,35);num_1.src="ImgContoAllaRovescia/1.gif";
        var num_2 = new Image(17,35);num_2.src="ImgContoAllaRovescia/2.gif";
        var num_3 = new Image(17,35);num_3.src="ImgContoAllaRovescia/3.gif";
        var num_4 = new Image(17,35);num_4.src="ImgContoAllaRovescia/4.gif";
        var num_5 = new Image(17,35);num_5.src="ImgContoAllaRovescia/5.gif";
        var num_6 = new Image(17,35);num_6.src="ImgContoAllaRovescia/6.gif";
        var num_7 = new Image(17,35);num_7.src="ImgContoAllaRovescia/7.gif";
        var num_8 = new Image(17,35);num_8.src="ImgContoAllaRovescia/8.gif";
        var num_9 = new Image(17,35);num_9.src="ImgContoAllaRovescia/9.gif";
}

function VisualizzaConto(){
        if (document.images){
                document.writeln('<img src="ImgContoAllaRovescia/0.gif" height="35" width="17" name="gg_1" border="0">');
				document.writeln('<img src="ImgContoAllaRovescia/0.gif" height="35" width="17" name="gg_2" border="0">');
				document.writeln('<img src="ImgContoAllaRovescia/0.gif" height="35" width="17" name="gg_3" border="0">');
				document.writeln('<img src="ImgContoAllaRovescia/giorni.gif" height="35" width="66" border="0"><br>');
                document.writeln('<img src="ImgContoAllaRovescia/0.gif" height="35" width="17" name="hh_1" border="0">');
                document.writeln('<img src="ImgContoAllaRovescia/0.gif" height="35" width="17" name="hh_2" border="0">');
                document.writeln('<img src="ImgContoAllaRovescia/ore.gif" height="35" width="25" border="0">');
                document.writeln('<img src="ImgContoAllaRovescia/0.gif" height="35" width="17" name="mm_1" border="0">');
                document.writeln('<img src="ImgContoAllaRovescia/0.gif" height="35" width="17" name="mm_2" border="0">');
                document.writeln('<img src="ImgContoAllaRovescia/min.gif" height="35" width="25" border="0">');
                document.writeln('<img src="ImgContoAllaRovescia/0.gif" height="35" width="17" name="ss_1" border="0">');
                document.writeln('<img src="ImgContoAllaRovescia/0.gif" height="35" width="17" name="ss_2" border="0">');
                document.writeln('<img src="ImgContoAllaRovescia/sec.gif" height="35" width="23" border="0">');
                ContoAllaRovescia();
        }
}

function ContoAllaRovescia(){
        window.setTimeout('ContoAllaRovescia()',1000);
        
        var DataFine = "";
        var AnnoFine=2008; //anno fine
        var MeseFine=12; //mese fine
        var GiornoFine=6; //giorno fine
        var ArrMesi=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
        DataFine=ArrMesi[MeseFine-1]+" "+GiornoFine+", "+AnnoFine;
        
        var DataAttuale = new Date();
		var AnnoAttuale=DataAttuale.getYear();
		if (AnnoAttuale < 1000){
			AnnoAttuale+=1900;
		}
		var MeseAttuale=DataAttuale.getMonth();
		var GiornoAttuale=DataAttuale.getDate();
		var OraAttuale=DataAttuale.getHours();
		var MinutiAttuale=DataAttuale.getMinutes();
		var SecondiAttuale=DataAttuale.getSeconds();
		DataAttuale=ArrMesi[MeseAttuale]+" "+GiornoAttuale+", "+AnnoAttuale+" "+OraAttuale+":"+MinutiAttuale+":"+SecondiAttuale;
	
		Dif=Date.parse(DataAttuale)-Date.parse(DataFine);
	
		dday=Math.floor(Dif/(60*60*1000*24)*1);
		dhour=Math.floor((Dif%(60*60*1000*24))/(60*60*1000)*1);
		dmin=Math.floor(((Dif%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
		dsec=Math.floor((((Dif%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);
        
        if (dday < 10){
                x = "00" + dday; AggiornaConto(x,"gg");
        }else if (dday < 100){
        		x = "0" + dday; AggiornaConto(x,"gg");
        }else{
              	x = dday + ""; AggiornaConto(x,"gg");
        }
		                
        if (dhour < 10){
                x = "0" + dhour; AggiornaConto(x,"hh");
        }else{
                x = dhour + ""; AggiornaConto(x,"hh");
        }

        if (dmin < 10){
                x = "0" + dmin; AggiornaConto(x,"mm");
        }else{
                x = dmin + ""; AggiornaConto(x,"mm");
        }
        
        if (dsec < 10){
                x = "0" + dsec; AggiornaConto(x,"ss");
        }else{
                x = dsec + ""; AggiornaConto(x,"ss");
        }
}

function AggiornaConto(num,tipo){
        for (var x = 0; x < num.length; x++){
                image_id = tipo+"_"+(x+1);
                document.images[image_id].src=eval("num_"+num.substring(x,x+1)+ ".src");
        }
}

if (document.images){
        VisualizzaConto();
        }