var timer;
var position = 0;

function scroll_up() {
  position -= 1;
  text_object = document.getElementById("thetext");
  if (position < 0 - text_object.offsetHeight + 150) 
    {clearInterval(timer); // stop moving
      text_object.style.top = position;}
  else
    {text_object.style.top = position;}
}

function scroll_down() {
  position += 1;
  text_object = document.getElementById("thetext");
  if (position > 0 + (text_object.offsetHeight - (text_object.offsetHeight - 150)))
    {clearInterval(timer); // stop moving
      text_object.style.top = position;}
  else
    {text_object.style.top = position;}
}

function doUp() {
  timer = setInterval("scroll_up()", 30);
}

function doDn() {
  timer = setInterval("scroll_down()", 30);
}
