

// * Dependencies * 
// this function requires the following snippets:
// JavaScript/images/switchImage
// function switchImage(imgName, imgSrc) 


var mySlideList1 = ['http://www.superiortrails.com/showimages/super01.jpg', 'http://www.superiortrails.com/showimages/super02.jpg', 'http://www.superiortrails.com/showimages/super03.jpg','http://www.superiortrails.com/showimages/super04.jpg', 'http://www.superiortrails.com/showimages/super05.jpg'];
var mySlideShow1 = new SlideShow(mySlideList1, 'slide1', 3000, "mySlideShow1");

var mySlideList2 = ['http://www.superiortrails.com/showimages/ship_01.jpg', 'http://www.superiortrails.com/showimages/ship_02.jpg', 'http://www.superiortrails.com/showimages/ship_03.jpg'];
var mySlideShow2 = new SlideShow(mySlideList2, 'slide2', 4000, "mySlideShow2");


function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}


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);
  }
}

<!-- Followed syntax example from 3rd edition of JavaScript 4 the World Wide Web, p.96

function newWindow(link) 
	{

		albWindow = window.open(link,"albWin", "resizable,height=540,width=450,left=100,top=10,scrollbars");

		albWindow.focus();
		// Focus opens window on top of others. makes sure it does not come up minimized when other windows also open -->
	
	}

<!-- Second Js window code that allows different window size parameters

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=yes,copyhistory=yes,width='+760+',height='+800+',left='+100+', top='+10+',screenX='+left+',screenY='+top+'');
}

