var oben_pressed = false;
var unten_pressed = false;
var drag_drop = false;
var old_x = -1;
var old_y = -1;


function MouseInit()
{
// MSIE, Konqueror, Opera : 
  if (document.all) {
  	//alert("asd2");
    document.onmousemove=MouseMove;
    document.onmouseup=Mouseup;
    //document.onmousemove = getMouseXY;
    }
	// Netscape, Mozilla : 
  else
  {
	// Netscape6, Mozilla : 
    if (typeof(document.addEventListener)=="function") 
    	{
    	//document.addEventListener("mousemove",MouseMove,true);
    	//document.addEventListener("mouseup",MouseUp,true);
    	document.captureEvents(Event.MOUSEMOVE)
    	document.onmousemove=MouseMove;
    	document.captureEvents(Event.MOUSEUP)
    	document.onmouseup=Mouseup;
    	//document.captureEvents(Event.MOUSEMOVE)
    	//alert("yep"); 
    	}
	// Netscape4 : 
    else
    {
      window.captureEvents(Event.MOUSEMOVE);
      window.onmousemove=MouseMove;
      window.captureEvents(Event.MOUSEUP);
      window.onmouseup=Mouseup;
    }
  }
}

function Mouseup(event) 
	{ 
	if ((oben_pressed) || (unten_pressed) || (drag_drop))
		{ document.body.onselectstart = null; }
	drag_drop=false;
	unten_pressed=false;
	oben_pressed=false;
	//alert("up");
	}

function MouseMove(e)
// Ueberwachung der Mausbewegungen 
{
  var mausx,mausy;
  // MSIE, Konqueror, Opera :
  if (document.all)
  {
    mausx=event.clientX;
    mausy=event.clientY;
    if (document.body.scrollLeft)
      mausx+=document.body.scrollLeft;
    if (document.body.scrollTop)
      mausy+=document.body.scrollTop;
  }
  // Netscape, Mozilla : 
  else
  {
    mausx=e.pageX;
    mausy=e.pageY;
  }
// Auswertung : 
	if (drag_drop==true)
		{
		//alert("yep");
		document.body.onselectstart = function() { return false; };
		var a = document.getElementById("scroller");
		a.onselectstart = function() { return false; };
		//a.style.MozUserSelect = "none";
		//a.unselectable = "on";
		if (old_y == -1) 
  			{ delta_y = 0; }
  		else
  			{ delta_y = mausy - old_y; }
  		if (delta_y > 0)
  			{ drag_down(delta_y); }
  		if (delta_y < 0)
  			{
  				delta2_y = delta_y * -1;
  				drag_up(delta2_y);
  			}
		}
	old_y = mausy;
	old_x = mausx;
	//document.getElementById('debug_y').innerHTML=mausy;
	if (document.all) {
		//document.all.debug_y.innerHTML=mausy;
	} else {
		//document.getElementById('debug_y').innerHTML=mausy;
	}
	//alert(mausy);
}

