// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
var anzahl = 2 ;

// Specify the image files
// to add more images, just continue
// the pattern, adding to the array below
var StartBild = "../images/"+pic_name+"1.jpg";
i1 = new Image();
i1.src = "../images/"+pic_name+"1.jpg"; /* normale-Grafik */
i2 = new Image();
i2.src = "../images/"+pic_name+"2.jpg"; /* Highlight-Grafik */
i3 = new Image();
i3.src = "../images/"+pic_name+"3.jpg"; /* normale-Grafik */
i4 = new Image();
i4.src = "../images/"+pic_name+"4.jpg"; /* Highlight-Grafik */
//i5 = new Image();
//i5.src = "../images/"+pic_pfad+"/"+pic_name+"5.jpg"; /* Highlight-Grafik */
//i6 = new Image();
//i6.src = "../images/"+pic_pfad+"/"+pic_name+"7.jpg"; /* Highlight-Grafik */
//i7 = new Image();
//i7.src = "../images/"+pic_pfad+"/"+pic_name+"6.jpg"; /* Highlight-Grafik */
//i8 = new Image();
//i8.src = "../images/"+pic_pfad+"/"+pic_name+"8.jpg"; /* Highlight-Grafik */

// =======================================
// do not edit anything below this line
// =======================================

var i = 0;
var restore = 0;

function runSlideShow() {
  if (i == anzahl) restore = 1; 
  if (i == anzahl) i = 0; 
  i++; 
  if ( restore == 0) {
    if (document.all){
      document.images['foto'+i].style.filter="blendTrans(duration=2)";
      document.images['foto'+i].style.filter="blendTrans(duration=crossFadeDuration)";
      document.images['foto'+i].filters.blendTrans.Apply();
    }
    document.images['foto'+i].src = eval('i'+(i*2)).src;
    if (document.all){
      document.images['foto'+i].filters.blendTrans.Play();
    }
    setTimeout ('runSlideShow()', slideShowSpeed);
  }

  if ( restore == 1) {
    if (document.all){
      document.images['foto'+i].style.filter="blendTrans(duration=2)";
      document.images['foto'+i].style.filter="blendTrans(duration=crossFadeDuration)";
      document.images['foto'+i].filters.blendTrans.Apply();
    }
	var j = (i*2)-1;
    document.images['foto'+i].src = eval('i'+ j).src;
    if (document.all){
      document.images['foto'+i].filters.blendTrans.Play();
    }
    setTimeout ('runSlideShow()', slideShowSpeed);
	if (i == anzahl) restore = 0;
	if (i == anzahl) i = 0;
  }
}
// <body onLoad="setTimeout('runSlideShow()', slideShowSpeed)">
