function lanceDia(lui)
{
	if(lui==0){
		projo = window.open("diaporama.html","Diaporama","resizable='yes'");
		projo.moveTo(0,0);
		projo.resizeTo(screen.width,screen.height);
	}else if(lui>0 && lui<21){
		file = "diaporama.html?"+ lui;
		projo = window.open(file,"Diaporama","resizable='yes',inner.width='640',inner.height='400'");
		projo.moveTo(0,0);
		projo.resizeTo(screen.width,screen.height);
	}
}

function prepareScene()
{
		s = this.document.URL;
		pos = s.indexOf("?");
		if(pos!=-1){
			p = s.substring(pos + 1,pos + 3);
		}else{
			p = 1;
		}
		diapo(p,"EXT");
}

function diapo(num, type)
{
		max = 20;
		var liste = new Array();
		liste[0] = num;
	
		if(type=="INT"){
			
			oldSrc = this.document.visuel.src;
			hardLink = "/images/galerie/v";
			start = oldSrc.indexOf(hardLink);
			start += hardLink.length;
			end = oldSrc.indexOf(".jpg");
			ouais = Math.round(oldSrc.substring(start,end));
			
			ouais += num;
			
			if(ouais<1){
				ouais=max;
			}
			
			if(ouais>max){
				ouais=1;
			}
			
			image = "../images/galerie/v"+ ouais +".jpg";
		//	alert(ouais);
			
		}else if(type=="EXT"){
			image = "../images/galerie/v"+ num +".jpg";
		}
		this.document.visuel.src = image;
}