function my_release() {
	oben_pressed = false;
	unten_pressed = false;
	if ((oben_pressed) || (unten_pressed) || (drag_drop))
		{
		document.body.onselectstart = null;
		}
}
	function strExtract(myStr, myWas) {
		// myWas:
		// 1=1. komp, 2=2. komp ... 4= 4. komp.
		var laenge;
		laenge=myStr.length;
		var myChar;
		var auslesen;
		var boolFertig;
		var boolAnf;
		var myCount;
		var intArrayZaehler;
		var i;
		boolFertig=false;
		boolAnf=false;
		myCount = 0;
		auslesen='';
		//alert(myStr);
		intArrayZaehler = 0;
		for (i=0; i<laenge; i++) {
		myChar = myStr.substr(i,1);
		if (myWas == 1) {
			if ((i>4) && (boolFertig == false)) {
			if (myChar == "p") {
				boolFertig = true;
				}
			if (boolFertig == false) {
				//alert(myChar);
				auslesen = auslesen.concat(myChar);
				}
			}
			}
		if (myWas == 2) {
			if (boolAnf == true) {
			if (myChar == "p") {
				boolFertig = true;
				}
			if (boolFertig == false) {
				//alert(myChar);
				auslesen = auslesen.concat(myChar);
				}
			}
			if ((myChar == " ") && (boolAnf == false)) {
			boolAnf = true;
			}
			}
		if (myWas == 3) {
			if (boolAnf == true) {
			if (myChar == "p") {
				boolFertig = true;
				}
			if (boolFertig == false) {
				//alert(myChar);
				auslesen = auslesen.concat(myChar);
				}
			}
			if ((myChar == " ") && (boolAnf == false)) {
			myCount++;
			if (myCount==2) {
				boolAnf = true;
				}
			}
			}
		if (myWas == 4) {
			if (boolAnf == true) {
			if (myChar == "p") {
				boolFertig = true;
				}
			if (boolFertig == false) {
				//alert(myChar);
				auslesen = auslesen.concat(myChar);
				}
			}
			if ((myChar == " ") && (boolAnf == false)) {
			myCount++;
			if (myCount==3) {
				boolAnf = true;
				}
			}
			}
		//alert(auslesen);
		}
		//alert(auslesen);
		return auslesen;
		}
		
	function strReplaceClip(strOben, strRechts, strUnten, strLinks) {
		var strFinish;
		//strFinish = strClip.replace(/\d+/, strHoehe);
		strFinish = "rect(" + strOben + "px ";
		strFinish = strFinish + strRechts + "px ";
		strFinish = strFinish + strUnten + "px ";
		strFinish = strFinish + strLinks + "px)";
		return strFinish;
		}

	function strReplacePX(strInt) {
		var strFinish;
		strFinish = strInt + "px";
		//alert(strFinish);
		return strFinish;
		}

	function strExtractSimple(myStr) {
		var strFinish;
		var boolEnde;
		var laenge;
		//alert(myStr);
		strFinish = "";
		laenge = myStr.length;
		boolEnde=false;
		for (i=0; i<laenge; i++) {
		myChar = myStr.substr(i,1);
		if ((boolEnde==false) && (myChar!="p")) {
			strFinish = strFinish.concat(myChar);
			} else {
			boolEnde = true;
			}
		}
		return strFinish
		}
		
function clk_down() {
	clk_down_anz(korrektur_box());
}


function clk_down_anz(i) 
{
	var oben;
	var rechts;
	var unten;
	var links;
	var top;
	//var scrollBox
	if (document.all) {
		if (checkBounds("unten")) {
			//document.all.scrollBox.style.backgroundColor = "#ff9933";
			oben = strExtract(document.all.scrollBox.style.clip, 1);
			rechts = strExtract(document.all.scrollBox.style.clip, 2);
			unten = strExtract(document.all.scrollBox.style.clip, 3);
			links = strExtract(document.all.scrollBox.style.clip, 4);
			oben = parseInt(oben) + i;
			unten = parseInt(unten) + i;
			var strClip;
			strClip = strReplaceClip(oben, rechts, unten, links);
			document.all.scrollBox.style.clip = strClip;
			top = strExtractSimple(document.all.scrollBox.style.top);
			top = parseInt(top) - i;
			var strTop;
			strTop = strReplacePX(top);
			document.all.scrollBox.style.top = strTop;
		}
	} else {
		//
		// Safari
		//
		if (checkBounds("unten")) {
			//document.getElementById('scrollBox').style.backgroundColor= "#FF9933";
			//alert(document.getElementById('scrollBox').style.clip);
			oben = strExtract(document.getElementById('scrollBox').style.clip, 1);
			rechts = strExtract(document.getElementById('scrollBox').style.clip, 2);
			unten = strExtract(document.getElementById('scrollBox').style.clip, 3);
			links = strExtract(document.getElementById('scrollBox').style.clip, 4);
			oben = parseInt(oben) + i;
			unten = parseInt(unten) + i;
			var strClip;
			strClip = strReplaceClip(oben, rechts, unten, links);
			//alert(strClip);
			document.getElementById('scrollBox').style.clip = strClip;
			//alert(document.getElementById('scrollBox').style.top);
			top = strExtractSimple(document.getElementById('scrollBox').style.top);
			top = parseInt(top) - i;
			var strTop;
			strTop = strReplacePX(top);
			document.getElementById('scrollBox').style.top = strTop;
			//alert(document.getElementById('scrollBox').offsetHeight);
		}
	}
	//scrollBox.style.backgroundColor= "yellow";
	//alert("hallo");	

}

