var slideX=1;
var slideMaX=0;
var wdth=289;
var operationIn=0;
var drt=500;

function initSlide(mnu){
	var k=1;
	while($(mnu+k)!=null) k++;
	slideMaX=k-1;
	
	var fxheight = new Fx.Styles($(mnu+'height'), {duration:drt, wait:false});
	fxheight.start({'height': $(mnu+'1').getStyle('height')});
	var fxsuivant = new Fx.Styles($(mnu+'suivant'), {duration:drt, wait:false});
	fxsuivant.start({'height': $(mnu+'1').getStyle('height')});
	var fxprecedent = new Fx.Styles($(mnu+'precedent'), {duration:drt, wait:false});
	fxprecedent.start({'height': $(mnu+'1').getStyle('height')});
}
function nextSlide(mnu){
	if(operationIn==0){
		if($(mnu+(slideX+1))!=null){
			posXini=0-((slideX-1)*wdth);
			slideX++;
			var fx = new Fx.Styles($(mnu+'slider'), {duration:drt, wait:false});
			posX=0-((slideX-1)*wdth);
			fx.start({'left': [posXini,posX]});
		}
		else {
			posXini=0-((slideX-1)*wdth);
			slideX=1;
			var fx = new Fx.Styles($(mnu+'slider'), {duration:drt, wait:false});
			posX=0-((slideX-1)*wdth); fx.start({'left': [posXini,posX]});
		}
		var fxheight = new Fx.Styles($(mnu+'height'), {duration:drt, wait:false});
		fxheight.start({'height': $(mnu+''+slideX).getStyle('height')});
		var fxsuivant = new Fx.Styles($(mnu+'suivant'), {duration:drt, wait:false});
		fxsuivant.start({'height': $(mnu+''+slideX).getStyle('height')});
		var fxprecedent = new Fx.Styles($(mnu+'precedent'), {duration:drt, wait:false});
		fxprecedent.start({'height': $(mnu+''+slideX).getStyle('height')});
	}
	
}
function prevSlide(mnu){
	if(operationIn==0){
		if($(mnu+(slideX-1))!=null){
			posXini=0-((slideX-1)*wdth);
			slideX--;
			var fx = new Fx.Styles($(mnu+'slider'), {duration:drt, wait:false});
			posX=0-((slideX-1)*wdth); fx.start({'left': [posXini,posX]});
		}else {
			posXini=0-((slideX-1)*wdth);
			slideX=slideMaX;
			var fx = new Fx.Styles($(mnu+'slider'), {duration:drt, wait:false});
			posX=0-((slideX-1)*wdth); fx.start({'left': [posXini,posX]});
		}
		var fxheight = new Fx.Styles($(mnu+'height'), {duration:drt, wait:false});
		fxheight.start({'height': $(mnu+''+slideX).getStyle('height')});
		var fxsuivant = new Fx.Styles($(mnu+'suivant'), {duration:drt, wait:false});
		fxsuivant.start({'height': $(mnu+''+slideX).getStyle('height')});
		var fxprecedent = new Fx.Styles($(mnu+'precedent'), {duration:drt, wait:false});
		fxprecedent.start({'height': $(mnu+''+slideX).getStyle('height')});
	}
}
