var _timer = null;
var _timeout = 5000; // 5 sec
var _active = 0;
var _roll = null;


function initRoll() {

	_roll = document.getElementById("roll");
	if (_roll)
	{
		changeText();
	}
 }
 
 function changeText() {
 	stopTimer();
 	if (_active >= texts.length)
 	{
 		_active = 0;
 	}
 	_roll.innerHTML = texts[_active];
 	_active++;
 	startTimer();
 }
 
 function startTimer() {
	_timer = setTimeout("changeText()", _timeout);
}

function stopTimer() {
	if(_timer) {
		clearTimeout(_timer);
		_timer = null;
	}
}
 
if (window.addEventListener){
	window.addEventListener("load", initRoll, false);

}
else if (window.attachEvent){
	window.attachEvent("onload", initRoll);
}
