
function SlideSections(slideSource,anitype,durationtype,transitiontype){
	var status = {
		'true_de': 'Details ausblenden',
		'false_de': 'Details einblenden',
		'true_en': 'hide details',
		'false_en': 'show details',
		'true_it': 'nasconda dettagli',
		'false_it': 'mostra dettagli'
	};
	$each(slideSource, function(el){
		var mySection = new Fx.Slide(el.getNext('div'), {duration: durationtype, transition: transitiontype });
		mySection.hide();
		var myHeadline = el.get('html');
		el.erase('html');
		var sectionLink = new Element('a', {href: '#', html: myHeadline});
		var sectionSpan = new Element('span', {html: status[mySection.open +'_'+ lang]});
		sectionLink.inject(el);
		sectionSpan.inject(sectionLink);
		el.addEvent('click', function(e){
			e.stop();
			if(anitype == true){
				mySection.toggle();
			}
			if(el.hasClass('open')){
				if(anitype == false){
					mySection.hide();
					el.getElement('span').set('html', status[mySection.open +'_'+ lang]);
				}
				el.removeClass('open');
				el.getNext('div').removeClass('open');

				
			}else{
				if(anitype == false){
					mySection.show();
					el.getElement('span').set('html', status[mySection.open +'_'+ lang]);
				}
				el.addClass('open');
				function sdfsdaff(){
					el.getNext('div').addClass('open');
				}
				sdfsdaff.delay(500);
			}
		});
		mySection.addEvent('complete', function() {
			el.getElement('span').set('html', status[mySection.open +'_'+ lang]);
		});
	});
}

window.addEvent('domready', function() {	
	if($('accordion')){
		SlideSections($$('#accordion h4'), true, 450, Fx.Transitions.Circ.easeInOut);
	}
});

/*
----- Slide Section Aufruf -----
if($('slide_section')){
	SlideSections(Selector, animiert true oder false, animations duration, Fx.Transitions);
}

----- Fx.Transitions Animationsarten -----

linear: Fx.Transitions.linear
quad: 	Fx.Transitions.Quad.easeInOut
cubic: 	Fx.Transitions.Cubic.easeInOut
quart: 	Fx.Transitions.Quart.easeInOut
quint: 	Fx.Transitions.Quint.easeInOut

expo: 	Fx.Transitions.Expo.easeInOut
circ: 	Fx.Transitions.Circ.easeInOut
sine: 	Fx.Transitions.Sine.easeInOut
back: 	Fx.Transitions.Back.easeInOut // evtl. ie problem
bounce: Fx.Transitions.Bounce.easeInOut
elastic: Fx.Transitions.Elastic.easeInOut

statt ".easeInOut" am ende auch ".easeIn" oder ".easeOut"
*/