var scrollers;

function getScrollClippers() {
  div = document.getElementsByTagName("div");
  ret = new Array();

  /* Scroll Clippers have class scroll_clipper... */
  for (id=0; id<div.length; id++ ) for (ia=0; ia < div[id].attributes.length; ia++) if ( (div[id].attributes[ia].name == 'class') && (-1 != div[id].attributes[ia].value.indexOf('scroll_clipper')) ) ret.push(div[id]);            
  return ret;
}
 
  function process_scrollers() {
    for (i=0; i < scrollers.length; i++) {
      if (scrollers[i].clipper.scrollTop < scrollers[i].maxScroll) scrollers[i].clipper.scrollTop++;
      else scrollers[i].clipper.scrollTop = 0;      
    }
  }
 
  function begin_scroll() {
    s = getScrollClippers();
    scrollers = new Array();
    for (i=0; i < s.length; i++) {
      clipper = clipper = s[i];
      child = clipper.children[0];
      spacer = '<div style="height:' + clipper.offsetHeight +'px; overflow: hidden;">&nbsp;</div>';
      child.innerHTML = spacer + child.innerHTML + spacer;
      
      maxScroll = child.offsetHeight - clipper.offsetHeight;
      if (0 > maxScroll) maxScroll = 0;

      scroller = new Object();
      scroller.clipper = clipper;
      scroller.clipper.scrollTop = clipper.offsetHeight;
      scroller.maxScroll = maxScroll;
      scrollers.push(scroller);
    }
    window.setInterval("process_scrollers();", 50);
  }
