
	function suivante(){ // suivante
			if(document.slideshow.slide[current+1]){
						document.images.show.src = document.slideshow.slide[current+1].value;
						document.slideshow.slide.selectedIndex = ++current;}
			else{
						debut();
			}
			AfficheLegende(current);
	}

	function precedante(){ // précédente
			if((current-1) >= 0){
						document.images.show.src = document.slideshow.slide[current-1].value;
						document.slideshow.slide.selectedIndex= --current;}
			else{
						fin();
			}
			AfficheLegende(current);
	}

	function debut(){ // première image
			current=0;
			document.images.show.src = document.slideshow.slide[0].value;
			document.slideshow.slide.selectedIndex=0;
			AfficheLegende(current);
	}

	function fin(){ // dernière image
			current=(document.slideshow.slide.length-1);
			document.images.show.src = document.slideshow.slide[current].value;
			document.slideshow.slide.selectedIndex=current;
			AfficheLegende(current);
	}

	function ap(text){ // Démarrage et pause du slideshow
			document.slideshow.autoplay.value=(text == "Pause") ? "Play" : "Pause";
			rotate();
	}

	function image(){ // menu déroulant
			current=document.slideshow.slide.selectedIndex;
			document.images.show.src = document.slideshow.slide[current].value;
			AfficheLegende(current);
	}

	function rotate() {
			if (document.slideshow.autoplay.value == "Pause") {
						current = (current == document.slideshow.slide.length-1) ? 0 : current+1;
						document.images.show.src = document.slideshow.slide[current].value;
						document.slideshow.slide.selectedIndex = current;
						window.setTimeout("rotate()", 2500);
						AfficheLegende(current);
			}
	}

	function AfficheLegende(current){
		//test = document.slideshow.nbLegendTotal.value;

		for(i=1; i< document.slideshow.nbLegendTotal.value; i++){
					cibleLegende = 'galeryLegendId' + i;
					document.getElementById(cibleLegende).style.display="none";
		}
		cibleLegende = 'galeryLegendId' + (current +1);
		document.getElementById(cibleLegende).style.display="inline";		
	}
	
	function slideshowNav(){
		document.write('<p class="galerieBouton"><input type="button" onclick="debut();" id="first" value="|&lt;" /> ');
		document.write('<input type="button" onclick="precedante();" id="prev" value="&lt;" /> ');
		document.write('<input type="button" name="autoplay" onclick="ap(this.value);" id="autoplay" value="Play" title="Automatique" style="width:160;" /> ');
		document.write('<input type="button" onclick="suivante();" id="next" value="&gt;" /> ');
		document.write('<input type="button" onclick="fin();" id="last" value="&gt;|" /> ');
	}
