// JavaScript Document

var timer;
var position = 5;

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 +"px";
	} 
  else{
    text_object.style.top = position +"px";
	}
}

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 +"px";
	  } 
    else {
		  text_object.style.top = position +"px";
	}
}

function doUp() {
  timer = setInterval("scroll_up()", 30);
}

function doDn() {
  timer = setInterval("scroll_down()", 30);
}

