function setPNGbackground(A,B){if(window.ie6){$(B).setStyles({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A+"', sizingMethod='scale')"})}else{$(B).setStyles({backgroundImage:"url("+A+")"})}}
var makeBackground=(function(){
	var D,A=0,C,B=1084,E=170,I,H,K,J;
				
	function G(){
					
	var L=$(window).getSize().size.y;
	var M=L*J;
	
	if(M<B){
		M=B;
		L=M/J
	}
						
	C.setStyles({width:M,height:L})}
	//C.style.width = M;
				
	function F(){
		var L=A;A=2;
						
		$$(I,H).each(function(M){
			M.setStyle("display","none")
		});
		switch(L){
			case 0:D.start(B).chain(function(){
				A=1;H.setStyle("display","block")
			});
			break;
			
			case 1:D.start(E).chain(function(){
				A=0;
				//I.setStyle("display","block")
				I.style.display = "block";
			});
			break
		}
	}
	
	return function(){
		//C=$("bg");
		C = document.getElementById('bg');
		
				/*				
		if(window.ie7){C.setStyle("")}
		if(window.ie8){C.setStyle("")}
					*/			
		new Fx.Style(C,"opacity",{duration:3000}).set(0).start(1);
								
		I=$("show-background").setProperty("href","javascript:void(0);").addEvent("click",F);
								
		H=$("hide-background").setProperty("href","javascript:void(0);").addEvent("click",F);
								
		var L=C.className.split("-");
		J=L[1].toInt()/L[2].toInt();
		D=new Fx.Style($("flash_wrapper"),"width",{duration:800}).set(E);G();
							
		window.addEvent("resize",G)
	}
})();

window.addEvent("domready",function(){
	new Asset.images(["fileadmin/templates/images/pfeil-rund-rechts.png","fileadmin/templates/images/pfeil-suche.png"]);
						
	if(window.ie6){new Pngfix("clear.gif")}
						
	$("tx_indexedsearch_submit").addEvents({
		mouseover:function(H){
			setPNGbackground("fileadmin/templates/images/pfeil-rund-rechts.png",
			new Event(H).target)
		},
	
		mouseout:function(H){
			setPNGbackground("fileadmin/templates/images/pfeil-suche.png",new Event(H).target)
		}
	});
						
	var C=$("tx_indexedsearch_swords").value;
						
	$("tx_indexedsearch_swords").addEvents({focus:function(){
		if(this.value.trim()==C){this.value=""}
	},
	
	blur:function(){
 		if(this.value.trim()==""){this.value=C}
	}
});
						
var G=null;
var A=[],E=[],F=0;
					
$("mainmenu").getChildren().each(function(I,H){
	span=I.getElement("span");
	ul=I.getElement("ul");
						
	if($defined(span)&&$defined(ul)){
		if(I.hasClass("active")){
			G=F
		}
		
		F++;
		A.push(span);E.push(ul)
	}
});
				
var B=[G];
if(G==null){
	B=[]
}

if($defined(A)&&$defined(E)&&(E.length>0)&&(A.length>0)){
	accordion=new MultipleOpenAccordion(A,E,{
		alwaysHide:true,
		opacity:true,
		openAll:false,
		allowMultipleOpen:false,
		start:"first-open",
		firstElementsOpen:B,
		duration:300,
		transition:Fx.Transitions.sineIn,
		onActive:function(H,I){
			H.addClass("act");
			I.addClass("act")
		},
		onBackground:function(I,H){
			I.removeClass("act");
			H.removeClass("act")
		}
	})
}
					
if(typeof onStartseite=="undefined"){
	var D=Resizer.init.delay(20,Resizer)}Mainmenu_Hover=new Hover($$("#mainmenu a.main","#mainmenu span.toggle"))
});
/*					
					var font_futura={src:"fileadmin/templates/flash/futura2.swf"};
					var font_minion={src:"fileadmin/templates/flash/minion2.swf"};
					
					sIFR.activate(font_futura);
					sIFR.activate(font_minion);
					sIFR.replace(font_futura,{
						selector:"h1.weiss-gross",
						css:[".sIFR-root { color: #ffffff; font-weight:normal; font-size:27px; }"],
						transparent:true
					});
					
					sIFR.replace(font_futura,{
						selector:"h1.weiss-klein",
						css:[".sIFR-root { color: #ffffff; font-weight:normal; font-size:20px; }"],
						transparent:true
					});
					
					sIFR.replace(font_minion,{
						selector:"h1.gelb",
						css:[".sIFR-root { color: #FAE23D; font-weight:normal; font-style:italic; font-size:20px; }"],
						transparent:true
					});
					
					sIFR.replace(font_minion,{
						selector:"h1.weiss",
						css:[".sIFR-root { color: #ffffff; font-weight:normal; font-style:italic; font-size:20px; }"],
						transparent:true
					});
					
					sIFR.replace(font_futura,{
						selector:"h1.black-gross",
						css:[".sIFR-root { color: #666666; font-weight:normal; font-size:27px; }"],
						transparent:true
					});
					
					sIFR.replace(font_minion,{
						selector:"h1.menu-text-header",
						css:[".sIFR-root { color: #ffffff; font-weight: normal; font-style: italic; font-size: 16px; }"],
						transparent:true
					});
					
					sIFR.replace(font_futura,{
						selector:"h1.black-klein",
						css:[".sIFR-root { color: #666666; font-weight:normal; font-size:20px; }",
							 "a { color: #666666; text-decoration: none; }",
							 "a:hover { color: #999999;  text-decoration: none; }"],
						transparent:true});
*/					