 var mySlideList1 = ['images/home/001.jpg',  'images/home/002.jpg','images/home/003.jpg','images/home/004.jpg','images/home/005.jpg','images/home/006.jpg'];
  var mySlideList2 = ['images/directions/001.jpg',  'images/directions/002.jpg','images/directions/003.jpg','images/directions/004.jpg','images/directions/005.jpg','images/directions/006.jpg'];
var mySlideShow1 = new SlideShow(mySlideList1, 'slide1',10000, "mySlideShow1");
var mySlideShow2 = new SlideShow(mySlideList2, 'slide2',7000, "mySlideShow2");

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].src = imgSrc;
    }
  }
}

