/* 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;

imgArray = [
  ['1.png'],
  ['2.png'],
  ['3.png'],
  ['4.png']
]

function sleep(delay) {
        var start = new Date().getTime();
        while (new Date().getTime() < start + delay);
      }

function slideshow(slide_num) {
  document.getElementById('mypic').src="gallery/"+imgArray[slide_num][0];    
}

function slideshowUp() {
  num++;
  num = num % imgArray.length;
  if(num==0)
	sleep(8000);
  slideshow(num);
}

function slideshowBack() {
  num--;
  if (num < 0) {num=imgArray.length-1;}
  num = num % imgArray.length;
  slideshow(num);
}
