/*
(C)2007	Marek Małachowski
	mm-team sp. z o.o.
	http://www.mm-team.com
*/

var stepTime=20;
var left=0;
var w=640;

var mostleftwidth;
obj=document.getElementById("contentScroll");


function draw() {
	obj.style.clip = 'rect(0px,'+ (w-left) +'px,82px,' + (-left) + 'px)';
	obj.style.left=left + 'px';	
}



function getMostLeftWidth() {
  var theImg =obj.childNodes.item(0);
  mostleftwidth=theImg.width;
}


function moveFirstToLast() {
  var theFirst =obj.childNodes.item(0);
  obj.appendChild(theFirst);
  left=0;
  draw();
}


function move() {
 	left-=1;

	if (left+mostleftwidth==0) {
		moveFirstToLast();
		getMostLeftWidth();
		setTimeout("move()",500);
	} else {
		setTimeout("move()",stepTime);
	}

	draw();
}

if (typeof(ChanticoPublishing!='unknown')) {

window.onload=function () {
	getMostLeftWidth();
	move();
}

}