function runde(i)
	{
	x=parseInt(i);
	y=parseInt(i*10);
	y=y-10*x;
	if (y>4) x=x+1;
	return x;
	}

function korrektur_box() {
	var my_box_soll;
	my_box_soll = 0;
	if (document.all) {
		//document.all.debug_y.innerHTML=mausy;
		my_glob_bottom = document.all.scrollBox.offsetHeight;
		my_glob_scroll_laenge = strExtractSimple(document.all.scroll_leiste.style.height);
		my_glob_scroll_laenge = parseInt(my_glob_scroll_laenge);
		box_schiebe_laenge = my_glob_bottom - glob_unten_clip;
		scroller_schiebe_laenge = my_glob_scroll_laenge-26;
		var ber_rel = box_schiebe_laenge / scroller_schiebe_laenge;
		my_scroller = strExtractSimple(document.all.scroller.style.top);
		my_scroller = parseInt(my_scroller);
		my_rel = my_scroller-glob_scroller_top;
		my_box_soll = runde(glob_top-ber_rel*my_rel);
	
		my_glob_top=strExtractSimple(document.all.scrollBox.style.top);
		my_glob_top = parseInt(my_glob_top);
	
		//document.all.debug_y.innerHTML="m:"+my_glob_top+" ss:"+my_box_soll;
	} else {
		my_glob_bottom = document.getElementById('scrollBox').offsetHeight;
		my_glob_scroll_laenge = strExtractSimple(document.getElementById('scroll_leiste').style.height);
		my_glob_scroll_laenge = parseInt(my_glob_scroll_laenge);
		box_schiebe_laenge = my_glob_bottom - glob_unten_clip;
		scroller_schiebe_laenge = my_glob_scroll_laenge-26;
		var ber_rel = box_schiebe_laenge / scroller_schiebe_laenge;
		my_scroller = strExtractSimple(document.getElementById('scroller').style.top);
		my_scroller = parseInt(my_scroller);
		my_rel = my_scroller-glob_scroller_top;
		my_box_soll = runde(glob_top-ber_rel*my_rel);
	
		my_glob_top=strExtractSimple(document.getElementById('scrollBox').style.top);
		my_glob_top = parseInt(my_glob_top);
	
		//document.getElementById('debug_y').innerHTML="m:"+my_glob_top+" ss:"+my_box_soll;
	}
	
	return runde(my_glob_top-my_box_soll);
	// Maba: 103%
	//	top = strExtractSimple(document.getElementById('scroller').style.top);
	//	top = parseInt(top) + i;
	}

function drag_down(i) 
	{
	scroller_down_anz(i);
	var schrittweite =korrektur_box();
	clk_down_anz(schrittweite);
	}

function scroller_down() {
	var box_schiebe_laenge;
	var scroller_schiebe_laenge;
	box_schiebe_laenge = glob_bottom - glob_unten_clip;
	scroller_schiebe_laenge = glob_scroll_laenge;
	var ber_rel = scroller_schiebe_laenge / box_schiebe_laenge;
	var schrittweite = parseInt(20 * ber_rel);
	scroller_down_anz(schrittweite);
}

function scroller_down_anz(i)
{
	var top;
	var box_schiebe_laenge;
	var scroller_schiebe_laenge;
	box_schiebe_laenge = glob_bottom - glob_unten_clip;
	scroller_schiebe_laenge = glob_scroll_laenge;

	if (document.all) {
		//2Do
		top = strExtractSimple(document.all.scroller.style.top);
		top = parseInt(top) + i;
		//alert(glob_scroller_top);
		if (glob_mac) {
			if (glob_scroller_top + glob_scroll_laenge - glob_scroller_laenge+(25*einmalfaktor) < top) {
				top = glob_scroller_top + glob_scroll_laenge - glob_scroller_laenge+(25*einmalfaktor);
			} 
		} else {
			if (glob_scroller_top + glob_scroll_laenge - glob_scroller_laenge < top) {
				top = glob_scroller_top + glob_scroll_laenge - glob_scroller_laenge;
			} 
		}
		var strTop;
		strTop = strReplacePX(top);
		document.all.scroller.style.top = strTop;
	} else {
		// Safari
		top = strExtractSimple(document.getElementById('scroller').style.top);
		top = parseInt(top) + i;
		//alert(glob_scroller_top);
		if (glob_scroller_top + glob_scroll_laenge - glob_scroller_laenge < top) {
			top = glob_scroller_top + glob_scroll_laenge - glob_scroller_laenge;
		} 
		var strTop;
		strTop = strReplacePX(top);
		document.getElementById('scroller').style.top = strTop;
		
	}

}

