var phototimeout_delay = 3000; // milliseconds
currentphoto = 0;
var photos = new Array(3);
photos[0] = "images/Guide Mary (R) describes the Victorian garden.jpg";
photos[1] = "images/Exploring the Medieval garden.jpg";
photos[2] = "images/follow-my-leader in the grass!.jpg";

var titles = new Array(3);
titles[0] = "1/3 Guide Mary (R) describes the Victorian garden";
titles[1] = "2/3 Exploring the Medieval garden";
titles[2] = "3/3 follow-my-leader in the grass!";

function nextphoto() {
if (++currentphoto > photos.length-1) {
  currentphoto = 0;
}
  document.images.photoshow.src = photos[currentphoto];
  document.getElementById('phototitle').innerHTML = titles[currentphoto];
}

function previousphoto() {

currentphoto = currentphoto -1;

if (currentphoto < 0) {
  currentphoto = photos.length-1
}
  document.images.photoshow.src = photos[currentphoto];
  document.getElementById('phototitle').innerHTML = titles[currentphoto];
}

function startstopphoto() {
var text=document.getElementById('photosbutton').innerHTML
document.getElementById('photosbutton').innerHTML = (text == "Stop") ? "Start" : "Stop";
phototimeout();
}


function phototimeout() {
if (document.getElementById('photosbutton').innerHTML == "Stop") {
  nextphoto();
  window.setTimeout("phototimeout()", phototimeout_delay);
}
}


