var pagAperta=0; function cambiaImmagine() { now=new Date(); hour=now.getHours(); min=now.getMinutes(); sec=now.getSeconds(); indiceAssoluto=hour*60+min-1; if (indiceAssoluto<0){ indiceAssoluto=0; } if (hour<=9) { hour="0"+hour; } if (min<=9) { min="0"+min; } if (sec<=9) { sec="0"+sec; } orario=""+hour+min; if ((sec==0) || (pagAperta==0)) { //http://www.mercury.com/lproducts.nsf/By+Part+Number/SN156/$File/spec.txt?OpenElement //document['orologio'].src="http://test.coffeeoclock.com/cocclock.nsf/RicImg/"+orario+"/$File/"+orario+".jpg?OpenElement"; document['orologio'].src="RicImg/"+orario+"/$File/"+orario+".jpg?OpenElement"; //alert("http://test.coffeeoclock.com/RicImg/"+orario+"/$File/"+orario+".jpg?OpenElement"); //alert('hour='+hour); //alert('min='+min); //alert(orario); pagAperta=1; //alert(document['autore'].id); //alert('>'+indiceAssoluto+'<'); var doc=document.forms[0]; //alert(doc.autori[indiceAssoluto].value); document.getElementById('autore').innerHTML=doc.autori[indiceAssoluto].value; document.getElementById('titolo').innerHTML=doc.titoli[indiceAssoluto].value; } //document.timeForm.field.value = ((hour<=9) ? "0"+hour : hour) + ":" + min + ":" + sec + " " + add; setTimeout("cambiaImmagine()", 1000); }