/* 
Grieger Online
Modified Javascript

Final Fixes: 
Rheingans Company GmbH - www.rcgmbh.com
*/

//timeout der infobox texte
a_timeout_info = new Array();
a_infoText_visible = new Array();
a_downLayer = new Array();
a_infobox_div = new Array(); //saves the div.info elements
i_cur_opacity = 0;

var laydown= "";
var b_infoDa = 0;
var className = "className";  //ie bug
var zeit ='';
//var dauer = 9000; //default Dauer

var firstInfoBoxTimeout = null;

/*fading effect by jenkhardt*/
/*globale vars*/
// vorher var obj_box = null;
var obj_box; //  = 0;
var i_cur_opacity = 0;  //current opacity value
var i_max_opacity = 80;  //maximum opacity value
var b_info_open = 0; //is info open? 0 = false; 1 = true
var i_fade_interval = 100; //fading interval, 100ms;
var i_fade_interval_opacity = 10; //step of opacity value which to increase/decrease per intervall

// timeout set on the fly for special-case infobox display (startpage/products)
// added by mhr
var infoboxTimeout=null;
var dauer = null;
var infoboxTimeoutPointer = null;

/* ----------------------------------------
	JQuery: $(document).ready()
	wird ausgeführt, wenn DOM geladen ist.
	Geändert von RC GmbH am 07.11.2008   */
$(document).ready(function () {
	//Hier steht, was nach laden des DOM gemacht werden soll:
	
	try {
		//info-Button ausblenden, sobald es keine Großen Bilder gibt:
		
		if($('#schalter2').get() == '') {
			//Ausblenden des Infobuttons:
			$('#info-button').css({ display: 'none' });
		}
		
		
		setVisuals();
		
		// Slideshow Length	
		// alert(document.getElementById("slideshowLengthInMs") );
		if (document.getElementById("slideshowLengthInMs") != null && document.getElementById("slideshowLengthInMs").firstChild.nodeValue != "" && document.getElementById("slideshowLengthInMs").firstChild.nodeValue != 0) {
			dauer = document.getElementById("slideshowLengthInMs").firstChild.nodeValue;
			// alert('dauer aus xhtml gesetzt auf: '+dauer);
		} else {
			// default
			dauer = 9000;
		}
		
		
		// InfoBox Timeout
		if (document.getElementById("infoboxTimeout").firstChild!=null) {
			if(document.getElementById("infoboxTimeout").firstChild.nodeValue!=null) {
				infoboxTimeout = document.getElementById("infoboxTimeout").firstChild.nodeValue;
				infoboxTimeoutPointer = window.setTimeout("infoboxTimeoutFadeOut()",infoboxTimeout);
			}
		
			// alert('dauer: ' + dauer + '\ninfoboxTimeout: ' + infoboxTimeout + '\ninfoboxTimeoutPointer: '+infoboxTimeoutPointer);
		
		} else {
			// alert('infoboxTimeout nicht gesetzt');
		}
	
	} catch (e) {
		
	}
	
	
	
	//Info Button einblenden:
	
	// Setup Slideshow 
	zeit = window.setTimeout("rauf()",dauer);
	
	// fade-in first layer
	// window.setTimeout("show('info-layer',0,infoboxTimeout)", 0000);
	show('info-layer',0);

	
	
	// Infolayer => obj_oben -> ist auch das div mit id="idOben"
	var obj_oben = window.document.getElementById("info-layer").getElementsByTagName("div")[1];
	
	var b_infoDa = 0;
	if(obj_oben) {
		//div#oben was found
		
		//Anzahl der Infotexte:
		var iAnzahlInfo = 0;
		iAnzahlInfo = $(obj_oben).children('.info').length;

		//Set the first InfoBox Text visible
		/* Wurde von Rc Gmbh ausgeklammert, weil es das flasche DIV einblendet. 
		   Das DIV, das hier angesprochen wird, hat die ID 'nonsense' und keinen Inhalt */
		//if(obj_oben.getElementsByTagName("div")[1]) {
			//obj_oben.getElementsByTagName("div")[1].removeAttribute("style");
		//}
	}
	
	var obj_visuals = window.document.getElementById("schalter2");
	if(obj_visuals) {
		if(obj_visuals.hasChildNodes() ) {
		/* RC: Einsprungspunkt für setVisuals */
		setVisuals();
		}
	}
	/*set the info-layer to transparent*/
	//obj_box = window.document.getElementById("info-layer").;
	obj_box = window.document.getElementById("info-layer").getElementsByTagName("div")[1];
	if(obj_box) {
		obj_box.style.opacity = ".0";
		obj_box.style.filter = "alpha(opacity=0)";
		obj_box.style.backgroundColor = "#ffffff";
		i_cur_opacity = 0;
	}

	// Wenn alles geladen ist, Info-Button einblenden (beugt Button beim Laden klicken vor)
	
});



