var init = 1;

function wheel() {
	window.setInterval("shift(1);", 20);
}

function shift(shiftWidth) {
	e1 = document.getElementById("wheel-1");
	e2 = document.getElementById("wheel-2");
	
	var width = e1.offsetWidth;
	var left_1 = e1.style.left.substring(0, e1.style.left.length - 2);
	
	if (init == 1) {
		e2 = e1.cloneNode(true);
		e2.id = "wheel-2";
		document.getElementById('wheel-container').appendChild(e2);
		e2.style.left = (width - 15) + "px";
		left_1 = -5;
		init = 0;
	}
	
	var left_2 = e2.style.left.substring(0, e2.style.left.length - 2);
	
	e1.style.left = (left_1 - shiftWidth) + "px";
	e2.style.left = (left_2 - shiftWidth) + "px";
	
	if (width + parseInt(left_1) < 0) e1.style.left = (width - 21) + "px";
	if (width + parseInt(left_2) < 0) e2.style.left = (width - 21) + "px";

}

function clog(text) {
	if (console && console.log) console.log(text);
}

wheel();
