var rot_DEF_timeout = 0;
var rot_timeout = rot_DEF_timeout;
var length = 0;
var phase = 0;
var ww = 0;

function rotate() {
	if (rot_timeout > 0) {
		rot_timeout--;
	} else {
		phase -= 2;
		if (phase < -length) phase = ww;
		document.getElementById("scroll").style.left = phase +'px';
		rot_timeout = rot_DEF_timeout;
	}
	window.setTimeout("rotate()", 30);
}


function winW() {
	if (window.innerWidth)
		/* NN4 a kompatibilní prohlížece */
		return window.innerWidth;
	else if
		(document.documentElement &&
		document.documentElement.clientWidth)
		/* MSIE6 v std. režimu - Opera a Mozilla
		již uspely s window.innerHeight */
		return document.documentElement.clientWidth;
	else if
		(document.body && document.body.clientWidth)
		/* starší MSIE + MSIE6 v quirk režimu */
		return document.body.clientWidth;
	else
		return null;
}

function start() {
	length = document.getElementById("rot").offsetWidth;
	ww = winW();
	document.getElementById("scroll").style.left = ww;
	phase = ww;
	rotate();
}


onload = start;

