// 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 = 7000     /* Velocita' dello slideshow (in millisecondi) */ 
var crossFadeDuration = 4     /* Durata dell'effetto fade (espresso in secondi) */
var Pic = new Array() 

Pic[0] = webrootpath+'img/templates/front/slideshow/slideshow_a.jpg'   /*Qui i richiami alle immagini che compongono lo slideshow.*/
Pic[1] = webrootpath+'img/templates/front/slideshow/slideshow_b.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */
Pic[2] = webrootpath+'img/templates/front/slideshow/slideshow_c.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */
Pic[3] = webrootpath+'img/templates/front/slideshow/slideshow_3.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */
Pic[4] = webrootpath+'img/templates/front/slideshow/slideshow_d.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */
Pic[5] = webrootpath+'img/templates/front/slideshow/slideshow_e.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */
Pic[6] = webrootpath+'img/templates/front/slideshow/slideshow_f.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */
Pic[7] = webrootpath+'img/templates/front/slideshow/slideshow_g.jpg'  /* Aggiungi quante immagini vuoi. Basta seguire la numerazione */
Pic[8] = webrootpath+'img/templates/front/slideshow/slideshow_h.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)
}
