/* Scripts utilisés sur l'ensemble du site www.vetements-ribs.fr */

/* Sous Menu en Accordéon */
window.addEvent('domready', function() {
	var toggle = $$('li.toggle');
	var szSmall  = 40, szFull   = 340;
	var fx = new Fx.Elements(toggle, {wait: false, duration: 500,transition:Fx.Transitions.Cubic.easeOut});
	var display = function(i){
		var o = {};
		o[i] = {height: [toggle[i].getStyle("height").toInt(), szFull]}
		toggle.each(function(other, j) {
			if(i != j) {
				var h = other.getStyle("height").toInt();
				if(h != szSmall) o[j] = {height: [h, szSmall]};
			}
		});
		fx.start(o);
	}
	toggle.each(function(t, i) {
		t.addEvent("mouseenter", function(event) {
			display(i);
		});
	});
	toggle.getChildren('a').each(function(a,i){
		if (a.hasClass('active') == 'true'){
			toggle[i].setStyle("height",szFull);
		}
	});
});