// global vars
var speed = 3;
var movedownvar;
var moveupvar;

function moveup(id){
	var content = document.getElementById(id);
	var contentheight = content.offsetHeight;
	if (parseInt(content.style.top) <= 0) {
		content.style.top = parseInt(content.style.top) + speed + "px";
	}
	moveupvar = setTimeout("moveup('" + id + "')", 20)
}

function movedown(id){
	var content = document.getElementById(id);
	var contentheight = content.offsetHeight;	
	if (parseInt(content.style.top) >= (contentheight * (-1) + 100)) {
		content.style.top = parseInt(content.style.top) - speed + "px";
	}
	movedownvar = setTimeout("movedown('" + id + "')", 20)
}

function setScrollButtons(wrapper_id, content_id) {
	var result = false;
	var wrapperHeight = document.getElementById(wrapper_id).offsetHeight;
	var contentHeight = document.getElementById(content_id).offsetHeight;
	if (wrapperHeight < contentHeight) {
	  result = true;
	}
	return result;
}

function setScrollButtonsVisible(id1, id2) {
	var but1 = document.getElementById(id1);
	but1.style.visibility = "visible";
	var but1 = document.getElementById(id2);
	but1.style.visibility = "visible";
}
