// JavaScript Document

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 4000

// Duration of crossfade (seconds)
var crossFadeDuration = 2

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'images/main-foto1.jpg'
Pic[1] = 'images/main-foto2.jpg'
Pic[2] = 'images/main-foto3.jpg'
Pic[3] = 'images/main-foto4.jpg'

var t
var j = 0
var tel = 0
var p = Pic.length

var preLoad2 = new Array()
for (i = 0; i < p; i++){
   preLoad2[i] = new Image()
   preLoad2[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 = preLoad2[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   document.getElementById("ctl00_lblTitel").innerHTML = ""
   if(tel==1){   
    document.getElementById("ctl00_lblTitel").innerHTML = document.getElementById("ctl00_lblTekst1").value    
   }else if(tel==3){
    document.getElementById("ctl00_lblTitel").innerHTML = document.getElementById("ctl00_lblTekst2").value    
   }else if(tel==4){
    tel = 0
   }
   tel = tel + 1
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