function scroller_up() {
	var top;
	var box_schiebe_laenge;
	var scroller_schiebe_laenge;
	box_schiebe_laenge = glob_bottom - glob_unten_clip;
	scroller_schiebe_laenge = glob_scroll_laenge;
	var ber_rel = scroller_schiebe_laenge / box_schiebe_laenge;
	var schrittweite = parseInt(20 * ber_rel);
	scroller_up_anz(schrittweite);
}

function scroller_up_anz(i) {
	var top;
	var box_schiebe_laenge;
	var scroller_schiebe_laenge;
	box_schiebe_laenge = glob_bottom - glob_unten_clip;
	scroller_schiebe_laenge = glob_scroll_laenge;
	var ber_rel = scroller_schiebe_laenge / box_schiebe_laenge;
	if (document.all) {
		//2Do
		top = strExtractSimple(document.all.scroller.style.top);
		top = parseInt(top) - i;
		if (glob_mac) {
			if (glob_scroller_top+(25*einmalfaktor) > top) {
				top = glob_scroller_top+(25*einmalfaktor);
			}
		} else {
			if (glob_scroller_top > top) {
				top = glob_scroller_top;
			}
		}
		var strTop;
		strTop = strReplacePX(top);
		document.all.scroller.style.top = strTop;
	} else {
		// Safari
		top = strExtractSimple(document.getElementById('scroller').style.top);
		top = parseInt(top) - i;
		if (glob_scroller_top > top) {
			top = glob_scroller_top;
		}
		var strTop;
		strTop = strReplacePX(top);
		document.getElementById('scroller').style.top = strTop;
	}
}


function drag_up(i) {
	scroller_up_anz(i);
	var schrittweite = -1*korrektur_box();
	clk_up_anz(schrittweite);
}

function clk_up() {
	clk_up_anz(korrektur_box()*-1);
}

function clk_up_anz(i) {
	var oben;
	var rechts;
	var unten;
	var links;
	var top;
	//var scrollBox
	//alert("asdfasdf");
	if (document.all) {
		if (checkBounds("oben")) {
			//document.all.scrollBox.style.backgroundColor = "#ff9933";
			oben = strExtract(document.all.scrollBox.style.clip, 1);
			rechts = strExtract(document.all.scrollBox.style.clip, 2);
			unten = strExtract(document.all.scrollBox.style.clip, 3);
			links = strExtract(document.all.scrollBox.style.clip, 4);
			oben = parseInt(oben) - i;
			unten = parseInt(unten) - i;
			var strClip;
			strClip = strReplaceClip(oben, rechts, unten, links);
			document.all.scrollBox.style.clip = strClip;
			top = strExtractSimple(document.all.scrollBox.style.top);
			top = parseInt(top) + i;
			var strTop;
			strTop = strReplacePX(top);
			document.all.scrollBox.style.top = strTop;
		}
	} else {
		//
		// Safari
		//
		if (checkBounds("oben")) {
			//document.getElementById('scrollBox').style.backgroundColor= "#FF9933";
			//alert(document.getElementById('scrollBox').style.clip);
			oben = strExtract(document.getElementById('scrollBox').style.clip, 1);
			rechts = strExtract(document.getElementById('scrollBox').style.clip, 2);
			unten = strExtract(document.getElementById('scrollBox').style.clip, 3);
			links = strExtract(document.getElementById('scrollBox').style.clip, 4);
			oben = parseInt(oben) - i;
			unten = parseInt(unten) - i;
			var strClip;
			strClip = strReplaceClip(oben, rechts, unten, links);
			//alert(strClip);
			document.getElementById('scrollBox').style.clip = strClip;
			//alert(document.getElementById('scrollBox').style.top);
			top = strExtractSimple(document.getElementById('scrollBox').style.top);
			top = parseInt(top) + i;
			var strTop;
			strTop = strReplacePX(top);
			document.getElementById('scrollBox').style.top = strTop;
			//alert(document.getElementById('scrollBox').offsetHeight);
		}
	}
	//scrollBox.style.backgroundColor= "yellow";
	//alert("hallo");
}

