﻿
/*  assuming a series of 20 images named pic0.jpg through pic19.jpg.
    variable to indicate number of pictures to be sequenced. */

var numpics = 20;
if (document.images) {
     var pics = new Array();
     for(i = 0; i < numpics; i++) {
             pics[i] = new Image();
             pics[i].src = "images/pic" + i + ".jpg";
     }
}

/*  variable to set sequence rate (unit is milliseconds)  */
var rotatedelay = 60000;

/* variable to keep track of current picture being displayed. */
var currentpic = 1;

/* rotate function that rotates images named "swap" randomly on the web page */
function rotatepic() {
	    currentpic = Math.round(Math.random() * (numpics - 1));
        document.swap.src=pics[currentpic].src;
        setTimeout('rotatepic()', rotatedelay);
}

