var speed=6;
var crossobj=null;
var contentheight=0;
var containerobj=null;
function showText(thetext){
	hideTexts();
	document.getElementById(thetext).style.display="block";
	movetop();
	getcontent_height();
	updateScrollbuttons();
}
function hideTexts(){
	document.getElementById("text_poller").style.display="none";
	document.getElementById("text_kuenstler").style.display="none";
	document.getElementById("text_technisches").style.display="none";
	document.getElementById("text_bestellen").style.display="none";
	document.getElementById("text_impressum").style.display="none";
}
 function glinit(){
	crossobj= document.getElementById("content");
	contentheight=crossobj.offsetHeight;
	containerobj=document.getElementById("container") ;
	crossobj.style.top='0px';                     
   crossobj.style.left='0px';
   containerheight=document.getElementById("container").offsetHeight;
   getcontent_height();
   updateScrollbuttons();
 }

function movedown(){
	if (window.moveupvar) clearTimeout(moveupvar);
	if (parseInt(crossobj.style.top)>=contentheight*(-1))
		crossobj.style.top=(parseInt(crossobj.style.top)-speed)+"px";
	movedownvar=setTimeout("movedown()",100);
	updateScrollbuttons();
}

function moveup(){
	if (window.movedownvar) clearTimeout(movedownvar);
	if (parseInt(crossobj.style.top)<0)
		crossobj.style.top=(parseInt(crossobj.style.top)+speed )+"px";
	moveupvar=setTimeout("moveup()",100);
	updateScrollbuttons();
}


function stopscroll(){
	if (window.moveupvar) clearTimeout(moveupvar)
	if (window.movedownvar) clearTimeout(movedownvar)
}

function movetop(){
	stopscroll()
	crossobj.style.top=0
}
function getcontent_height(){
	contentheight=crossobj.offsetHeight-containerheight;
}
function updateScrollbuttons(){
	if (parseInt(crossobj.style.top)>=0)
		document.getElementById("b_scroll_up").src="images/scroll_top.gif";
	else
		document.getElementById("b_scroll_up").src="images/scroll_top_a.gif";

	if (parseInt(crossobj.style.top)<contentheight*(-1))
		document.getElementById("b_scroll_down").src="images/scroll_up.gif";
	else
		document.getElementById("b_scroll_down").src="images/scroll_up_a.gif";
	
}

