function initScroll(EltId, increment, timer, direction) {
	direction = direction.toLowerCase();
	var BlockScroll = document.getElementById(EltId);
	if (direction=="bt" || direction=="tb" )
		{
		var FirstDiv = BlockScroll.insertBefore(document.createElement("div" ), BlockScroll.firstChild);
		var LastDiv = BlockScroll.appendChild(document.createElement("div" ));
            
		FirstDiv.style.height = BlockScroll.clientHeight+"px";
		LastDiv.style.height = BlockScroll.clientHeight+"px";
		}
	if (direction=="lr" || direction=="rl" )
		{
		BlockScroll.style.paddingLeft=BlockScroll.clientWidth;
		BlockScroll.style.paddingRight=BlockScroll.clientWidth;
		BlockScroll.style.whiteSpace="nowrap";
		}
	eval('var '+EltId+'Timer = setInterval("scrollElement(\'"+ EltId + "\'," + increment + ",\'" + direction +"\')",timer);');
	}

function scrollElement(eltId, increment, direction) {
	var BlockScroll = document.getElementById(eltId);
	with (BlockScroll) {
		switch(direction) {
			case "bt":
				scrollTop += increment;
				if (scrollTop+clientHeight>=scrollHeight) { scrollTop=0};
				break;
			case "tb":
				scrollTop -= increment;
				if (scrollTop<=increment) { scrollTop=scrollHeight};
				break;
			case "rl":                      
				scrollLeft += increment;
				if (scrollLeft+clientWidth>=scrollWidth) scrollLeft=0;
				break;
			case "lr":                      
				scrollLeft -= increment;
				if (scrollLeft<increment) scrollLeft=scrollWidth;
				break;
			}
		}
	}

window.onload=function() {
	initScroll("blocktoscroll_tmp", 1, 60, "bt" );
	RefreshIMG();
	}