ie=(navigator.appName.indexOf("Explorer") != -1) ? 1:0;

scroll_max=0;
scroll_min=0;
pos_y=0;
dir=0;
speed=10;
var int_id;
// function ermittelt die aktuelle Fenstergrösse sowie die scrollposition
function init(){
	if(document.getElementById('navi')){
         	// Mouseover-effekt
                 ids=Array('home','show','term','art','kont');
         	for (var i = 0; i < ids.length; i++){
                 	if( document.getElementById( ids[i] )){
			var link = document.getElementById( ids[i] );
                 	if(document.getElementById( ids[i]).getAttribute('href')){
				link.i = i;
				link.onmouseover = function() {
					bild( ids[this.i] ,1);
				};
				link.onmouseout = function() {
					bild( ids[this.i] ,0);
				};
                 	}
                         }
		}
         	// scrollbar
                 if(document.getElementById('scrollbox')){
         	scroll_min=document.getElementById('scrollbox').offsetHeight-document.getElementById('cont').offsetHeight;
                 document.getElementById('scrollbox').style.overflow='hidden';
                 if(scroll_min<0){
                 	document.getElementById('scrollbar').style.display='block';
                         document.getElementById('scrollbar').innerHTML='<a id="scrUp"><img src="../pics/scroll_up.gif" width="23" height="33" border="0" alt="hoch" /></a><a id="scrDown"><img src="../pics/scroll_down.gif" width="23" height="33" border="0" alt="runter" /></a>';
                 	document.getElementById('scrUp').onmousedown= scrollUp;
                 	document.getElementById('scrDown').onmousedown= scrollDown;
                 	document.getElementById('scrUp').onmouseout= stop;
                 	document.getElementById('scrDown').onmouseout= stop;
                 	document.getElementById('scrUp').onmouseup= stop;
                 	document.getElementById('scrDown').onmouseup= stop;
                 }else document.getElementById('scrollbar').style.display='none';
                 }
         }
}
function bild(id,val){

	if(val)t="-30px";
         else t="0px";
	document.getElementById(id).getElementsByTagName('img')[0].style.top = t;
}
function scroll(){
	if((pos_y>scroll_min && dir<0) || (pos_y<scroll_max && dir>0))pos_y+=dir;
         else clearInterval(int_id);
         pos_y_str=pos_y+'px';
         document.getElementById('cont').style.top= pos_y_str;
}
function scrollUp(){
         stop();
	dir=5;
         int_id=setInterval(scroll,speed);

}
function scrollDown(){
         stop();
	dir=-5;
         int_id=setInterval(scroll,speed);

}
function stop(){
	clearInterval(int_id);
         dir=0;
}
window.onload = init;