
// Neil Burgess Feb 2010

function scroll() {
	this.id = "";
	this.width = 0;
	this.speed = 0;
	this.refresh = 0;
	this.timeout = 0;

	this.init = function(id, width, step, refresh) {
		this.id = id;
		this.width = width;
		this.step = step;
		this.refresh = refresh;
	}

	this.startScroll = function() {
		this.doScroll();
	}

	this.doScroll = function() {
		var x = parseInt(document.getElementById(this.id).style.left.replace("px", ""));
		if (x < (0-parseInt(document.getElementById(this.id).style.width.replace("px", "")))) {
			x = this.width + this.step;
		}
		document.getElementById(this.id).style.left = x - this.step+"px";
		this.timeout = setTimeout("ScrollUpdate()", this.refresh);
	}
}

