
// Déclaration et initialisation des variables 
 
        var tab_img = new Array;    //tableau contenant les images
        var num=0;                  //numéro de l'image jouée
 
  		var tab1_img1 = new Array;    //tableau contenant les images
        var num1=0;                  //numéro de l'image jouée
 

        //Images stockées dans le tableau       
	 	
        tab_img[0] = 'media/small/50332-1.png' 
tab_img[1] = 'media/small/60164-11458_P9161347.JPG' 
tab_img[2] = 'media/small/58541-11854_P9161350.JPG' 
tab_img[3] = 'media/small/16895-14643_P1011614.JPG' 
tab_img[4] = 'media/small/82439-16944_PA082138.JPG' 
tab_img[5] = 'media/small/20773-P8281266.JPG' 
tab_img[6] = 'media/small/60042-P9302115.JPG' 
tab_img[7] = 'media/small/27813-PA082122.JPG' 
tab_img[8] = 'media/small/38406-P6260984.JPG' 
tab_img[9] = 'media/small/67481-P6260987.JPG' 
        
       //Ajout d'un compte à rebours afin de jouer le diaporama
        var timer_diapo=setInterval("diaporama('boite_diapo','img_diapo',100)",4000);
        var timer_diapo1=setInterval("diaporama1('boite_diapo1','img_diapo1',100)",4000);
 
        /* Explication des paramètres 
 
        'boite_diapo' : identifiant de la boite du diaporama. NE PAS MODIFIER
        'img_diapo'   : identifiant de l'image contenu dans la boite diaporama. NE PAS MODIFIER.
        500           : temps (en milliseconde) de l'effet fondu entre 2 images. 1 seconde = 1000 millisecondes.
        7000          : interval de temps entre 2 images. 1 seconde = 1000 millisecondes.
        
        */
 
        //Fonction qui permet de jouer le diaporama
        function diaporama(divid, imageid, millisec) 
        { 
            var speed = Math.round(millisec / 100); 
            var timer = 0; 
          
            document.getElementById(divid).style.backgroundImage = "url(" + tab_img[num] + ")"; 
 
            changeOpac(0, imageid); 
 
            if (num>(tab_img.length-2))
            {num = -1;}
 
		document.getElementById(imageid).style.backgroundImage = "url(" + tab_img[num+1] + ")"; 
           
           for(i = 0; i <= 100; i++)
           { 
                setTimeout("changeOpac(" + i + ",'" + imageid+ "')",(timer * speed)); 
                timer++; 
           } 
            
         
          num++;
 
        }
        
        //Fonction qui permet de jouer le diaporama
        function diaporama1(divid, imageid, millisec) 
        { 
            var speed = Math.round(millisec / 100); 
            var timer = 0; 
          
            document.getElementById(divid).style.backgroundImage = "url(" + tab1_img1[num1] + ")"; 
 
            changeOpac(0, imageid); 
 
            if (num1>(tab1_img1.length-2))
            {num1 = -1;}
 
		document.getElementById(imageid).style.backgroundImage = "url(" + tab1_img1[num1+1] + ")"; 
           
           for(i = 0; i <= 100; i++)
           { 
                setTimeout("changeOpac(" + i + ",'" + imageid+ "')",(timer * speed)); 
                timer++; 
           } 
            
         
          num1++;
 
        }

 
 
        
        //Fonction qui attribue l'opacité à l'objet "image_diapo"
        function changeOpac(opacity, id) 
        {
            var object = document.getElementById(id).style;
            object.opacity = (opacity / 100);
            object.MozOpacity = (opacity / 100);
            object.KhtmlOpacity = (opacity / 100);
            object.filter = "alpha(opacity=" + opacity + ")";
        }
