// JavaScript Document
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully


var slideShowSpeed = 5000     /* Velocita' dello slideshow (in millisecondi) */ 
var crossFadeDuration = 4     /* Durata dell'effetto fade (espresso in secondi) */
var Pic = new Array() 

Pic[0] = 'slideshow/slideshow_0.jpg'   /*Qui i richiami alle immagini che compongono lo slideshow.*/ 
Pic[1] = 'slideshow/slideshow_1.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */
Pic[2] = 'slideshow/slideshow_2.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */
Pic[3] = 'slideshow/slideshow_3.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */
Pic[4] = 'slideshow/slideshow_4.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */
Pic[5] = 'slideshow/slideshow_5.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */

// =========================================
// Non editare niente nella zona sottostante
// =========================================

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]
}

var delay = 50;

function fadeIn() {
	var opac = parseFloat(document.images.SlideShow.style.opacity);
	if (opac < 1) {
		opac = opac + 0.04;
		document.images.SlideShow.style.opacity = opac;
		setTimeout(fadeIn, delay);
	}
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=4)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   
else {
		document.images.SlideShow.style.opacity = 0.1;
   }
   		document.images.SlideShow.src = preLoad[j].src;
   
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
else {
		fadeIn();
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
