/*
	Toggle für die Detail-Bereiche:
*/
var handlingEvents = {
    '.toggler' : function(el){
        el.onclick = function(){
		  	toggleChapter(this);
		};
		el.onmousedown = function(el){
		  	document.getElementById(this.id).blur();
		};
		el.onfocus = function(el){
			this.blur();
		};
    }
}
Behaviour.register(handlingEvents);

/* ---------------------------------------------------------------------------------------------------------------------
	Toggle chapters
   ---------------------------------------------------------------------------------------------------------------------*/
function toggleChapter(element){
	var tmpBackgroundImage = '';
	
	if (navigator.appName.indexOf("Explorer") > -1) {
		var actBackgroundImage = element.currentStyle.backgroundImage;
	}else{
		var css = document.defaultView.getComputedStyle(element, null);
 		var actBackgroundImage = css.getPropertyValue('background-image');
	}
	blnClosed = (actBackgroundImage.indexOf('_close.gif') != -1) ? true : false;
	
	(blnClosed) ? element.className = element.className+' open' : element.className = element.className.slice(0,element.className.length -5);
	
	if (navigator.appName.indexOf("Explorer") > -1) {
		Effect.toggle(element.nextSibling,'blind',{duration:0.5})
	}else{
		if(element.nextSibling.nextSibling.id == "Anzeige"){ 
			if(blnClosed==false) {
				new Effect.Opacity('bannerframe',
									{
										duration: 0.3,
										transition: Effect.Transitions.linear,
										from: 1,
										to: 0
									}
				);
			}else{
				new Effect.Opacity('bannerframe',
									{
										duration: 0.3,
										transition: Effect.Transitions.linear,
										from: 0,
										to: 1
									}
				);
			} 
		}
		Effect.toggle(element.nextSibling.nextSibling,'blind',{duration:0.5});
	}
}