//NAVI
var nav_timer;

function on(name_image){
	//clearTimeout(nav_timer);
	$(name_image).src = "/img/navi/" + name_image + "_on.gif";
}

function off(name_image){
	$(name_image).src = "/img/navi/" + name_image + "_off.gif";
}

function off_image(name_image){
	nav_timer = setTimeout("off('" + name_image + "')", 1);
}

navHover = function() {
	var lis = $("navi").getElementsBySelector("LI");
	for (var i=0; i<lis.length; i++) {	
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), ""); // geht nicht in firefox
		}
	}
}

if (Prototype.Browser.IE){ window.attachEvent("onload", navHover); }


// ANIMATION
var timer;

function ani_effect(step,top){
	if (step == 1){
		clearTimeout(timer);
		$("blue_area").style.top = top + 10 + 'px';
		Effect.Appear($("blue_area")); 
		timer =  setTimeout("ani_effect(2," + top + ")", 1000);
	}else if(step == 2){
		clearTimeout(timer);
		top = top - 2;
		if (top > 0){
			$("logo_ani").style.top = top + 'px';
			$("blue_area").style.top = top + 'px';
			$("animation").style.left
			timer =  setTimeout("ani_effect(2," + top + ")", 8);
		}else{
			timer =  setTimeout("ani_effect(3,0)", 800);
		}
	}else if(step == 3){
		clearTimeout(timer);
		Effect.Fade($("animation"),{duration: 1.0});
		Effect.Appear($("site"),{duration: 2.0});
		//timer =  setTimeout("ani_effect(0,0)", 100);
	}else{
		clearTimeout(timer);
		$("animation").hide();
	}
}

animation = function() {
	if ($("animation")){
		$("animation").show();
		$("site").hide();
		
		var breite = document.body.scrollWidth;
		var left = (breite/2) - (760/2) - 8;
		var hoehe = document.body.scrollHeight;
		var top = (hoehe/2) - 100;

		$("logo_ani").style.left = left + 'px';
		$("logo_ani").style.top = top + 'px';
		Effect.Appear($("logo_ani"),{duration: 0.5});
		timer = setTimeout("ani_effect(1," + top + ")", 1000);
	}else{
		$("site").show();
	}
}

//loeschen warnung

function warning(path){
	if(confirm('Wollen Sie dieses Dokument wirklich loeschen?')==true){
		location.href = path;
	}	
}

// mitarbeiter
function showTeam(id_team){
	$(id_team).style.display = "block";
	if(id_team == "team_wrocklage"){
		$("team_dahlhoff").style.display = "none";
		$("team_korzen").style.display = "none";
		$("team_plettenberg").style.display = "none";
		$("team_cappel").style.display = "none";
		$("team_witte").style.display = "none";
	}else if(id_team == "team_dahlhoff"){
		$("team_wrocklage").style.display = "none";
		$("team_korzen").style.display = "none";
		$("team_plettenberg").style.display = "none";
		$("team_cappel").style.display = "none";
		$("team_witte").style.display = "none";
	}else if(id_team == "team_korzen"){
		$("team_dahlhoff").style.display = "none";
		$("team_wrocklage").style.display = "none";
		$("team_plettenberg").style.display = "none";
		$("team_cappel").style.display = "none";
		$("team_witte").style.display = "none";
	}else if(id_team == "team_plettenberg"){
		$("team_dahlhoff").style.display = "none";
		$("team_wrocklage").style.display = "none";
		$("team_korzen").style.display = "none";
		$("team_cappel").style.display = "none";
		$("team_witte").style.display = "none";
	}else if(id_team == "team_witte"){
		$("team_dahlhoff").style.display = "none";
		$("team_wrocklage").style.display = "none";
		$("team_korzen").style.display = "none";
		$("team_plettenberg").style.display = "none";
		$("team_cappel").style.display = "none";
	}else if(id_team == "team_cappel"){
		$("team_dahlhoff").style.display = "none";
		$("team_wrocklage").style.display = "none";
		$("team_korzen").style.display = "none";
		$("team_plettenberg").style.display = "none";
		$("team_witte").style.display = "none";
	}
}

//scrollbar
function scrollbar_visible(){
	hoch   = document.body.clientHeight * 1;
  fhoch  = document.body.scrollHeight * 1;
			alert(hoch + '-' + fhoch);
	if(Prototype.Browser.IE){
		if(hoch < fhoch){
			//$("header_container").style.paddingRight = 16 + 'px';
		}else{
		//	$("header_container").style.paddingRight = 0;
		}
	}
}