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

var toggles = $$('#sbnavi .togglers');
var content = $$('#sbnavi .elements');

$$('#sbnavi .togglers').addEvent('mouseenter', function(){
			if (this.clicked==null) {
				//get original color and background-color
				this.bgimgN = this.getStyle('background-image');
				this.bgimgH = this.bgimgN.replace("_normal_", "_hover_");
				//set new color and background-color
				this.setStyle('background-image', this.bgimgH);
				this.hover=1;
			}
		}
	);
	//code to change the way toggler looks with mouseout
	$$('#sbnavi .togglers').addEvent('mouseleave', function(){
			if (this.clicked==null) {
				this.bgimgH = this.getStyle('background-image');
				this.bgimgN = this.bgimgN.replace("_hover_", "_normal_");
				this.setStyle('background-image', this.bgimgN);
			}
		}
	);
	//code to change the way toggler looks with click
	$$('#sbnavi .togglers').addEvent('click', function(){
			$$('#sbnavi .togglers').each(function(el){
				if (this.clicked==null) {
					el.clicked=null;
					el.bgimg = el.getStyle('background-image');
 					el.bgnew = el.bgimg.replace("_hover_","_normal_");
 					el.bgnew = el.bgimg.replace("_active_","_active_");
 					el.setStyle('background-image', this.bgnew);
				}}
			);
			this.clicked=1;
			//set new color and background-color
			this.bgimgN = this.getStyle('background-image');
			this.bgimgC = this.bgimgN.replace("_normal_", "_active_");
			this.setStyle('background-image', this.bgimgC);
		}
);

//set up your object var
//create a "new" Accordion object
//set the toggle array
//set the content array
var AccordionObject = new Accordion(toggles, content, {  
	duration: 450, alwaysHide: false, opacity: true, start: 'open_accordion_entry' ,display:1, initialDisplayFx: false, transition: 'quint:out',
	'onComplete': function(a){a.setStyle('color', 'cccccc');},
	'onBackground': function(a){a.setStyle('color', 'cccccc');}
    });  

// kick selected:

function initAccordeon(arg){
    if($chk(arg)) {
		$('open_accordion_entry').fireEvent('click');
//		$('open_accordion_entry').setStyle('color', '#733139');
//		somebgimgN = $('open_accordion_entry').getStyle('background-image');
//		somebgimgC = somebgimgN.replace("_hover_", "_active_");
//		$('open_accordion_entry').setStyle('background-image', somebgimgC);
    }
}

initAccordeon($('open_accordion_entry'));

// Tagesdropdown: !!!!!


});
