/*
  Code adapted by M. Galloway on 5/22/2008 from the following website.
  http://www.code-sucks.com/code/javascript/template.php?tutorial=auto_rotating_slide_show.php
*/

var images = new Array();
//var signimages = new Array('s1.gif','s2.gif','s3.gif','s4.gif','s5.gif','s6.gif','s7.gif','s8.gif');
var signimages = new Array('s1.gif','s2.gif','s3.gif','s4.gif','s5.gif','s6.gif');
var helloimages = new Array('h2.gif','h1.gif','h3.gif','h4.gif');
var nameimages = new Array('m4.gif','m1.gif','m2.gif','m3.gif');

function choosearray(thechoice) {
 var whicharray = thechoice;
 if (whicharray.match("sign")) { images = signimages; }
 if (whicharray.match("hello")) { images = helloimages; }
 if (whicharray.match("name")) { images = nameimages; }
}

var count = -1;

function slideShow(){

  if (count <images.length-1){
    ++count;
  }
  else {
    count = 0;
  }
  
  document.getElementById("show").innerHTML = "<img src=\"images/"+images[count]+"\" />";
  //reinvokes this fuction, auto-looping it, and also setting a period of time between each new slide/image
  setTimeout("slideShow()", 1500);

}

function slideShowCaptions(){
// relies on var count in slideShow function
// also requires var count to be declared outside of that function, so global in scope
  stepnum = count + 1;

  document.getElementById("tell").innerHTML = "Step "+stepnum;
  //reinvokes this fuction, auto-looping it, and also setting a period of time between each new slide/image caption
  setTimeout("slideShowCaptions()", 1500);
}





