var Browser ="";
var aktiv = "";
var i = 0;
var BlenderStand = "Aus";
var Sprachsperre = 0;
if (navigator.userAgent.indexOf("MSIE")!= -1){
   Browser = ("IE");
}
   else if (navigator.userAgent.indexOf("Netscape")!= -1){
   Browser = ("Netscape");
}
   else if (navigator.userAgent.indexOf("Opera")!= -1){
   Browser = ("Opera");
}
   else if (navigator.userAgent.indexOf("Firefox")!= -1){
   Browser = ("Firefox");
}
   else if (navigator.userAgent.indexOf("Safari")!= -1){
   Browser = ("Safari");
}

if(navigator.userAgent.indexOf("iPhone")!= -1){
   	Browser = ("iPhone");	
}
if(navigator.userAgent.indexOf("iPad")!= -1){
   	Browser = ("iPhone");	
}
if (navigator.userAgent.indexOf("MSIE 9")!= -1){
   		Browser = ("IE9");	
}

if(navigator.userAgent.indexOf("Win")!= -1){
   		Betriebssystem = ("Windows");
	}else if (navigator.userAgent.indexOf("Mac")!= -1){
   		Betriebssystem = ("Mac");
   	}else{
   		Betriebssystem = navigator.userAgent;
}

//SubMenue/***************************************

function MediaBlenderEin(){
	
	//alert (Betriebssystem);
	if(BlenderStand == "Aus"){
		BlenderStand = "Faden";
		
		if(Browser == "IE"){
			//document.getElementById("Deckblatt").style.filter="alpha(opacity="+50+")";
			FensterBreite = document.documentElement.clientWidth;
			FensterHoehe = document.documentElement.clientHeight;
			FensterBreite = screen.width;
			FensterHoehe = screen.height;
			document.getElementById("Deckblatt").style.width = FensterBreite;
			document.getElementById("Deckblatt").style.height = FensterHoehe;
			document.getElementById("DeckblattInhalt").style.width = 800;
			document.getElementById("DeckblattInhalt").style.height = 650;
			document.getElementById("DeckblattInhalt").style.left = (FensterBreite/2-400);
			document.getElementById("DeckblattInhalt").style.top = 10;
			document.getElementById("Deckblatt").style.display = "block";
			document.getElementById("DeckblattInhalt").style.display = "block";
			document.getElementById("Bildergalerie").style.display = "block";
			document.getElementById("BGBildergalerie").style.display = "block";
		}else{
			document.getElementById("Deckblatt").style.opacity = 0;
			document.getElementById("DeckblattInhalt").style.opacity = 0; 
			document.getElementById("BGBildergalerie").style.opacity = 0;
			FensterHoehe = window.innerHeight  ;
			FensterBreite = window.innerWidth ;
			
			document.getElementById("Deckblatt").style.width = "10px";
			document.getElementById("Deckblatt").style.height = FensterHoehe+"px";
			document.getElementById("Deckblatt").style.left = "0px";
			document.getElementById("Deckblatt").style.top = "0px";
			document.getElementById("DeckblattInhalt").style.width = "800px";
			document.getElementById("DeckblattInhalt").style.height = "650px";
			document.getElementById("DeckblattInhalt").style.left = FensterBreite/2-400+"px";
			document.getElementById("DeckblattInhalt").style.top = 40+"px";
			if(Betriebssystem=="Mac"){
				document.getElementById("DeckblattInhalt").style.left = "0px";
				document.getElementById("DeckblattInhalt").style.top = "0px";
			}
			document.getElementById("Deckblatt").style.display = "block";
			document.getElementById("DeckblattInhalt").style.display = "block";
			document.getElementById("Bildergalerie").style.display = "block";
			document.getElementById("BGBildergalerie").style.display = "block";
			
			//document.getElementById("BoxFilm").style.zIndex = "0";
		}
	}
	aktiv = window.setInterval("Faden('Ein')", 10);//Aufruf in x Millisekunden
}
function MediaBlenderAus(){
	if(BlenderStand == "Ein"){
		BlenderStand = "Faden";
		aktiv = window.setInterval("Faden('Aus')", 10);//Aufruf in x Millisekunden
	}
}
function Faden(Richtung) {
	if(Richtung == "Ein"){
		i=i+7;
	}else{
		i=i-7;
	}
	if(Browser == "IE"){
		document.getElementById("Deckblatt").style.filter="alpha(opacity="+i+")";
		document.getElementById("DeckblattInhalt").style.filter="alpha(opacity="+1.4*i+")"; //2*i ergibt 100
		document.getElementById("BGBildergalerie").style.filter="alpha(opacity="+i+")";
		//document.getElementById("BoxFilm").style.filter="alpha(opacity="+1*i+")"; //2*i ergibt 100
		
	}else{
		//document.getElementById("Deckblatt").style.opacity =i/100;
		//document.getElementById("DeckblattInhalt").style.opacity =(1.4*i)/100; //2*i ergibt 100
		//document.getElementById("BGBildergalerie").style.opacity = i/50;
		document.getElementById("Deckblatt").style.opacity =100;
		document.getElementById("DeckblattInhalt").style.opacity =100; //2*i ergibt 100
		document.getElementById("BGBildergalerie").style.opacity =100;
	}
	
  	if (i > 70){
    	window.clearInterval(aktiv);
		i = 70;
		BlenderStand = "Ein";
	}
	if(i < 0){
		window.clearInterval(aktiv);
		i = 0;
		document.getElementById("Deckblatt").style.display = "none";
		document.getElementById("DeckblattInhalt").style.display = "none";
		
		
		//document.getElementById("Bildergalerie").style.display = "none";
		//document.getElementById("BGBildergalerie").style.display ="none";
		//document.getElementById("BoxFilm").style.display = "block";
		BlenderStand = "Aus";
		Sprachsperre = 1;
	}
}

