function MultiSlideshow(target)  
{  
	var that = this;
	var target;
	var diaposList;
	var diapos; //array of diapo
	var current = -1;
	var currentDiapo;
	var started;
	
	this.multislideshow = function(target)
	{
		that.target = target;
		that.started = false;
		//ma liste de diapos
		that.diaposList = $("#"+that.target).children();	
		that.diapos = [];
		for (var i = 0;i< that.diaposList.length ; i++)
		{
			//je masque tous les diapos sauf le premier (premier li)
			var diapo = that.diaposList[i];
			ss = new Slideshow($(diapo).children(0));
			$(diapo).css("display","none");
			that.diapos.push(ss);
		}
		that.showDiapo(0);
	
		/*$.each($("#"+that.target+" li"), function(index, item)
		{
			//je cache tous les diaporamas
			$(item).css("display","none");
		}) */
	}
	
	
	this.init = function()  
	{  
	}  
	 
	this.showDiapo = function(value)
	{
		
		//je masque le diaporama courant
		if(that.current != value)
		{
			$(that.diaposList[that.current]).css("display","none");
			that.current = 0;
			$(that.diaposList[value]).css("display","inline");
			//$(that.diaposList[value]).css("zoom","inline");
			//that.diapos[value].start();
			//that.currentDiapo = that.diapos[value];
		}
	}
	
	this.startDiapo = function(value)
	{
		if(that.currentDiapo)
		{
			$(that.diaposList[that.current]).css("display","none");
			
			that.currentDiapo.stop();
			delete that.currentDiapo;
			that.currentDiapo = null;
		}
		
		$(that.diaposList[value]).css("display","inline");
		that.currentDiapo = that.diapos[value];
		that.current = value;
		that.currentDiapo.start();
		that.started = true;

	}
	
	this.stopDiapo = function()
	{
		if(that.currentDiapo)
		{
			//console.log("je stoppe de diaporama ... ");
			$(that.diaposList[that.current]).css("display","none");
			
			that.currentDiapo.stop();
			delete that.currentDiapo;
			that.currentDiapo = null;
			//that.current = -1;
		}
		that.showDiapo(0);
	}
	
	//si on veut initialisé un truc, on le met la
	this.current = -1;
	this.multislideshow(target);
} 
