function SlideShow(slideList, image, speed, name)          
{
  this.slideList = slideList;
  this.image = image;
  this.speed = speed;
  this.name = name;
  this.current = 0;
  this.timer = 0;
}

SlideShow.prototype.play = SlideShow_play;  

function SlideShow_play()       
{
  with(this)
  {
    if(current++ == slideList.length-1) current = 0;
    switchImage(image, slideList[current]);
    clearTimeout(timer);
    timer = setTimeout(name+'.play()', speed);
  }
}

function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
		document.images[imgName].filters.blendTrans.apply();
		document.images[imgName].src = imgSrc;
		document.images[imgName].filters.blendTrans.play();
    }
  }
}

var slList1 = ['foto/forsidebillede_01.jpg','foto/forsidebillede_02.jpg','foto/forsidebillede_03.jpg'];


var slShow1 = new SlideShow(slList1, 'slide1', 5000, "slShow1");

function goplay(neff)
{
	eval("slShow"+neff+".play()");
}

function simplePreload()
{ 
	var args = simplePreload.arguments;
	document.imageArray = new Array(args.length);
	for(var i=0; i<args.length; i++)
	{
		document.imageArray[i] = new Image;
		document.imageArray[i].src = args[i];
	}
//	slShow1.play();
	setTimeout("goplay(1)", 500);
}