//***************************************************************************
//Sprachsteueung mit Cookie

/*function Sprache(Land){
	var ExternerLink = "nein";
	var expdate = new Date();
   	expdate.setTime(expdate.getTime() + (1000*3600*24*365));
   	document.cookie = 'Sprache=' + Land + '; expires=' + expdate.toGMTString() + '; path=/';
	//document.cookie = 'Sprache=' + Land + '; path=/';
	
	AktuelleSeite = document.location.href;
	AktuelleSeite = AktuelleSeite.replace("#","");
	Teil = AktuelleSeite.split(".");
	//alert(Teil[0]);
	
	//falls adresse ohne www kommt
	if(Teil[0]!="http://www"){
		Teil[0]="http://www.klarer";
		ExternerLink = "ja";
		
		var expdate = new Date();
   	expdate.setTime(expdate.getTime() + (1000*3600*24*365));
   	document.cookie = 'Sprache=e; expires=' + expdate.toGMTString() + '; path=/';
		
		
	}else{
		ExternerLink = "nein";
	}
	
	
	if(Land == "d"){
		AktuelleSeite = document.location.href;
		NeueSeiteLaden = AktuelleSeite.replace("_e","");
		//alert(NeueSeiteLaden);
		
//Nach dem öffnen der Bildergalerie kann der IE nicht mehr von englisch auf deutsch wechseln
//Mit Historie Back funktionierts dann
		
		if(Sprachsperre == 0){
			window.location.href =NeueSeiteLaden; 
		}
		if(Sprachsperre == 1){
			window.history.back(); 
		}
		
//********************************************************************************************
	}
	if(Land == "e"){
		//auswahl("e");
		if(Teil.length<4){
			if(ExternerLink=="ja"){
				NeueSeiteLaden = Teil[0]+"."+Teil[1]+"."+Teil[2];
			}else{
				NeueSeiteLaden = Teil[0]+"."+Teil[1]+"."+Teil[2]+"index_e.html";
			}
		}else{
			NeueSeiteLaden = Teil[0]+"."+Teil[1]+"."+Teil[2]+"_e."+Teil[3];
		}
		
		window.location.href =NeueSeiteLaden; 
		
	}
	//auswahl(Land);
	
}

//****************************************************************************************************

//function auswahl (wahl) {
//alert (wahl);
  // var expdate = new Date();
  // expdate.setTime(expdate.getTime() + (1000*3600*24*365));
  // document.cookie = 'Sprache=' + wahl + '; expires=' + expdate.toGMTString() + '; path=/';
   //self.location = self.location;
   //location.reload();
   
   //alert(thema);
//}

function SprachePruefen(){
	
		var thema = document.cookie;
		var SprachTyp = thema.charAt(8);
		//alert(SprachTyp);
	if(SprachTyp!="d"){
		Sprache(SprachTyp);
	}
}*/




