var num=0;

imgArray = [
  ['images/deflection/deflection1.jpg','Image1alt', 'Untitled, 2006 '],
  ['images/deflection/deflection2.jpg','Image2alt','Untitled, 2006 '],
  ['images/deflection/deflection3.jpg','Image3alt','Untitled, 2006 '],
  ['images/deflection/deflection4.jpg','Image4alt','Untitled, 2006 ']
]

function slideshow(slide_num) {
  document.getElementById('image').src=imgArray[slide_num][0];
  document.getElementById('image').alt=imgArray[slide_num][1];
  document.getElementById('text').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);
}
