var mytimer = null;

//---[ Start scrolling image ]------------------------------------------------------------
function startScroller(imagesize) {
	o_scrollimg = (document.getElementById) ? document.getElementById("scrollimg") : document.all["scrollimg"];
	var o_content = (document.getElementById) ? document.getElementById("content") : document.all["content"];
	var o_container = (document.getElementById) ? document.getElementById("container") : document.all["container"];
	var o_side = (document.getElementById) ? document.getElementById("side") : document.all["side"];

	// Get heights
	var w_height = (window.innerHeight) ? window.innerHeight : document.body.clientHeight;
	var t_height = getHeight(o_content) + 90;

	// Set the container height to table height or window height, whatever is largest
	o_container.style.height = Math.max(w_height, t_height);

	// Calculate number of copies needed for the sidebar
	var copies = Math.ceil(Math.max(w_height, t_height) / imagesize);
	for (var idx=0; idx < copies; idx++) {
		var trObj = o_side.rows[0].cloneNode(true);
		o_side.appendChild(trObj);
	}

	// Start scroller
	o_scrolltmr = setTimeout("doScroll(-"+(imagesize-1)+");", 40);
}

//---[ Next scrolling image step ]--------------------------------------------------------
function doScroll(scrollsize) {
	var cur_top = parseInt(o_scrollimg.style.top);
	if (cur_top > scrollsize) {
		o_scrollimg.style.top = cur_top - 1;
	} else {
		o_scrollimg.style.top = 0;
	}
	o_scrolltmr = setTimeout("doScroll("+scrollsize+");", 40);
}

function doreload() {
	location.reload(true);
	mytimer = null;
}

function timedreload() {
	if (mytimer != null) {
		clearTimeout(mytimer);
	}
	mytimer = setTimeout("doreload()", 500);
}

onresize = timedreload;