//add a new timeout var for an infobox in the array
function setTimeoutVar(sek) {
  //get count of info_boxes
  //var iAnzahlInfoTimeouts = a_timeout_info.length;
  a_timeout_info.push(sek);
  //alert(a_timeout_info);
}
//add visibility status for an info text
function setVisibility(vis) {
  a_infoText_visible.push(vis);
  //alert(a_infoText_visible);
}
//add layer status for an info text
function setLayerDown(bt) {
  a_downLayer.push(bt);
  //alert(a_downLayer);	
}
//add the div.info element to a array
function setInfoboxDiv(info) {
  a_infobox_div.push(info);
  //alert(a_infobox_div);
}

var visuals = false;
function setVisuals() {
	//Die Visuals vorbereiten:
	if($('#schalter2').children(':first-child').is('.graphik1')) {
		//Auswählen aller DIVs mit der klasse 'graphik1'
		var obj_schalter2 = $('#schalter2').children('.graphik1');
		//Die IDs von Graphik werden geändert:
		obj_schalter2.each(function(i) {
			this.id = 'graphik' + (i + 1);
			this.className='graphikkk';
			
			//Erstes DIV wird auf display:block gesetzt, damit es angezeigt wird:
			if(i == 0) {
				this.style.display = 'block';
			} else {
				this.style.display = 'none';
			}
			
			//Der entsprechende Button für das Bild wird angezeigt:
			pic_id = '#pic' + (i+1);
			$(pic_id).css({ visibility:'visible' });
			iAnzahl = i + 1
  		});
		//Set x for other JS
  		x = iAnzahl;
		
		//Alle HTML strukturen für die Visuals wurden angepasst:
		visuals = true;
	} else {
  		if(!visuals)
			$('#idOben').css({ display: 'none'});
	}
}
  

function showInfo(nr) {
  a_infobox_div = new Array(); //deleting and reseting the array, so they dont save double values
  var obj_oben = window.document.getElementById("info-layer").getElementsByTagName("div")[1];
  if(nr != '' && obj_oben) {
  
    //find the div.info to show it
	var debug_i = 0;
	
	for(debug_i = 0; debug_i < obj_oben.childNodes.length; debug_i++) {
	  
	  if(obj_oben.childNodes[debug_i].nodeName == "DIV") {
		
		if(obj_oben.childNodes[debug_i].getAttribute(className) == "info" ||
		   obj_oben.childNodes[debug_i].getAttribute("class") == "info") {
		  //alert("div.info gefunden!");
		  setInfoboxDiv(obj_oben.childNodes[debug_i]);
		} 
	  }
	}
  
    if(a_infobox_div[nr-1] && b_infoDa == 0) {
      a_infobox_div[nr-1].style.display='block';
      a_infobox_div[nr-1].style.visibility='visible';
      b_infoDa = 1;
    }
  }
}

function hideInfo(nr) {
  //$('#info-layer').css({display:'none'});
  var obj_oben = window.document.getElementById("info-layer").getElementsByTagName("div")[1];
  if(nr != '' && obj_oben) {
    if(a_infobox_div[nr-1] && b_infoDa == 1) {
      a_infobox_div[nr-1].style.display='none';
      a_infobox_div[nr-1].style.visibility='hidden';
      b_infoDa = 0;
    }
  }
}
// bildergalerie
	var i = 1;
	var actbutton = 'pic'+i;
	var actpic = 'graphik'+i;
	var x = 0;
	var p = 0;
	//added by jenkhardt
	//var obj_actInfoBox = window.document.getElementById("info-layer").getElementsByTagName("div")[1].getElementsByTagName("div")[1];
	var i_actTimeout = 1;

/*
function showInfoLayer(i_sek) {
  if(i_sek != '') {
    setTimeout("show('info-layer')", i_sek);
  }
}
*/