var einmal = false;
var einmalfaktor = 1;
function timer() {
	var top;
	var left;
	if (oben_pressed) {
		scroller_up();
		clk_up();
		}
	if (unten_pressed) {
		scroller_down();
		clk_down();
	}
}

function checkBounds(oben_unten) {
	var top;
	if (oben_unten == "oben") {
		if (document.all) {
			top=strExtractSimple(document.all.scrollBox.style.top);
			top = parseInt(top);
			if (top >= glob_top) {
				return false;
				//false
			} else {
				return true;
			}
		} else {
			top=strExtractSimple(document.getElementById('scrollBox').style.top);
			top = parseInt(top);
			if (top >= glob_top) {
				return false;
			} else {
				return true;
			}
		}
	} else {
	// unten
		if (document.all) {
			top=strExtractSimple(document.all.scrollBox.style.top);
			top = parseInt(top);
			if (top < glob_ber) {
				return false;
			} else {
				return true;
			}
		} else {
			top=strExtractSimple(document.getElementById('scrollBox').style.top);
			top = parseInt(top);
			if (top < glob_ber) {
				return false;
				//false
			} else {
				return true;
			}
		}

	}

}

function  baue_scroller() {
	// Versatz im Internet Explorer
	if (document.all) {
		if (glob_mac) {
			document.write("<div style=\"position:absolute;top:130px;left:737px;\" onMouseDown=\"oben_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/01_pfeil_oben.gif\" ></div>");
			document.write("<div id=\"scroll_leiste\" style=\"background-color:#e6e6e6;position:absolute;top:143px;left:737px;height:279px;width:13px;\"> </div>");
			document.write("<div id=\"scroller\" style=\"position:absolute;top:143px;left:737px;background-color:#D7D5D1;height:20px;width:13px;\" ");
			//document.write("<div id=\"scroller\" style=\"position:absolute;top:168px;left:493px;background-color:#D7D5D1;height:20px;width:13px;\" ");
				document.write("onMouseDown=\"drag_drop=true;\" >");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:11px;height:20px;background-color:#C1C6CF;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:9px;height:20px;background-color:#6B84B7;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:7px;height:20px;background-color:#0E3A93;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:5px;height:20px;background-color:#0E3C92;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:3px;height:20px;background-color:#154596;\">");
				document.write("</div></div></div></div></div></div>");
			document.write("<div style=\"position:absolute;top:422px;left:737px;\" onMouseDown=\"unten_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/03_pfeil_unten.gif\" ></div>");
		} else {
			document.write("<div style=\"position:absolute;top:155px;left:747px;\" onMouseDown=\"oben_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/01_pfeil_oben.gif\" ></div>");
			document.write("<div id=\"scroll_leiste\" style=\"background-color:#e6e6e6;position:absolute;top:168px;left:747px;height:279px;width:13px;\"> </div>");
			document.write("<div id=\"scroller\" style=\"position:absolute;top:168px;left:747px;background-color:#D7D5D1;height:20px;width:13px;\" ");
			//document.write("<div id=\"scroller\" style=\"position:absolute;top:177px;left:494px;background-color:#D7D5D1;height:20px;width:13px;\" ");
				document.write("onMouseDown=\"drag_drop=true;\" >");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:11px;height:20px;background-color:#C1C6CF;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:9px;height:20px;background-color:#6B84B7;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:7px;height:20px;background-color:#0E3A93;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:5px;height:20px;background-color:#0E3C92;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:3px;height:20px;background-color:#154596;\">");
				document.write("</div></div></div></div></div></div>");
			document.write("<div style=\"position:absolute;top:445px;left:747px;\" onMouseDown=\"unten_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/03_pfeil_unten.gif\" ></div>");
		}
	} else {
		document.write("<div style=\"position:absolute;top:148px;left:745px;\" onMouseDown=\"oben_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/01_pfeil_oben.gif\" ></div>");
		document.write("<div id=\"scroll_leiste\" style=\"background-color:#e6e6e6;position:absolute;top:161px;left:745px;height:279px;width:13px;\"> </div>");
		document.write("<div id=\"scroller\" style=\"position:absolute;top:161px;left:745px;background-color:#D7D5D1;height:20px;width:13px;\" ");
		//document.write("<div id=\"scroller\" style=\"position:absolute;top:161px;left:493px;background-color:#D7D5D1;height:20px;width:13px;\" ");
				document.write("onMouseDown=\"drag_drop=true;\" >");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:11px;height:20px;background-color:#C1C6CF;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:9px;height:20px;background-color:#6B84B7;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:7px;height:20px;background-color:#0E3A93;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:5px;height:20px;background-color:#0E3C92;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:3px;height:20px;background-color:#154596;\">");
				document.write("</div></div></div></div></div></div>");
		document.write("<div style=\"position:absolute;top:440px;left:745px;\" onMouseDown=\"unten_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/03_pfeil_unten.gif\" ></div>");
	}
}

