<!-- Paste this code into an external JavaScript file named: simpleImageGallery.js  -->

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Jay M. Rumsey, OD :: http://www.nova.edu/~rumsey
 */

var num=0;

//format: src, alt, text
imgArray = [
  ['userfiles/image/sandCave2.jpg','photo from inside Sand Cave', '<b>From Inside Sand Cave</b>'],
  ['userfiles/image/bikingCacheRiver.jpg','photo of Cache River bike path','<b>Biking the Cache River Trail</b>'],
  ['userfiles/image/bargeBridge2.jpg','photo of barge passing beneath bridge','<b>River Traffic</b>'],
  ['userfiles/image/slaveHouse.jpg','photo of the Old Slave House','<b>The Old Slave House</b>']
]

function slideshow(slide_num) {
  document.getElementById('homeImg').src=imgArray[slide_num][0];
  document.getElementById('homeImg').alt=imgArray[slide_num][1];
  document.getElementById('caption').innerHTML=imgArray[slide_num][2];
}

function slideshowUp() {
  num++;
  num = num % imgArray.length;
  slideshow(num);
}

function slideshowBack() {
  num--;
  if (num < 0) {num=imgArray.length-1;}
  num = num % imgArray.length;
  slideshow(num);
}