<script type="text/javascript">
function opacity(id, opacStart, opacEnd, millisec) {
//speed for each frame
var speed = Math.round(millisec / 100);
var timer = 0;
//determine the direction for the blending, if start and end are the same nothing happens
if(opacStart > opacEnd) {
for(i = opacStart; i >= opacEnd; i--) {
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
timer++;
}
} else if(opacStart < opacEnd) {
for(i = opacStart; i <= opacEnd; i++)
{
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
timer++;
}
}
}
function changeOpac(opacity, id) {
var object = document.getElementById(id).style;
object.opacity = (opacity / 100);
object.MozOpacity = (opacity / 100);
object.KhtmlOpacity = (opacity / 100);
object.filter = "alpha(opacity=" + opacity + ")";
}
// configura velocità della rotazione (millisecondi)
var speed = 5000
// Specifica i files delle immagini
var Pic = new Array() // creo l'array delle immagini
Pic[0] = "images/scritta1.png"
Pic[1] = "images/scritta2.png"
Pic[2] = "images/scritta3.png"
Pic[3] = "images/scritta4.png"
var t
var j = 0
var p = Pic.length
function runSlideShow(){
var container=document.getElementById('scritta_cambia' );
opacity('scritta_cambia','100','0','1000');//1000 sta per: in un secondo
container.style.backgroundImage="url('"+Pic[j]+"')";
opacity('scritta_cambia','0','100','1000');
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', speed)
}