// Program: SlideShow.js
   // By:      Duane M. Gran, ragnar@spinweb.net
   // Purpose: The user can pan through a series of images with textual
   //          descriptions for each image.

   // Function: loadImages
  // Purpose:  Reads in images (named 1.jpg through 10.jpg) into an array.

   function loadImages()
   {
    images = new Array();
     numImages = 9;
     for (frame = 1; frame < numImages+1; frame++)
     {
       images[frame]     = new Image();
       images[frame].src = "ss/" + frame + ".jpg";
     }
   }

   // Function: loadText
   // Purpose:  Stores textual descriptions for images into an array.

   function loadText()
   {    
     text      = new Array();
     text[1] = "John Bambacus, Emeritus Faculty";
     text[2] = "Stephen Hartlaub, Associate Professor";
     text[3] = "Scott Johnson, Associate Professor";
     text[4] = "Joan Andorfer, Professor";
     text[5] = "David Lewis, Associate Professor";
     text[6] = "John O'Rorke, Associate Professor";
     text[7] = "Steve Twing, Associate Professor";
     text[8] = "Stephen Simpson, Professor - Provost";
     text[9] = "Julie Fuller, Administrative Assistant";



   }

   // Function: displayImage
   // Purpose:  First sets the textual description and the image counter,
   //           then sets the source of the <IMG> tag with the name of
   //           slideshow.

   function displayImage()
   {
     document.textForm.ta.value = text[i];         // text description
//     document.numForm.imageCount.value = i;        // image number
     document.slideshow.src = images[i].src        // display image 
   }

   // Function: next
   // Purpose:  Handles a request to view the next image.  If the next image
   //           doesn't exist, it wraps around to the beginning of the array.

   function next()
   {
     i++;                                          // increment
     if (i == numImages+1)
       i = 1;                                      // restart at first image
     displayImage();                               // display the image
   }

   // Function: previous
   // Purpose:  Same as next() but it wraps backward.

   function previous()
   {
     i--;                                          // decrement
     if (i == 0)
       i = images.length-1;                        // restart at last image
     displayImage();                               // display the image
   }

