// (C) JAN HÁNA 2006 CREATIN.CZ (jan.hana@atlas.cz)

var timer;
var maxshift = 6;
var step = 1.05
var obj;
var locshift;

//var okno = window.open("about:blank", "test", "height=300,width=300,scrollbars=1");

function getObj(id) {
	if(Boolean(document.getElementById)) {
		return document.getElementById(id);
	} else if(Boolean(document.all)) {
		return eval('document.all.'+id);
	}
}


function scrollerStart(id, shifting) {
	obj = getObj(id);
	obj.scrollLeft += shifting;
	if (Math.abs(shifting)<=maxshift) shifting=shifting*step;
	locshift = shifting;
	clearTimeout(timer);
	//okno.document.write(shifting + "<br>");
	timer = setTimeout("scrollerStart('" + obj.id + "', " + shifting + ");", 20);
}

function scrollerStop(id, shifting) {
	if (shifting=="") {
		shifting=locshift;
		clearTimeout(timer);
	}
	if (Math.abs(shifting)<0.6) {
		clearTimeout(timer);
		locshift=0;
		return false;
	}
	obj = getObj(id);
	obj.scrollLeft += shifting;
	shifting = shifting/step;
	locshift = shifting;
	clearTimeout(timer);
	timer = setTimeout("scrollerStop('" + obj.id + "', " + shifting + ");", 20);
}