window.addEvent('domready', function() {
	
	//--> Animation accordéon
	
	$$('.group_section').setStyle('display', 'block');
	
	$$('div.section').each(function(el) {
		var fx = new Fx.Slide(el.getNext(), {
			initialize: function() {
				this.wrapper.addClass('wrapper_files');	
			},
			onComplete: function(){
				this.wrapper.setStyle('height','auto');
			}
		}).hide();
		
		el.getNext().getElements('a').each(function(link) {
			if(link.hasClass('active')) fx.show();							 
		});
		
		el.getNext().setStyle('height','auto');
		
		el.addEvent('click', function(){
				fx.toggle();
		});
	});
	
	//--> Animation au survol
	
	$$(".niv2").each(function(div) {
		var fx = new Fx.Tween(div, {duration:200, wait:false});
		
		div.addEvents({
			'mouseover': function() {
				fx.start('padding-left', 5);
			},
			
			'mouseout': function() {
				fx.start('padding-left', 0);
			}
		});
	});
			
});
