function displayDiaporama(id_diaporama,interval){
	if(! document.getElementById("diaporamaspan"+id_diaporama)){
		var collector = document.getElementsByTagName('span');
		for (var x = 0; x < collector.length; x++){
			var re = new RegExp('diaporamaspan'+id_diaporama.substr(0, 2));
			if(collector.item(x).id.match(re)){
				re = new RegExp('diaporamaspan'+'(.*)');
				var result=collector.item(x).id.match(re);
				this.id_span=result[1];
			}
		}
	}
	var evalexp='this.Index=diaporama'+id_diaporama+'.length;';
	eval(evalexp);
	this.Images=new Array();
	this.ImgIndex=0;
	this.ID=null;
	this.interval=interval*1000;
	this.Add=function(src, imgAlt){
		var Index=this.Images.length;
		this.Images[Index]=new Array();
		this.Images[Index]["image"]=new Image();
		this.Images[Index]["image"].src=src;
		if (typeof imgAlt !== 'undefined' && imgAlt !== '') {
			this.Images[Index]["image"].alt=imgAlt;
		}
		this.Images[Index]["rel"]=src;
	}
	this.Show=function(Index){
		if(Index < 0)Index=this.Images.length - 1;
		else{if(Index > this.Images.length - 1)Index=0;}
		var imgAlt = 'disc' + Index;
		if (typeof this.Images[Index]["image"].alt !== 'undefined' && this.Images[Index]["image"].alt !== '') {
			imgAlt = this.Images[Index]["image"].alt
		}
		if(window.document.getElementById("diaporamaspan"+id_diaporama)){
			window.document.getElementById("diaporamaspan"+id_diaporama).innerHTML='<img src="' + this.Images[Index]["image"].src +'" alt="' + imgAlt +'"/>';
		}else if(window.document.getElementById("diaporamaspan"+this.id_span)){
			window.document.getElementById("diaporamaspan"+this.id_span).innerHTML='<img src="' + this.Images[Index]["image"].src +'" alt="' + imgAlt +'">';
		}
		this.ImgIndex=Index;
	}
	this.Play=function(){
		var evalexp='this.ID=setInterval("diaporama'+id_diaporama+'[" + this.Index + "].Show(diaporama'+id_diaporama+'[" + this.Index + "].ImgIndex + 1);", this.interval);';
		eval(evalexp);
	}
	this.Build=function(){
		var imgAlt = 'disc0';
		if (typeof this.Images[0]["image"].alt !== 'undefined' && this.Images[0]["image"].alt !== '') {
			imgAlt = this.Images[0]["image"].alt
		}
		if(window.document.getElementById("diaporamaspan"+id_diaporama)){
			window.document.getElementById("diaporamaspan"+id_diaporama).innerHTML='<img src="' + this.Images[0]["image"].src +'" alt="' + imgAlt +'">';
		}else if(window.document.getElementById("diaporamaspan"+this.id_span)){
			window.document.getElementById("diaporamaspan"+this.id_span).innerHTML='<img src="' + this.Images[0]["image"].src +'" alt="' + imgAlt +'">';
		}
	}
	var evalexp='diaporama'+id_diaporama+'[this.Index]=this;';
	eval(evalexp);
}

