var dayarray=new Array("Dom","Lun","Mar","Mer","Gio","Ven","Sab")
var montharray=new Array("Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic")
function getthedate(){
	var mydate=new Date()
	var year=mydate.getYear()

	if (year < 1000)	year+=1900

	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()

	if (daym<10) daym="0"+daym

	var hours=mydate.getHours()
	var minutes=mydate.getMinutes()
	var seconds=mydate.getSeconds()

	if (hours==0) hours=24
	if (minutes<=9) minutes="0"+minutes
	if (seconds<=9) seconds="0"+seconds

	//change font size here
	var cdate="<small><font color='ffffff' face='Arial' font-size='px9'><b>"+dayarray[day]+" "+daym+" "+montharray[month]+" "+year+", "+hours+":"+minutes+":"+seconds;
	+"</b></font></small>"

	if (document.all){
		document.all.clock.innerHTML=cdate
	}else{
		document.write(cdate)
	}
}

if (!document.all) getthedate()

function goforit(){
	if (document.all){klock.click();setInterval("getthedate()",1000)}
}

// CALCOLA LA VELOCITà DI DOWNLOAD

ora=new Date();tempo=ora.getTime()

function check_bandwidth(a){
ora2=new Date();
tempo2=ora2.getTime();

modem_speed=Math.floor((a.fileSize/1000)/((tempo2-tempo)/1000))
if(modem_speed<6){modem='56k'}
else if(modem_speed<40){modem='ADSL-Light'}
else if(modem_speed<80){modem='ADSL-Full'}
else if(modem_speed>80){modem='Fibra'}



bandwidth_string='Kbytes: <b>'+a.fileSize/1000+'</b><br>Secondi:<b>'+(tempo2-tempo)/1000+'<br>'+Math.floor((a.fileSize/1000)/((tempo2-tempo)/1000))+'</b> Kbytes/s'

bandwidth_string='<b>'+modem+'<br>'+Math.floor((a.fileSize/1000)/((tempo2-tempo)/1000))+'</b> Kbytes/s'


//alert('Kbytes: '+a.fileSize/1000+'\nSecondi:'+(tempo2-tempo)/1000+'\n'+Math.floor((a.fileSize/1000)/((tempo2-tempo)/1000))+' Kbytes/s')

//bandwidth.innerHTML='Kbytes: '+a.fileSize/1000+'\nSecondi:'+(tempo2-tempo)/1000+'\n'+Math.floor((a.fileSize/1000)/((tempo2-tempo)/1000))+' Kbytes/s';
}
