/* mootools accordion */
window.addEvent('domready', function() { 

    // Anpassung IE6
	//if(window.ie6) var heightValue='100%';
	//else var heightValue='';

	//code to change the way toggler looks with mouseover
	$$('.toggler').addEvent('mouseenter', function(){
			if (this.clicked==null) {
				//get original color and background-color
				this.origColor=this.getStyle('color'); 
				this.origBgColor=this.getStyle('background-color');
		
				//set new color and background-color
				this.setStyle('color', 'white');
				this.setStyle('background-color', '#3B8FC9');
			}

		}

	);

	//code to change the way toggler looks with mouseout
	$$('.toggler').addEvent('mouseleave', function(){
			if (this.clicked==null) {
				//set new color and background-color
				this.setStyle('color', this.origColor);
				this.setStyle('background-color', this.origBgColor);
	
			}

		}

	);

	//code to change the way toggler looks with click
	$$('.toggler').addEvent('click', function(){
			$$('.toggler').each(function(el){
					el.clicked=null;
 
				}
			);

			this.clicked=1;
	
			//set new color and background-color
			this.setStyle('color', 'white');
			this.setStyle('background-color', '#1578BD');
	
			//get original color and background-color
			this.origColor=this.getStyle('color'); 
			this.origBgColor=this.getStyle('background-color');

		}

	);


	var accordion = new Accordion($$('.toggler'),$$('.element'), {  
	start: -1,
	opacity: 1,
	duration: 1250,
	//width: 1,
	fixedWidth: 500,
        onActive: function(toggler) { toggler.setStyle('color', 'white'); toggler.setStyle('background-color', '#3B8FC9');},  
        onBackground: function(toggler) { toggler.setStyle('color', 'white'); toggler.setStyle('background-color', '#1578BD');}  
    });  
});
