var tick, para;
para = 0;

function addscroller() {
	para++;
	if (para>scrolltext.length) {
		para = 1;
	}
	
	if (document.getElementById) {
		var el = document.getElementById(scroller);
		if (el) { //got dom object
			el.style.overflow = "hidden";
			el.innerHTML = '<span style="position:absolute;left:0px;top:0px"><p style="display:inline;white-space:nowrap;">' + scrolltext[para-1] + '</p></span>';
			el.firstChild.style.left=parseInt(getStyle(el,'width'))+8+"px";
		}	
	}
	if (!tick) {
		tick = setInterval("movescroller()",15);
	}
}

function movescroller() {
	var el = document.getElementById(scroller);
	if (el) { //got dom object
		var width = 0 - parseInt(el.firstChild.offsetWidth);
		if (parseInt(el.firstChild.style.left)>width) {
			el.firstChild.style.left=parseInt(el.firstChild.style.left)-1+"px";
		} else {
			addscroller();
		}
	}
}

window.onload = function() { addscroller(); }