window.addEvent('domready', function() {
	
	//create our Accordion instance
	var myAccordion = new Accordion($('ihcaccordion'), 'div.toggler', 'div.element', {
		opacity: false,
		alwaysHide: true,
		start: 'all-closed',
		onActive: function(toggler, element){
			//toggler.setStyle('color', '#41464D');
			//toggler.setStyle('background', 'url(typo3conf/ext/ihcaccordion/pi1/images/pfeil_on.gif) no-repeat center left');
		},
		onBackground: function(toggler, element){
			//toggler.setStyle('color', '#528CE0');
			//toggler.setStyle('background', 'url(typo3conf/ext/ihcaccordion/pi1/images/pfeil_off.gif) no-repeat center left');
		}
	});
});

function effectFade(x, kategorie)
{
	var fadeinEffect = new Fx.Morph($(kategorie), {duration: 'normal', transition: 'linear'});
	fadeinEffect.start({
		'opacity': 0 //Morphs the 'height' style from 10px to 100px.
		//'width': [900, 300]  //Morphs the 'width' style from 900px to 300px.
	});	
	
	fadeinEffect.onComplete = function () {	
	
		var myEffect = new Fx.Morph($(kategorie), {duration: 'short', transition: 'bounce:out'});
		myEffect.set({
			'left': x //Morphs the 'height' style from 10px to 100px.
			//'width': [900, 300]  //Morphs the 'width' style from 900px to 300px.
		});	
		var fadeoutEffect = new Fx.Morph($(kategorie), {duration: 'normal', transition: 'linear'});

		fadeoutEffect.start({
			'opacity': 1 //Morphs the 'height' style from 10px to 100px.
			//'width': [900, 300]  //Morphs the 'width' style from 900px to 300px.
		});	
	};
}
function effectBounce(x, kategorie)
{
		var myEffect = new Fx.Morph($(kategorie), {duration: 'normal', transition: 'bounce:out'});
		myEffect.start({
			'left': x
		});	
}

function effectSlide(x, kategorie)
{
		var myEffect = new Fx.Morph($(kategorie), {duration: 'normal', transition: 'circ:out'});
		myEffect.start({
			'left': x
		});	
}
