// JavaScript Document



function Scroller(elementId) {
	this.elementId = elementId;
	
	this.element = document.getElementById(elementId);
	this.images = [];
	var spd = 1;
	this.speed = Math.random() > 0.5 ? spd : spd * -1;
	this.pos = -434;
	this.timer = null;
	
	this.interval = 25;
	this.pause = 4000;
}

tmp = new Scroller();


Scroller.prototype.init = function () {
	
	for (child = this.element.firstChild; child != null; child = child.nextSibling) {
		if (child.nodeName == "IMG") {
			this.images[this.images.length] = child;
		}
	}
	

	this.pauseScroll();
	
	
}

Scroller.prototype.pauseScroll = function() {
	window.clearInterval(this.timer);
	window.setTimeout("scroller.timer = window.setInterval('scroller.scroll()'," + this.interval + ")", this.pause);
}

Scroller.prototype.scroll = function() {

	this.pos += this.speed;
	this.element.style.left = this.pos + "px";	

	if (((this.pos + 202) % 232) == 0) {
		this.pauseScroll();
	}

	if (this.pos < -1392	) {
		this.pos += 1624;
	}
	
	if (this.pos > -232) {
		this.pos -=1624;
	}

}