// 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 stopstatus = 0

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 8000

// Duration of crossfade (seconds)
var crossFadeDuration = 1


var t
var j = 0
//Este el el tamaño del array de direcciones de las imagenes
// El Array se llama Pic
var p = Pic.length  
var pos = j

//Array de imagenes precargadas. En el se meten las imagenes y sus direcciones
var preLoad = new Array()  

function preLoadPic(index){
  if (Pic[index] != ''){
    window.status='Loading : '+Pic[index]
    preLoad[index] = new Image()
    preLoad[index].src = Pic[index]
    Pic[index] = ''
    window.status=''
  }
}

function runSlideShow(){
  if (stopstatus != '1'){
    if (document.all){
	
	// El campo del objeto, SlideShow, es la propiedad name de la imagen a mostrar. 
	// Así podemos cambiarla dinamicamente.
	//
	//            <IMG src="001.jpg" border=1 name=SlideShow>
	//
      //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()
    }
    pos = j
    j = j + 1
    if (j > (p-1)) j=0
	
	//Esta funcion lanza a ejecutar, una sola vez, la funcion que tiene entre parentesis el tiempo
	// señalado por slideShowSpeed. En esta funcion nos sirve para cambiar el tiempo entre fotos

    t = setTimeout('runSlideShow()', slideShowSpeed)
    preLoadPic(j)
  }
}

function endSlideShow(){
  stopstatus = 1
 // self.document.location = ''
}

preLoadPic(j)


