// POUR LE DIAPORAMA
//-------------------

// DEfinir les variables variables

// METTER LA VITESSE DE L'IMAGE EN milliseconds- slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// La duree en secondes
var crossFadeDuration = 1

// Definir le dossier d'images
var Pic = new Array() // don't touch this
// Ajouter d'image ou just continuer
// le modèle, en ajoutant au tableau ci dessous

Pic[0] = 'images/LAP/Slideshow/1.jpg'
Pic[1] = 'images/LAP/Slideshow/2.jpg'
Pic[2] = 'images/LAP/Slideshow/3.jpg'
Pic[3] = 'images/LAP/Slideshow/4.jpg'

// ne pas editer ou changer la ligne ci dessous

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
   		document.images.SlideShow.style.filter="blendTrans(duration=2)"
      
		document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
     	document.images.SlideShow.filters.blendTrans.Apply()   
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}



// FIN DU DIAPORAMA
//------------------












// POUR LES IMAGES ALEATOIRES
//--------------------------

var theImages = new Array()

theImages[0] = 'images/LAP/random/1.jpg'
theImages[1] = 'images/LAP/random/2.jpg'
theImages[2] = 'images/LAP/random/3.jpg'
theImages[3] = 'images/LAP/random/4.jpg'


var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

// END
//-----
