var paneScroller = {

	oSec : 30, // интервал движения, мсек.
	oMove : 1, // на сколько пикселей двигать
	oFirst : null,
	oSecond : null,
	oWidth : 0,
	oPos : 0,
	oType : false,
	oTimer : null,

	create : function (oDiv) {

		this.oFirst = oDiv.firstChild;
		this.oWidth = this.oFirst.width;
		this.oFirst.style.position = 'relative';
		this.oFirst.style.top = '0px';
		this.oFirst.style.left = '0px';
		this.oSecond = oDiv.appendChild(this.oFirst.cloneNode(true));
		this.oSecond.style.left = this.oWidth+'px';
		this.oSecond.style.top = (0 - this.oFirst.height)+'px';
		this.oTimer = setInterval("paneScroller.move()",this.oSec);

	},

	move : function () {

		this.oPos += this.oMove;
		if (this.oPos >= this.oWidth) {
			if (this.oType) {
				this.oType = true;
				this.oFirst.style.left = 0;
				this.oSecond.style.left = this.oPos+'px';
			} else {
				this.oType = true;
				this.oSecond.style.left = 0;
				this.oFirst.style.left = this.oPos+'px';
			} this.oPos = 0;
		} else {
			if (this.oType) {
				this.oSecond.style.left = (0 - this.oPos)+'px';
				this.oFirst.style.left = (this.oWidth - this.oPos)+'px';
			} else {
				this.oFirst.style.left = (0 - this.oPos)+'px';
				this.oSecond.style.left = (this.oWidth - this.oPos)+'px';
			}
		}

	}

}


function initScripts () {

	var a;
	if ((a = document.getElementById("slideCanvas"))) paneScroller.create(a);

} window.onload = initScripts;
