var current = 0;

// Suivant
function next() {
	if (document.getElementById('form_diapo').slide[current+1]) {
	document.getElementById('show').src = document.getElementById('form_diapo').slide[current+1].value;
	document.getElementById('form_diapo').slide.selectedIndex = ++current;
	}
	else {
	first();
	}
}
// Précédent
function previous() {
	if ((current-1) >= 0) {
	document.getElementById('show').src = document.getElementById('form_diapo').slide[current-1].value;
	document.getElementById('form_diapo').slide.selectedIndex= --current;}
	else {
	last();
	}
}
// Début
function first() {
current=0;
document.getElementById('show').src = document.getElementById('form_diapo').slide[0].value;
document.getElementById('form_diapo').slide.selectedIndex=0;
}
// Fin
function last() {
current=(document.getElementById('form_diapo').slide.length-1);
document.getElementById('show').src = document.getElementById('form_diapo').slide[current].value;
document.getElementById('form_diapo').slide.selectedIndex=current;
}
// Controle automatique
function ap(text) {
document.getElementById('form_diapo').slidebutton.value=(text == "Stop") ? "Lecture" : "Stop";
rotate();
}
// Menu Select
function change() { 
current=document.getElementById('form_diapo').slide.selectedIndex;
document.getElementById('show').src = document.getElementById('form_diapo').slide[current].value;
}

function rotate() {
	if (document.getElementById('form_diapo').slidebutton.value == "Stop") {
	current = (current == document.getElementById('form_diapo').slide.length-1) ? 0 : current+1;
	document.getElementById('show').src = document.getElementById('form_diapo').slide[current].value;
	document.getElementById('form_diapo').slide.selectedIndex = current;
	window.setTimeout("rotate()", 3000);
	}
}