ScrollItems = 3; TotalHeight = 0; MaxHeight = 0; ScrollOffset = 10; ScrollSpeed = 1; ScrollDelay = 50; ScrollerStarted = false; if (!document.getElementById) document.getElementById = document.all; function InitScroller () { for (var i = 0; i < ScrollItems; i++) { elm = document.getElementById ("ScrollItem" + i); elm.style.top = (TotalHeight + ScrollOffset) + "px"; TotalHeight += elm.offsetHeight; } if (TotalHeight - MaxHeight <150) TotalHeight += 150; StartScroller (); } function ScrollUp () { if (TotalHeight > 150) { for (var i = 0; i < ScrollItems; i++) { elm = document.getElementById ("ScrollItem" + i); y = parseInt (elm.style.top) - ScrollSpeed; if (y < (ScrollOffset - elm.offsetHeight)) y += TotalHeight; elm.style.top = y + "px"; } } } function StopScroller () { if (ScrollerStarted) { clearInterval (ScrollTimer); ScrollerStarted = false; } } function StartScroller () { if (!ScrollerStarted && ScrollItems > 0) { ScrollTimer = window.setInterval ("ScrollUp ()", ScrollDelay); ScrollerStarted = true; } }