function  baue_scrollbox() {
	// Versatz im Internet Explorer
	if (document.all) {
		var agt = navigator.userAgent.toLowerCase();
		var is_mac    = (agt.indexOf("mac")!=-1);
		if (is_mac) glob_mac=true;
		//alert("wad");
		if (glob_mac) {
			document.write("<DIV ID=\"scrollBox\" style=\"position:absolute;top:140px;left:265px;width:480px;clip:rect(0px 480px 280px 0px);\">");
		} else {
			document.write("<DIV ID=\"scrollBox\" style=\"position:absolute;top:170px;left:270px;width:480px;clip:rect(0px 480px 280px 0px);\">");
		}
	} else {
		document.write("<DIV ID=\"scrollBox\" style=\"position:absolute;top:160px;left:270px;width:480px;clip:rect(0px 480px 280px 0px);\">");
	}
}

function  baue_scroller_main() {
	// Versatz im Internet Explorer
	if (document.all) {
		if (glob_mac) {
			einmal = true;
			einmalfaktor = 0;
			document.write("<div style=\"position:absolute;top:155px;left:493px;\" onMouseDown=\"oben_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/01_pfeil_oben.gif\" ></div>");
			document.write("<div id=\"scroll_leiste\" style=\"background-color:#e6e6e6;position:absolute;top:168px;left:493px;height:229px;width:13px;\"> </div>");
			document.write("<div id=\"scroller\" style=\"position:absolute;top:168px;left:493px;background-color:#D7D5D1;height:20px;width:13px;\" ");
				document.write("onMouseDown=\"drag_drop=true;\" >");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:11px;height:20px;background-color:#C1C6CF;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:9px;height:20px;background-color:#6B84B7;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:7px;height:20px;background-color:#0E3A93;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:5px;height:20px;background-color:#0E3C92;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:3px;height:20px;background-color:#154596;\">");
				document.write("</div></div></div></div></div></div>");
			document.write("<div style=\"position:absolute;top:397px;left:493px;\" onMouseDown=\"unten_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/03_pfeil_unten.gif\" ></div>");
		} else {
			document.write("<div style=\"position:absolute;top:164px;left:494px;\" onMouseDown=\"oben_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/01_pfeil_oben.gif\" ></div>");
			document.write("<div id=\"scroll_leiste\" style=\"background-color:#e6e6e6;position:absolute;top:177px;left:494px;height:229px;width:13px;\"> </div>");
			document.write("<div id=\"scroller\" style=\"position:absolute;top:177px;left:494px;background-color:#D7D5D1;height:20px;width:13px;\" ");
				document.write("onMouseDown=\"drag_drop=true;\" >");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:11px;height:20px;background-color:#C1C6CF;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:9px;height:20px;background-color:#6B84B7;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:7px;height:20px;background-color:#0E3A93;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:5px;height:20px;background-color:#0E3C92;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:3px;height:20px;background-color:#154596;\">");
				document.write("</div></div></div></div></div></div>");
			document.write("<div style=\"position:absolute;top:406px;left:494px;\" onMouseDown=\"unten_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/03_pfeil_unten.gif\" ></div>");
		}
	} else {
		document.write("<div id=\"scroll_img_up\"  style=\"position:absolute;top:148px;left:495px;\" onMouseDown=\"oben_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/01_pfeil_oben.gif\" ></div>");
		document.write("<div id=\"scroll_leiste\" style=\"background-color:#e6e6e6;position:absolute;top:161px;left:495px;height:229px;width:13px;\"> </div>");
		document.write("<div id=\"scroller\" style=\"position:absolute;top:161px;left:495px;background-color:#D7D5D1;height:20px;width:13px;\" ");
				document.write("onMouseDown=\"drag_drop=true;\" >");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:11px;height:20px;background-color:#C1C6CF;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:9px;height:20px;background-color:#6B84B7;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:7px;height:20px;background-color:#0E3A93;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:5px;height:20px;background-color:#0E3C92;\">");
				document.write("<div style=\"position:relative;left:1px;top:0px;width:3px;height:20px;background-color:#154596;\">");
				document.write("</div></div></div></div></div></div>");
		document.write("<div id=\"scroll_img_down\" style=\"position:absolute;top:389px;left:495px;\" onMouseDown=\"unten_pressed=true;\" onMouseUp=\"my_release()\"><img src=\"/elemente_en/03_pfeil_unten.gif\" ></div>");
	}
}

