
//v1.0
/*

	<script src="js/multislide.js" type="text/javascript"></script>
	<script type="text/javascript" >	
	var list = ['image_name'[,...]];
	
	var slide = new SlideShow(list, 'slide', 700, "slide",1,4);
	</script>
		
	<body onLoad="slide.play();">

*/

function SlideShow(slideList, image, speed, name, min, max){
  this.slideList = slideList;
  this.image = image;
  this.speed = speed;
  this.name = name;
  this.current = 0;
  this.timer = 0;
  this.min = min;
  this.max = max;
  this.em = this.min;
  this.current = this.max-1;
}

SlideShow.prototype.play = SlideShow_play;  

function SlideShow_play(){
  with(this){
    if(current++ == slideList.length-1) current = 0;
    switchImage(image+em, slideList[current]);
    clearTimeout(timer);
	em++;
	if(em>max)em=min;
    timer = setTimeout(name+'.play()', speed);
  }
}

function switchImage(imgName, imgSrc){
  if (document.images){
    if (imgSrc != "none"){
      document.images[imgName].src = imgSrc;
    }
  }
}