function init(p) {
	//setTimeout("show('info-layer')", 3000);
	if (p != '') {
		x = p;
		document.getElementById('pic1').style.visibility='visible';
		document.getElementById('pic2').style.visibility='visible';
		document.getElementById('pic3').style.visibility='visible';
		document.getElementById('pic4').style.visibility='visible';
		document.getElementById('pic5').style.visibility='visible';
		//pic6 was added by jenkhardt
		document.getElementById('pic6').style.visibility='visible';
		document.getElementById('graphik'+i).style.visibility='visible';
		document.getElementById('graphik'+i).style.display='block';
	}
} 

function hover(id) {
if (i != id) {
		document.getElementById('pic'+id).style.backgroundImage='url(fileadmin/img/global/bt_bildwechsel_f2.gif)';
	}
}
function hoverout(id) {
	if (i != id) {
		document.getElementById('pic'+id).style.backgroundImage='url(fileadmin/img/global/bt_bildwechsel.gif)';
	}
}

//fix me: wenn 1 visual kein text hat, also a_infoText_visible[x] == 0, kein visuals darstellen
function graphikselectOld(id) {
	window.clearTimeout(zeit);
	
	if (i != id) {	
	
		// buttons ändern (hover, etc.)
		document.getElementById('pic'+i).style.backgroundImage='url(fileadmin/img/global/bt_bildwechsel.gif)';
		document.getElementById('pic'+id).style.backgroundImage='url(fileadmin/img/global/bt_bildwechsel_f3.gif)';
		
		// bider ändern (unrelevant durch jquery)
		document.getElementById('graphik'+i).style.display='none';
		// document.getElementById('graphik'+i).style.visibility='hidden';
		document.getElementById('graphik'+id).style.display='block';
		document.getElementById('graphik'+id).style.visibility='visible';

		hideInfo(i);
		
		if(actObj!='' && actObj=='info-layer') {
			$('#' + actObj).css({visibility:'hidden'});
			
	    	//document.getElementById(actObj).style.visibility='hidden';
	    b_InfoAct = 0;
		  actObj='';
		  
		  //fade is open = false
        obj_box.style.opacity = ".0";
        obj_box.style.filter = "alpha(opacity=0)";
        i_cur_opacity = 0;
        b_info_open = 0;
	  }
	  //first timeout
	  //alert("Timeout soll in '" + a_timeout_info[id-1] + "' sekunden erfolgen!");

	  if(a_infoText_visible[id-1] == 1) {
	  
	  	// OnClick - Fade to open
		window.setTimeout("show('info-layer',1)",a_timeout_info[id-1]*1000);
	    window.setTimeout("showInfo("+id+")",a_timeout_info[id-1]*1000);
	    window.setTimeout("FadeIn()",a_timeout_info[id-1]*1000); //Fade() Function
	  }
		i = id;
	}
	
	zeit = window.setTimeout("rauf()",dauer);
  	return false;
}

// @TODO Wrapper für GrafikSelect (für Flash Ersatz)
function graphikselect(id) {
	
	if (infoboxTimeout != null && infoboxTimeout != 0) {
		
		// alert('This is a slideshow button, baby');
		
		// ---------------
		window.clearTimeout(zeit);
		if (i != id) {		
		
			// buttons ändern (hover, etc.)
			document.getElementById('pic'+i).style.backgroundImage='url(fileadmin/img/global/bt_bildwechsel.gif)';
			document.getElementById('pic'+id).style.backgroundImage='url(fileadmin/img/global/bt_bildwechsel_f3.gif)';
			
			// bider ändern (unrelevant durch jquery)
			document.getElementById('graphik'+i).style.display='none';
			// document.getElementById('graphik'+i).style.visibility='hidden';
			document.getElementById('graphik'+id).style.display='block';
			document.getElementById('graphik'+id).style.visibility='visible';
		  
			if(a_infoText_visible[id-1] == 1) {  
				// OnClick - Fade to open
				window.setTimeout("show('info-layer',1)",a_timeout_info[id-1]*1000);
				window.setTimeout("showInfo("+id+")",a_timeout_info[id-1]*1000);
				window.setTimeout("FadeIn()",a_timeout_info[id-1]*1000); //Fade() Function
			}
			i = id;
		}
		
		zeit = window.setTimeout("rauf()",dauer);
		// --------------------
		
		return false;
	
	} else {
		
		// Ohne JQuery (alte Art)
		graphikselectOld(id);		
	}
}


