  // SCRIPT:   Image Display
  // Filename: imageDisplay.js
  // Purpose:  small slide show script
  //           image for display or background.
  //
  // Author:   Deborah Lee Soltesz, USGS, 10/2001

  // to behave properly, all images in the slideshow
  // set should be the same width and height
  //
  // imgBaseURL is set on the web page
  // imgName is the name attribute of the img tag to manipulate


    // array indices
    imgFilename = 0 ;
    imgWidth    = 1 ;
    imgHeight   = 2 ;
    imgComment  = 3 ;

    // current slide being viewed
    pickNum     = 0 ;


    numImages = imgArr.length ;

    // writes the image width
    function writeImgWidth () {
      document.write(imgArr[pickNum][imgWidth]) ;
    }

    // writes the image height
    function writeImgHeight () {
      document.write(imgArr[pickNum][imgHeight]) ;
    }

    // write out the path and filename to the chosen image
    function writeImgPathAndFilename () {
      document.write(imgBaseURL + imgArr[pickNum][imgFilename]) ;
    }

    // write out the chosen image's comment
    function writeImgComment () {
      document.write(imgArr[pickNum][imgComment]) ;
    }

    // write out the chosen image's comment
    function writeImgStatus () {
      window.status = imgArr[pickNum][imgComment] ;
    }


    // display next image in list in image tag named 'imgName'
    function nextSlideImage (imgName) {
      pickNum = (pickNum + 1) % numImages ;
      document.images[imgName].src = imgBaseURL + imgArr[pickNum][imgFilename] ;
      writeImgStatus () ;
    }

    // display previous image in list in image tag named 'imgName'
    function prevSlideImage (imgName) {
      pickNum = (pickNum + numImages - 1) % numImages ;
      document.images[imgName].src = imgBaseURL + imgArr[pickNum][imgFilename] ;
      writeImgStatus () ;
    }

    // set image tag named 'imgName' to randomly chosen image
    function pickSlideImage (imgName) {
      document.images[imgName].src = imgBaseURL + imgArr[pickNum][imgFilename] ;
    }

    // set image tag named 'imgName' to randomly chosen image
    function setSlideImage (newPick, imgName) {
      pickNum = newPick ;
      document.images[imgName].src = imgBaseURL + imgArr[newPick][imgFilename] ;
    }

