<!--
var current_diapo = 1;
var last_diapo = 1;
var run_diapo = true;
var back = false;
	
function diaporama(){
	var nb_diapo = diapo.length-1;
	if(last_diapo != 1) {
		current_diapo = last_diapo;
	}
	if(diapo != null)
	{
		if(run_diapo)
		{
			load_image(current_diapo);
			if(back == true) {
				if(current_diapo == 1) {
					current_diapo = nb_diapo;
				} else --current_diapo;
			} else {
				if(current_diapo >= nb_diapo) {
				current_diapo = 1;
				} else current_diapo++;
			}
			last_diapo = current_diapo;
			setTimeout("diaporama()", 4000);
		}
	}
}

function start_diapo(){
	forward_on();
	backward_off();
	pause_off();
	current_diapo = last_diapo;
	run_diapo = true;
	back = false;
}

function stop_diapo(stoped_diapo){
	forward_off();
	backward_off();
	pause_on();
	current_diapo = 0;
	if(stoped_diapo != null) {
		last_diapo = stoped_diapo;
	}
	run_diapo = false;
}

function backward_diapo(){
	forward_off();
	backward_on();
	pause_off();
	current_diapo = last_diapo;
	run_diapo = true;
	back = true;
}

function backward_on(){
	if(document.getElementById && document.getElementById('B_Back')){
		document.getElementById('B_Back').style.backgroundPosition = "0px -36px";
	}
}

function backward_off(){
	if(document.getElementById && document.getElementById('B_Back')){
		document.getElementById('B_Back').style.backgroundPosition = "0px 0px";
	}
}

function pause_on(){
	if(document.getElementById && document.getElementById('B_Pause')){
		document.getElementById('B_Pause').style.backgroundPosition = "-18px -36px";
	}
}

function pause_off(){
	if(document.getElementById && document.getElementById('B_Pause')){
		document.getElementById('B_Pause').style.backgroundPosition = "-18px 0px";
	}
}

function forward_on(){
	if(document.getElementById && document.getElementById('B_Play')){
		document.getElementById('B_Play').style.backgroundPosition = "-36px -36px";
	}
}

function forward_off(){
	if(document.getElementById && document.getElementById('B_Play')){
		document.getElementById('B_Play').style.backgroundPosition = "-36px 0px";
	}
}

//-->
