// JavaScript Document

<!--

var dimages=new Array();
var Caption=new Array();
var numImages=10;

for (i=0; i<numImages; i++)
{
  dimages[i]=new Image();
  dimages[i].src="images/slideshow/ss"+(i+1)+".jpg"; // allows static file names from 1 to ...
}
var curImage=0;

Caption[0]  = "<p>This is the first caption.</p>";
Caption[1]  = "<p>This is the second caption.</p>";
Caption[2]  = "<p>This is the third caption.</p>";
Caption[3]  = "<p>This is the fourth caption.</p>";
Caption[4]  = "<p>This is the fifth caption.</p>";
Caption[5]  = "<p>This is the sixth caption.</p>";
Caption[6]  = "<p>This is the seventh caption.</p>";
Caption[7]  = "<p>This is the eighth caption.</p>";
Caption[8]  = "<p>This is the ninth caption.</p>";
Caption[9] = "<p>This is the tenth caption.</p>";

function nextPicture()
{
  
  if (document.images)
  {
    var nextImage=curImage+1;
	if (nextImage>=numImages)
      nextImage=0;
    if (dimages[nextImage] && dimages[nextImage].complete)
    {
      var target=0;
      if (document.images.myImage)
        target=document.images.myImage;
      if (document.all && document.getElementById("myImage"))
        target=document.getElementById("myImage");
  
      // make sure target is valid.  It might not be valid
      //   if the page has not finished loading
      if (target)
      {
        target.src=dimages[nextImage].src;
		curImage=nextImage;
      }
	  if (document.getElementById) document.getElementById("CaptionText").innerHTML= Caption[nextImage];

      // setTimeout("swapPicture()", 5000);

    }
  }
}

function pickPicture(pic)
{
  if (document.images)
  {
    var nextImage=pic;
    if (nextImage>=numImages)
      nextImage=0;
    if (dimages[nextImage] && dimages[nextImage].complete)
    {
      var target=0;
      if (document.images.myImage)
        target=document.images.myImage;
      if (document.all && document.getElementById("myImage"))
        target=document.getElementById("myImage");
  
      // make sure target is valid.  It might not be valid
      //   if the page has not finished loading
      if (target)
      {
        target.src=dimages[nextImage].src;
        curImage=nextImage;
      }

      // setTimeout("swapPicture()", 5000);

    }
  }
}

function prevPicture()
{
  if (document.images)
  {
    var nextImage=curImage-1;
    if (nextImage<0)
      nextImage=numImages-1;
    if (dimages[nextImage] && dimages[nextImage].complete)
    {
      var target=0;
      if (document.images.myImage)
        target=document.images.myImage;
      if (document.all && document.getElementById("myImage"))
        target=document.getElementById("myImage");
  
      // make sure target is valid.  It might not be valid
      //   if the page has not finished loading
      if (target)
      {
        target.src=dimages[nextImage].src;
        curImage=nextImage;
      }
	  if (document.getElementById) document.getElementById("CaptionText").innerHTML= Caption[nextImage];

      // setTimeout("swapPicture()", 5000);

    }
  }
}


-->