function runter() {
	document.getElementById('graphik'+i).style.display='none';
	document.getElementById('graphik'+i).style.visibility='hidden';
	document.getElementById('pic'+i).style.backgroundImage='url(fileadmin/img/global/bt_bildwechsel.gif)';
	if (i > 1) {
		i = i - 1;
		} else {
		i = x;
	}
	document.getElementById('graphik'+i).style.display='block';
	document.getElementById('graphik'+i).style.visibility='visible';	
	document.getElementById('pic'+i).style.backgroundImage='url(fileadmin/img/global/bt_bildwechsel_f3.gif)';
}

function rauf() {
	window.clearTimeout(zeit);
	document.getElementById('pic'+i).style.backgroundImage='url(fileadmin/img/global/bt_bildwechsel.gif)';

	//Special Case: InfoBox Timeout (Startpage/Products)
	if (infoboxTimeout != null && infoboxTimeout != 0) {
		// ..
	} else {
		// Info-Layer ausblenden (Container)	
		hideInfo(i);
		// Info-Layer ausblenden (Container)
		obj_box.style.opacity = ".0";
		obj_box.style.filter = "alpha(opacity=0)"; // opacity=0		
	}

  	i_cur_opacity = 0;
  	b_info_open = 0;
	
	/* jQuery FADEOUT */
	/* If there is just one picture element (jquery $('.graphikkk').length=0) 
	we simply terminate the script and do not set the timer for rauf() again */
	if($('.graphikkk').length == 0) {
		// alert('new mode. one picture only. terminating script.');	
		return;
	} else {
		$(document.getElementById('graphik'+i)).fadeOut("slow",xeCallback('out'));	
	}
	
	
	if(actObj!=''&&actObj=='info-layer') {
		actObj='';
		b_InfoAct = 0;
	}
	if (i < x || i < a_infobox_div.length) {
		i = parseInt(i) + 1;
		} else {
		i = 1;
	}
	
	/* jQuery FADEIN */
	$(document.getElementById('graphik'+i)).fadeIn("slow",xeCallback('in')); 		
	document.getElementById('pic'+i).style.backgroundImage='url(fileadmin/img/global/bt_bildwechsel_f3.gif)';

	if(a_infoText_visible[i-1] == 1) {
		window.setTimeout("FadeIn()", a_timeout_info[i-1]*1000); //Fade() Function
	}

  	// Double Info-Layer Hack (rcgmbh)	
	show('info-layer',0);
			
	// Timeout für Bildwechsel neu setzen
	zeit = window.setTimeout("rauf()",dauer);
}

// xe: JQuery Callback Text
function xeCallback(direction) {
	//console.log('jQuery Fade Callback Executed. Direction is: %s ',direction); 
}

function xeCallback2(direction) {
	// hideInfo(i);
	// Info-Layer ausblenden (Container)
	// obj_box.style.opacity = ".0";
	// obj_box.style.filter = "alpha(opacity=0)"; // opacity=0		
}


function infoboxTimeoutFadeOut() {
 	$(document.getElementById('info-layer')).fadeOut("slow",infoboxTimeoutFadeInCallback);	
	}

function infoboxTimeoutFadeInCallback() {
	//$("#info-button").children('a').attr({ href: "#", onclick:"showWrapper();return false" });
}
function infoboxTimeoutFadeIn() {
	//info-button disable im callback enabled
	//$("#info-button").children('a').attr({ href: "#", onclick:'return false;' });

	$(document.getElementById('info-layer')).fadeIn("slow",infoboxTimeoutFadeInCallback());
}

// Wrapper für X und Info-Button (alte Art oder jQuery)
function showWrapper() {
	
	
	
	//$("#info-button").children('a').attr({ href: "#", onclick:'return false;' });
	// Mit jQuery (vorher auf Flash Basis)
	if (infoboxTimeout != null && infoboxTimeout != 0) {
		// kill timeout
		window.clearTimeout(infoboxTimeoutPointer);
		if(document.getElementById('info-layer').style.display=='none') {
			infoboxTimeoutFadeIn();
		} else {
			infoboxTimeoutFadeOut();
		}
	} else {
		// Ohne JQuery (alte Art)
		if($('#idOben').css("opacity") == '0.9' || $('#idOben').css("opacity") == '0') {
			show('info-layer',0);
		}
	}
}

