window.addEvent('domready', function(){
	
var stretchers = $$('div.accordion');
var togglers = $$('h3.toggler');
stretchers.setStyles({'height': '0', 'overflow': 'hidden'});
			
	//initialization of togglers effects
		
	togglers.each(function(toggler, i){
		toggler.color = toggler.getStyle('background-color');
		toggler.$tmp.first = toggler.getFirst();
		toggler.$tmp.fx = new Fx.Style(toggler, 'background-color', {'wait': false, 'transition': Fx.Transitions.Quart.easeOut});
	});
		
	//the accordion
		
	var myAccordion = new Accordion(togglers, stretchers, {

		'duration': 600, 
			
		'opacity': false,
		
		'start': true,

		'transition': Fx.Transitions.cubicOut,			

    'alwaysHide': true,
			
		onActive: function(toggler){
			toggler.$tmp.fx.start('');
			toggler.$tmp.first.setStyle('color', '#666');

			toggler.$tmp.first.setStyle('', '');

		},
		
		onBackground: function(toggler){
			toggler.$tmp.fx.stop();
			toggler.setStyle('background-color', toggler.color).$tmp.first.setStyle('color', '#000000');
		
			toggler.$tmp.first.setStyle('', '');

		}
	});
		

		
	var found = 0;
	$$('h3.toggler a').each(function(link, i){
		if (window.location.hash.test(link.hash)) found = i;
	});
	myAccordion.display(found);
				
});



