var puceEtat = new Array();
        
// parametres des anaimations
var durationover;
var easingover;
var durationout;
var easingout;
if (isIE()) { // on ne peut pas avoir les memes rendus dans IE a cause de bugs
	durationover = 400;
	easingover = 'linear';
	durationout= 300;
	easingOut = 'linear';
} else {
	durationover = 2000;
	easingover = 'easeOutElastic';
	durationout= 1500;
	easingOut = 'easeOutElastic';
	/*durationover = 400;
	easingover = 'linear';
	durationout= 300;
	easingOut = 'linear';*/
}

function togglePuceOver () {
	var nompuce = $(this).attr("id");
	var nopuce = nompuce.substr(5, nompuce.length-5); 
	//console.log( nopuce );
	puceEtat[nopuce - 1] = 'overed';
}

function togglePuceOut () {
	var nompuce = $(this).attr("id");
	var nopuce = nompuce.substr(5, nompuce.length-5); 
	//console.log( nopuce );
	puceEtat[nopuce - 1] = 'iddle';
}

function dequeueAll(obj) {
	var n = obj.find('.puce').queue("fx");
	if ( n != undefined ) {
		for (i=0; i<n.length; i++) {
			obj.find('.puce').stop();
			obj.find('.puce').dequeue();
		}
	}
}

function MainMenuOptionOver(index,obj) {
	//console.log( index );
	dequeueAll(obj);
	puceEtat[index] = 'over';
	if (puceEtat[index]=='out') {
		obj.find('.puce').stop();
	}
	obj.find('.puce').animate({width:"302px"},durationover,easingover,togglePuceOver);
}

function MainMenuOptionOut(index,obj) {
	//console.log( index );
	dequeueAll(obj);
	puceEtat[index] = 'out';
	if (puceEtat[index]=='over') {
		obj.find('.puce').stop();
	}
	obj.find('.puce').animate({width:"4px"},durationout,easingOut,togglePuceOut);
}
