var stepPx = 1;
var interval = 100;
var direction = 1;
var layerHeight;
var initPosTop, posTop;
var initBClip, initTClip, tClip;
var totalSteps, cntSteps = 0;
var scrollLayer;
var canScroll = true;
	
function Scroll(layerName)
{
	interval = 100;
	scrollLayer = document.all ? document.all[layerName] : document.getElementById(layerName);
	initBClip = parseInt(scrollLayer.style.clip.split("rect(")[1].split(")")[0].split(/[ ,px]+/)[2]);
	initTClip = parseInt(scrollLayer.style.clip.split("rect(")[1].split(")")[0].split(/[ ,px]+/)[0]);
	initPosTop = parseInt(scrollLayer.style.top);
	layerHeight = scrollLayer.offsetHeight;
	totalSteps = Math.ceil((scrollLayer.offsetHeight + initBClip) / stepPx);
	tClip = initTClip - initBClip;
	posTop = initPosTop + initBClip;
	scrollLayer.style.top = posTop + "px";
	scrollLayer.style.clip = "rect(" + tClip + "px" + " auto " + (tClip + initBClip) + "px" + " 0px)";
	scrollLayer.style.visibility = 'visible';
  go();
}

function go()
{
	if (canScroll) {
		if (cntSteps < totalSteps) {
			posTop -= direction * stepPx;
			tClip += direction * stepPx;
			cntSteps++;
		} else {
			if (direction == 1) {
				tClip = initTClip - initBClip;
				posTop = initPosTop + initBClip;
			}
			else {
				tClip = layerHeight;
				posTop = initPosTop - layerHeight;
			}
			cntSteps = 0;
		}
		scrollLayer.style.top = posTop + "px";
		scrollLayer.style.clip = "rect(" + tClip + "px" + " auto " + (tClip + initBClip) + "px" + " 0px)";
		setTimeout("go()", interval);
	}
}

