/**
*	DIAPORAMA
*
*/
isDiaporama = true ;

// Variable pour le défilement des images
var iDiapoId;
var timeout ;
var imageCourante = 0 ;
var vitesseDefilement = 10000 ;

function afficheZoom(id) {
	iDiapoId = id ;
	imageCourante = 0;
	imageContinu() ;
	display('zoom') ;
	displaySelect() ;
	window.location.hash='anchor_zoom' ;
}

function displaySelect() {
	var oDiv = document.getElementById('listeAffichageQuantite') ;
	if (oDiv) oDiv.style.visibility = oDiv.style.visibility == 'hidden' ? 'visible' : 'hidden' ;
}

function masqueZoom() {
	arret() ;
	display('zoom') ;
	displaySelect() ;
	window.location.hash='anchor_' + iDiapoId ;
}

function imageSuivante() {
	var oImg = document.getElementById('imageSite');
	if (oImg) oImg.src = imagesDiaporama[iDiapoId][imageCourante] ;
	var oDiv = document.getElementById('descSite') ;
	if (oDiv) oDiv.getElementsByTagName('div')[0].innerHTML = descriptionDiaporama[iDiapoId][imageCourante] ;
	imageCourante++;
	if (imageCourante == imagesDiaporama[iDiapoId].length ){
		imageCourante = 0;
	}
}

function imageContinu() {
	clearTimeout(timeout) ;
	imageSuivante() ;
	if ( imagesDiaporama[iDiapoId].length > 1 ) {
		document.getElementById('commande').style.display = 'block' ;
		// timeout = setTimeout("imageContinu()", vitesseDefilement);
	} else {
		document.getElementById('commande').style.display = 'none' ;
	}
}

function arret() {
	clearTimeout(timeout) ;
}
