// JavaScript Document

var rp,ScrollAction,a=0;

function Init(hoe) {
  hoehe = hoe;
  rp = eval(document.getElementById("Textfenster"));
  scr = eval(document.getElementById("Scrollup"));
  scr2 = eval(document.getElementById("Scrolldown"));
  scr.style.visibility="hidden";
  scr2.style.visibility="visible";
  rp.style.position = "absolute";
	rp.style.width = "404px";
  rp.style.top = "0px";
  rp.style.left = "0px";
  if (hoe == 0) {scr2.style.visibility = "hidden"} 
	else {scr2.style.visibility = "visible"}
  
image1 = new Image();image1.src = "o_leistungen.gif";
image2 = new Image();image2.src = "o_produkte.gif";
image3 = new Image();image3.src = "o_partner.gif";
image4 = new Image();image4.src = "o_team.gif";
image5 = new Image();image5.src = "o_news.gif";
image6 = new Image();image6.src = "o_kontakt.gif";
}

function bewegen(dir)
{
a =  parseInt(rp.style.top);
if (dir == 'auf' && a >= -hoehe){rp.style.top = a -5 + "px";}
if (dir == 'ab' && a != 0){rp.style.top = a+5 + "px";}
if (a == 0){scr.style.visibility = "hidden";}
else {scr.style.visibility = "visible";} 
if (a >= -hoehe){scr2.style.visibility = "visible";}
else {scr2.style.visibility = "hidden";} 

}


function StartScrollUp() {
ScrollAction = window.setInterval("bewegen('ab')", 10);
}
function StartScrollDown() {
ScrollAction = window.setInterval("bewegen('auf')", 10);
}

function StopScroll() {
if(ScrollAction){window.clearInterval(ScrollAction);}
}

function roller(ident1,ident2,ident3,status,punkt1,punkt2)
{

e1 = eval(document.getElementById(ident1));
if (ident2 != ""){e2 = eval(document.getElementById(ident2));}
if (ident3 != ""){e3 = eval(document.getElementById(ident3));}

	if (status == 1)
	{
e1.src = "Bilder/o_"+ident1+".gif";
if (ident2 != "" && punkt1 != 1){e2.src = "Bilder/linie_rot.gif";}
if (ident3 != "" && punkt2 != 1){e3.src = "Bilder/linie_rot.gif";}
if (ident2 != "" && punkt1 == 1){e2.src = "Bilder/punkte_rot.gif";}
if (ident3 != "" && punkt2 == 1){e3.src = "Bilder/punkte_rot.gif";}
	}
	else
	{
e1.src = "Bilder/"+ident1+".gif";
if (ident2 != "" && punkt1 != 1){e2.src = "Bilder/linie_braun.gif";}
if (ident3 != "" && punkt2 != 1){e3.src = "Bilder/linie_braun.gif";}
if (ident2 != "" && punkt1 == 1){e2.src = "Bilder/punkte_braun.gif";}
if (ident3 != "" && punkt2 == 1){e3.src = "Bilder/punkte_braun.gif";}
	}
}
