var msg = "L'emancipazione dei lavoratori dev'essere opera dei lavoratori stessi" var delay = 20 var startPos = 120 // Don't touch these variables: var timerID = null var timerRunning = false var pos = 0 // Crank it up! StartScrolling() function StartScrolling(){ // Make sure the clock is stopped StopTheClock() // Pad the message with spaces to get the "start" position for (var i = 0; i < startPos; i++) msg = " " + msg // Off we go... DoTheScroll() } function StopTheClock(){ if(timerRunning) clearTimeout(timerID) timerRunning = false } function DoTheScroll(){ if (pos < msg.length) self.status = msg.substring(pos, msg.length); else pos=-1; ++pos timerRunning = true timerID = self.setTimeout("DoTheScroll()", delay) }