var text_length = 0;

var box_width = 0;

var box = null;

var text = null;

function scrollInit()
{
  box = document.getElementById('scroller_box');
  
  if(box != null)
  {
    text = document.getElementById('text_container');

    text_length = text.offsetWidth;

    box_width = box.offsetWidth;

    text.style.left = box_width+'px';
  }

}

function scroll()
{
  if(text_length == 0) return;
  
  if(parseInt(text.style.left) < -text_length)
  {
    text.style.left = parseInt(box_width) + 'px';
  }else
  {
    text.style.left = (parseInt(text.style.left) - 2) + 'px';
  }
}

document.observe("dom:loaded", function() {
  
  scrollInit();
  
  window.setInterval('scroll()',50);
});