function  baue_scrollbox_main() {
	// Versatz im Internet Explorer
	if (document.all) {
		var agt = navigator.userAgent.toLowerCase();
		var is_mac    = (agt.indexOf("mac")!=-1);
		if (is_mac) glob_mac=true;
		//alert("wad");
		if (glob_mac) {
			document.write("<DIV ID=\"scrollBox\" style=\"position:absolute;top:165px;left:265px;width:220px;clip:rect(0px 230px 230px 0px);\">");
		} else {
			document.write("<DIV ID=\"scrollBox\" style=\"position:absolute;top:175px;left:263px;width:220px;clip:rect(0px 230px 230px 0px);\">");
		}
	} else {
		document.write("<DIV ID=\"scrollBox\" style=\"position:absolute;top:160px;left:265px;width:220px;clip:rect(0px 230px 230px 0px);\">");
	}
}

var glob_top;
var glob_bottom;
var glob_mac = false;
var glob_unten_clip;
var glob_ber;
function  ber_init() {
	var agt = navigator.userAgent.toLowerCase();
	var is_mac    = (agt.indexOf("mac")!=-1);
	setInterval("timer()", 150);
	MouseInit();
	if (is_mac) glob_mac=true;
	if (document.all) {
		glob_top=strExtractSimple(document.all.scrollBox.style.top);
		glob_top = parseInt(glob_top);
		glob_bottom = document.all.scrollBox.offsetHeight;
		glob_unten_clip = strExtract(document.all.scrollBox.style.clip, 3);
		glob_unten_clip = parseInt(glob_unten_clip);
		glob_ber = glob_top - (glob_bottom - glob_unten_clip)
		glob_scroll_laenge = strExtractSimple(document.all.scroll_leiste.style.height);
		glob_scroll_laenge = parseInt(glob_scroll_laenge);
		glob_scroller_laenge = document.all.scroller.offsetHeight;
		glob_scroller_laenge = parseInt(glob_scroller_laenge);
		glob_scroller_top = strExtractSimple(document.all.scroller.style.top);
		glob_scroller_top = parseInt(glob_scroller_top);
		//alert(glob_top+' '+glob_bottom+' '+glob_unten_clip+' '+glob_scroll_laenge+' '+glob_scroller_laenge+' ' +glob_scroller_top)
	
	} else {
		glob_top=strExtractSimple(document.getElementById('scrollBox').style.top);
		glob_top = parseInt(glob_top);
		glob_bottom = document.getElementById('scrollBox').offsetHeight;
		glob_unten_clip = strExtract(document.getElementById('scrollBox').style.clip, 3);
		glob_unten_clip = parseInt(glob_unten_clip);
		glob_ber = glob_top - (glob_bottom - glob_unten_clip)
		glob_scroll_laenge = strExtractSimple(document.getElementById('scroll_leiste').style.height);
		glob_scroll_laenge = parseInt(glob_scroll_laenge);
		glob_scroller_laenge = document.getElementById('scroller').offsetHeight;
		glob_scroller_laenge = parseInt(glob_scroller_laenge);
		glob_scroller_top = strExtractSimple(document.getElementById('scroller').style.top);
		glob_scroller_top = parseInt(glob_scroller_top);
		//alert(glob_unten_clip);
		//alert(glob_top+' '+glob_bottom+' '+glob_unten_clip+' '+glob_scroll_laenge+' '+glob_scroller_laenge+' ' +glob_scroller_top);
	}

}