// show hide layers
var actObj='';
var b_InfoAct = 0;
function show(obj,b_timeout) {
	//$("#info-button").children('a').attr({ href: "#", onclick:'return false;' });
	
	// Alle anderen layer auf invisible setzen (hack, rcgmbh)
	if (!(infoboxTimeout != null && infoboxTimeout != 0)) {
		$(".info").css({ visibility:'hidden',display:'none'});
	}
	//infoboxTimeoutFadeInCallback();
	
  if(a_infoText_visible[i-1] == 1) {
	
	if(b_timeout == 0) {
	  if(actObj!=''&&actObj==obj && b_InfoAct == 1) {
		//Wenn der Info Layer eingeblendet ist:
	    // document.getElementById(actObj).style.visibility='hidden';
	    hideInfo(i); //added by jenkhardt
      
      obj_box.style.opacity = ".0";
      obj_box.style.filter = "alpha(opacity=0)";
      
	  i_cur_opacity = 0;
      b_info_open = 0;
                
      b_InfoAct = 0;
	    actObj='';
	  
	  } else {
		
		
	    // if(actObj!='' && b_InfoAct == 0) document.getElementById(actObj).style.visibility='hidden';
	    if(obj!='' && b_InfoAct == 0) document.getElementById(obj).style.visibility='visible';
		showInfo(i);
		laydown = a_downLayer[i-1]; 
		if (laydown == '1') {
		  //hide the div.info h2 && div.info div.bodytext elements
	      var klein_i = 0;
	      for(klein_i = 0; klein_i < a_infobox_div[i-1].childNodes.length; klein_i++) {
	        if(a_infobox_div[i-1].childNodes[klein_i].nodeName == "DIV") {
		      //Hide the div.info div.copytext
			  if(a_infobox_div[i-1].childNodes[klein_i].getAttribute(className) == "copytext" ||
			     a_infobox_div[i-1].childNodes[klein_i].getAttribute("class") == "copytext") {
			    //alert("div.info div.copytext gefunden!");
			    a_infobox_div[i-1].childNodes[klein_i].setAttribute("style", "display:none; visibility:hidden;");
			    a_infobox_div[i-1].childNodes[klein_i].style.display="none";
			    a_infobox_div[i-1].childNodes[klein_i].style.visibility="hidden";
			  }
	        }
			//Hide the div.info h2
			if(a_infobox_div[i-1].childNodes[klein_i].nodeName == "H2") {
			  // alert("div.info h2 gefunden!");
			  a_infobox_div[i-1].childNodes[klein_i].setAttribute("style", "display:none; visibility:hidden;");
			  a_infobox_div[i-1].childNodes[klein_i].style.display = "none";
			  a_infobox_div[i-1].childNodes[klein_i].style.visibility = "hidden";
			}
	      }
		  
		  document.getElementById('idOben').style.width='280px'; //small info
		  document.getElementById('idOben').style.height='180px'; // 180px     '385px'; //small info
          document.getElementById('idOben').style.top='284px';
		  
        } else { 
		
		// Fixes IE6/7 JQuery FadeIn Problem
		document.getElementById('info-layer').style.height='470px';
		
		//tall layer
			//remove the div.info div.klein "klein" class attribute
	        var klein_i = 0;
	        //alert("Anzahl der Kinder in Div.info("+i-1+"): " + a_infobox_div[i-1].childNodes.length);
	        for(klein_i = 0; klein_i < a_infobox_div[i-1].childNodes.length; klein_i++) {
	          if(a_infobox_div[i-1].childNodes[klein_i].nodeName == "DIV") {
		        //Remove the div.info div.klein :: class="klein" Attribute
			    if(a_infobox_div[i-1].childNodes[klein_i].getAttribute(className) == "klein" ||
				   a_infobox_div[i-1].childNodes[klein_i].getAttribute("class") == "klein") {
		          //alert("div.info div.klein gefunden!");
				  a_infobox_div[i-1].childNodes[klein_i].removeAttribute("class");
				  a_infobox_div[i-1].childNodes[klein_i].removeAttribute(className);
		        }
	          }
	        }
	        
	        document.getElementById('idOben').style.width='280px'; //tall layer
            document.getElementById('idOben').style.height='399px'; //  '368px'; //tall layer
            document.getElementById('idOben').style.top='65px';
          }


			window.setTimeout("FadeIn()",500);
			

			// ----------------------
			// $(document).ready(function() {
				// FadeInWrapper('ready');
			// });
			// firstInfoBoxTimeout = window.setTimeout("FadeInWrapper('timeout')",500)
			// ----------------------

		  b_InfoAct = 1;
	    actObj=obj;
	  }
	}
	
	//timeout call this function
	else if(b_timeout == 1) {
	  if(obj!='' && b_InfoAct == 0) document.getElementById(obj).style.visibility='visible';
	 
	  showInfo(i);
	  laydown = a_downLayer[i-1];
	  if (laydown=='1') {
	    
		//hide the div.info h2 && div.info div.bodytext elements
	        var klein_i = 0;
	        for(klein_i = 0; klein_i < a_infobox_div[i-1].childNodes.length; klein_i++) {
	          if(a_infobox_div[i-1].childNodes[klein_i].nodeName == "DIV") {
				//Hide the div.info div.copytext
				if(a_infobox_div[i-1].childNodes[klein_i].getAttribute(className) == "copytext" ||
				   a_infobox_div[i-1].childNodes[klein_i].getAttribute("class") == "copytext") {
				  //alert("div.info div.copytext gefunden!");
				 a_infobox_div[i-1].childNodes[klein_i].setAttribute("style", "display:none; visibility:hidden;");
				 a_infobox_div[i-1].childNodes[klein_i].style.display = "none";
				 a_infobox_div[i-1].childNodes[klein_i].style.visibility = "hidden";
				}
	          }
			  //Hide the div.info h2
			  if(a_infobox_div[i-1].childNodes[klein_i].nodeName == "H2") {
			    //alert("div.info h2 gefunden!");
			    a_infobox_div[i-1].childNodes[klein_i].setAttribute("style", "display:none; visibility:hidden;");
				a_infobox_div[i-1].childNodes[klein_i].style.display = "none";
				a_infobox_div[i-1].childNodes[klein_i].style.visibility = "hidden";
			  }
	        }
		
        document.getElementById('idOben').style.height='180px'; //small layer
        document.getElementById('idOben').style.width='280px';  //small layer
        document.getElementById('idOben').style.top='284px';
      } else { //tall layer
	  
	  //remove the div.info div.klein "klein" class attribute
	        var klein_i = 0;
	         // alert("Anzahl der Kinder in Div.info("+i-1+"): " + a_infobox_div[i-1].childNodes.length);
	        for(klein_i = 0; klein_i < a_infobox_div[i-1].childNodes.length; klein_i++) {
	          if(a_infobox_div[i-1].childNodes[klein_i].nodeName == "DIV") {
		        //Remove the div.info div.klein :: class="klein" Attribute
			    if(a_infobox_div[i-1].childNodes[klein_i].getAttribute(className) == "klein" ||
				   a_infobox_div[i-1].childNodes[klein_i].getAttribute("class") == "klein") {
		          //alert("div.info div.klein gefunden!");
				  a_infobox_div[i-1].childNodes[klein_i].removeAttribute("class");
				  a_infobox_div[i-1].childNodes[klein_i].removeAttribute(className);
		        }
	          }
	        }
	    document.getElementById('idOben').style.width='280px'; //tall layer
        document.getElementById('idOben').style.height='399px';  //tall layer
        document.getElementById('idOben').style.top='65px';
      }
	      
	     //timeout stop + start
		  window.clearTimeout(zeit);
		  zeit=window.setTimeout("rauf()",dauer);

		
	  b_InfoAct = 1;
	  actObj=obj;
	  
	}	
  }	
}




function rein(obj) {
	document.getElementById(obj).style.visibility='visible';
	document.getElementById(obj).style.display='block';
	document.getElementById('rest').style.visibility='hidden';
	// ergaenzung fuer 3. naviebene
	document.getElementById('navi-right').style.visibility='hidden';
}
function raus(obj) {
	document.getElementById(obj).style.visibility='hidden';
	document.getElementById(obj).style.display='none';
	document.getElementById('rest').style.visibility='visible';
	// ergaenzung fuer 3. naviebene
	document.getElementById('navi-right').style.visibility='visible';
}

// image swap
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function FadeIn() {
  if(i_cur_opacity <= i_max_opacity && b_info_open == 0) {
    	i_cur_opacity = i_cur_opacity + i_fade_interval_opacity;
	  	obj_box.style.opacity = "."+i_cur_opacity;
	  	obj_box.style.filter = "alpha(opacity="+i_cur_opacity+")";

		// Rekursion
	  	window.setTimeout("FadeIn()", i_fade_interval);
  } else {
	  //infoboxTimeoutFadeInCallback();
    //alert("fertig mit einblenden?");
	  b_info_open = 1;
  }
}