// JavaScript Document
<!--
// call function randomImage(path,iname,ext,inum) to return a random image selected from a set of sequentially numbered images
// path is path to image file folder
// iname is image name (no extension)
// ext is the file extension (without . )
// inum = number of images in sequence

function randomImage(path,iname,ext,inum) {
	var currentdate = 0;
	var rnum = 0;
	var imagenum = parseInt(inum);
	var divisor = 60/imagenum;
	var imagenames = new Array(imagenum);
	for (var i =1; i <= imagenum; i++) {
		n = i-1;
		imagenames[n] = path + iname + String(i) + "." + ext;
  	}
  	currentdate = new Date();
  	rnum = currentdate.getSeconds();
  	rnum = Math.floor(rnum/divisor);
 	return(imagenames[rnum]);
}
//-->