        var hTimeOut;
	    var nbDiv = 0;
	    var divAAfficher = 2;
	    var divAffiche = 1;
	    var bPause = false;
        var effetFondu = "vide";
        var opaciteAfficher;
        var opaciteMasquer;
        
        var debutFondu = 100;
        
        
	    
	    function fondu(lNbDiv){
	        if (nbDiv==0 && !isNaN(lNbDiv)) nbDiv = lNbDiv;
	        opaciteMasquer = debutFondu;
	        opaciteAfficher = 0;
            document.getElementById("img" + divAAfficher).style.zIndex = "1";
	        document.getElementById("img" + divAAfficher).style.visibility = "visible";
            setOpacity("img" + divAAfficher, 0);
		    //diminuer l'opacité de la div affichée
	        if (effetFondu == "vide"){
			    effetFondu = window.setInterval("lancerFondu()", 10);
	        }
	    }
	    function lancerFondu(){
	        opaciteMasquer = opaciteMasquer - 1;
	        opaciteAfficher = opaciteAfficher + 1;
	        
            if (opaciteAfficher == 100) {
    		    document.getElementById("img" + divAffiche).style.visibility = "hidden";
    		    document.getElementById("img" + divAffiche).style.zIndex = "1";
                setOpacity("img" + divAffiche, debutFondu);
   		        divAffiche = divAAfficher;
   		        divAAfficher += 1;
   		        if (divAAfficher>nbDiv) divAAfficher = 1;
			    window.clearInterval(effetFondu);
			    effetFondu = "vide";
			    if (!bPause) hTimeOut = setTimeout("fondu()", 1000);
	            return;
	        }
	        
            setOpacity("img" + (divAffiche), opaciteMasquer);
            setOpacity("img" + (divAAfficher), opaciteAfficher);

	    }
    	function setOpacity( id, value ){
            var object = document.getElementById(id).style;
            object.opacity = (value / 100);
            object.MozOpacity = (value / 100);
            object.KhtmlOpacity = (value / 100);
            object.filter = "alpha(opacity=" + value + ")";
    	}
        
        
	    function aller(lIndex)
	    {
	        //alert('index : ' + lIndex);
	        clearTimeout(hTimeOut);
	        clearTimeout(effetFondu);
	        effetFondu = "vide";
    	    
            //on masque le div actuel
		    document.getElementById("img" + divAffiche).style.visibility = "hidden";
		    document.getElementById("img" + divAffiche).style.zIndex = "1";
            setOpacity("img" + divAffiche, debutFondu);
            //on affiche le div demandé

            divAAfficher = parseInt(lIndex) + 1;   
	        //alert("lindex" + lIndex + ' AAfficher : ' + divAAfficher);
            divAffiche = divAAfficher;
		    document.getElementById("img" + divAAfficher).style.visibility = "visible";
		    document.getElementById("img" + divAAfficher).style.zIndex = "1";

		   // alert('index : ' + "img" + divAAfficher);
		    setOpacity("img" + divAAfficher, debutFondu);


		    //hTimeOut = setTimeout("test()", 50);
	    }

	    function reprendre()
	    {
	        bPause = false;
    	    
	        divAffiche = divAAfficher;
	        divAAfficher += 1;
	        if (divAAfficher>nbDiv) divAAfficher = 1;

		    fondu();
	    }

	    function test() {
	        alert('divAffiche :' + divAffiche);
	        alert('divAAfficher :' + divAAfficher);
	        alert('nbDiv :' + nbDiv);
	        

	        //bPause = false;
	        //divAffiche = divAAfficher;
	        //divAAfficher += 1;
	        //if (divAAfficher > nbDiv) divAAfficher = 1;
	    }
        
        
        
        
        
        
        
        /*var hTimeOut;
	    var nbDiv = <%=NombreDiv %>;
	    var divAAfficher = 2;
	    var divAffiche = 1;
	    var bPause = false;
        var opaque = "vide";
	    var width = 768;
	    var pos = width;
	    var posOpaque = 0;
	    
	    
	    function go_avant() {	// pas en avant
	        pos = width;
	        posOpaque = -1 * width;
	        if (divAAfficher == 1){
			    document.getElementById("img" + (nbDiv)).style.zIndex = "0";
	        }else{
			    document.getElementById("img" + (divAAfficher-1)).style.zIndex = "0";
	        }
	        //animation opaque avant...
	        if (opaque == "vide"){
			    opaque = window.setInterval("animerOpaque()", 10);
	        }
	    }

	    function animerOpaque(){

		    posOpaque = posOpaque + 10;
		    if(posOpaque >= 0) {				// arreter tous les width (400) pixel
			    window.clearInterval(opaque);
			    opaque = "vide";
			    pos = width;
			    proc = window.setInterval("animer()", 20);
	            return;
	        }
		    if (posOpaque > -10) posOpaque = 0;
		    document.getElementById("divOpaque").style.left = posOpaque + "px";

	    }
    	
	    function animer(){
		    pos = pos - 10;
		    posOpaque = posOpaque - 10

		    if(pos <= 0) {				// arreter tous les width (400) pixel
		        if (divAAfficher == 1){
    			    document.getElementById("img" + (nbDiv)).style.left = width  + "px";
		        }else{
	    		    document.getElementById("img" + (divAAfficher-1)).style.left = width  + "px";
		        }
   		        divAffiche = divAAfficher;
   		        divAAfficher += 1;
   		        if (divAAfficher>nbDiv) divAAfficher = 1;
			    window.clearInterval(proc);
			    proc = "vide";
			    if (!bPause) hTimeOut = setTimeout("go_avant()", 5000);
	            return;
	        }
		    if (pos<10) {
		        pos = 0;
	            posOpaque = -1 * width;
		    }

		    document.getElementById("img" + divAAfficher).style.left = pos  + "px";
		    document.getElementById("img" + divAAfficher).style.zIndex = "1";
		    document.getElementById("divOpaque").style.left = posOpaque + "px";
		    document.getElementById("divOpaque").style.zIndex = "1";
    	
	    }

	    function aller(lIndex)
	    {
	        clearTimeout(hTimeOut);
	        clearTimeout(proc);
	        proc = "vide";
	        clearTimeout(opaque);
	        opaque = "vide";
    	    
	        //on remet le beandeau opaque à gauche
		    document.getElementById("divOpaque").style.left = (-1 * width) + "px";
            //on met le div actuel à droite
		    document.getElementById("img" + divAffiche).style.left = width + "px";
            //on affiche le div demandé
	        divAAfficher = lIndex +1 ;
            divAffiche = divAAfficher;
		    document.getElementById("img" + divAAfficher).style.left = "0px";
		    document.getElementById("img" + divAAfficher).style.zIndex = "1";
	    }

	    function reprendre()
	    {
	        bPause = false;
    	    
	        if (divAAfficher == 1){
			    document.getElementById("img" + (nbDiv)).style.left = width  + "px";
	        }else{
    		    document.getElementById("img" + (divAAfficher-1)).style.left = width  + "px";
	        }
	        divAffiche = divAAfficher;
	        divAAfficher += 1;
	        if (divAAfficher>nbDiv) divAAfficher = 1;

		    go_avant();
	    }*/
