function DiaporamaIMGResized(ObjectName, ElementId, Images, Directory, Timer, MaxWidth, MaxHeight){
	this.ObjectName	= ObjectName; 	// Nom de l objet javascript pour le timer
	this.ElementId 	= ElementId;
	this.CurID		= -1;
	this.Images 	= Images; 		// tableau de nom de fichiers
	this.TimerId 	= 0;
	this.Directory 	= Directory; 	// repertoire ou sont situé les fichiers
	this.TimerLength= Timer; 		// temps entre 2 diapos 2500
	this.MaxWidth 	= MaxWidth; 
	this.MaxHeight 	= MaxHeight; 
	this.LoadTimerId 	= 0;

	this.StopStart = function(){
		this.Stop();
		this.Start();
	};
	
	this.Start = function(){
		if (this.TimerId>0)
			window.clearTimeout(this.TimerId);
		this.CurID += 1;
		if (this.CurID == this.Images.length) this.CurID = 0;
		this.ChangeImage(this.CurID,true);
	};
	this.Stop = function(){
	   	if(this.TimerId) {
	      	window.clearTimeout(this.TimerId);
	      	this.TimerId  = 0;
	      	this.CurID = 0;
	  		this.ChangeImage(this.CurID,false);
		}
	};
	this.Next = function(){
	   	this.Pause();
		this.CurID += 1;
		if (this.CurID == this.Images.length) this.CurID = 0;
		this.ChangeImage(this.CurID,false);
	};
	this.Prev = function(){
	   	this.Pause();
		this.CurID -= 1;
		if (this.CurID < 0) this.CurID = ( this.Images.length-1);
		this.ChangeImage(this.CurID,false);
	};
	
	this.Pause = function(){
		if(this.TimerId) {
	      	window.clearTimeout(this.TimerId);
	      	this.TimerId = 0;
	   	}
	};
	var imgObjs = new Array();
	this.ChangeImage = function(ID,mode){

		//Horloge = document.getElementById("Clock");
		//Horloge.style.display="block";

		var tmpImages = new Image();
		tmpImages.onload = function(){
			//alert("ca charge "+ObjectName);
			window.status='Chargement terminé...!';
			eval(ObjectName+".ChangeImageOK()");
		}
		this.tempID=ID;
		this.tempMode=mode;
		tmpImages.src=this.Directory+this.Images[ID][0];
		//on declanche le timer
		/*
		curdiaporama = document.getElementById(this.ElementId);
		curdiaporama.src=this.Directory+this.Images[ID][0];
		this.setInformationTexte();
		curdiaporama.width = this.Images[ID][1];
		curdiaporama.height = this.Images[ID][2];
		*/
	};
	
	this.ChangeImageOK = function(){
		ID = this.tempID;
		curdiaporama = document.getElementById(this.ElementId);
		curdiaporama.src=this.Directory+this.Images[ID][0];
		this.setInformationTexte();
		curdiaporama.width = this.Images[ID][1];
		curdiaporama.height = this.Images[ID][2];
		if (this.tempMode){
			this.TimerId = setTimeout(ObjectName+".Start()", this.TimerLength );
		}
		//Horloge = document.getElementById("Clock");
		//Horloge.style.display="none";

	};

	this.setInformationTexte = function(){
		if (Informations = document.getElementById("Information"+ElementId)){
			Informations.innerHTML="["+(this.CurID+1)+"/"+(this.Images.length)+"]";
		}
	}
	this.Popup = function(){
		//simplePopup(this.Directory+"fullsize/"+this.Images[this.CurID][0]);
		popupImageGoodSize(this.Directory+"fullsize/"+this.Images[this.CurID][0], "Zoom");
	};
	
}
