// Change stock count to number of images
// images are named: home-001.jpg, home-002.jpg, etc

var stock_count = 14;


var isi_slide;
var curr_isi_img = 1;

function live_image() {
	curr_isi_img = curr_isi_img + 1;
	if (curr_isi_img > stock_count) {
		curr_isi_img = 1;
	}

	//rnd.today=new Date();
	//rnd.seed=rnd.today.getTime();

	function rnd() {
		rnd.seed = (rnd.seed*9301+49297) % 233280;
		return rnd.seed/(233280.0);
	};

	function rand(number) {
		var result = Math.ceil(rnd()*number);
		if (!result)result++;
			return result
	};

	var ad1 = curr_isi_img; //rand(stock_count);
	var isi_stock;
	
	ad1 = "000" + String(ad1);
	ad1 = ad1.substring(ad1.length - 3, ad1.length);

	document.getElementById("lcd").innerHTML = "<img src='images/home-" + ad1 + ".jpg' height='340' width='496' alt='Idaho Stock Image' />";

	isi_slide = setTimeout("live_image();",4000);
}

var film_roll = "";

for (j=1;j<stock_count+1;j++) {
	exposure = "000" + String(j);
	exposure = exposure.substring(exposure.length - 3, exposure.length);
	film_roll = film_roll + "<img src='images/home-" + exposure + ".jpg' height='340' width='496' alt='Idaho Stock Image' />";
}
function pre_load() { document.getElementById("on_deck").innerHTML = film_roll; }
