window.addEvent('domready', function() {
	
	//create our Accordion instance
	var myAccordion = new Accordion($('accordion'), 'h3.toggler', 'div.element', {
		opacity: false,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#41464D');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#528CE0');
		}
	});
	
	//permet de reouvrir directement le bon element
	//grace à l'url test.html#cat_a_ouvrir
	function checkHash(){
	var found = false;
	$$('h3.toggler a').each(function(link, i){
	if (window.location.hash.test(link.hash)){
	myAccordion.display(i);
	found = true;
	}
	});
	return found;
	}
	 
	if (!checkHash()) myAccordion.display(0);

});

