var fi = 6;     // Number of alternative images
var petfood = new Array(fi);
var food = new Array(fi);
var filtration = new Array(fi);  // Array to hold filenames
var cheese = new Array(fi);
var pharmaceutical = new Array(fi);
var industrial = new Array(fi);
filtration[0] = "productshots/filtration/juices2.jpg";
filtration[1] = "productshots/filtration/beer2.jpg";
filtration[2] = "productshots/filtration/filtration2.jpg";
filtration[3] = "productshots/filtration/beer.jpg";
filtration[4] = "productshots/filtration/water.jpg";
filtration[5] = "productshots/filtration/metal.jpg";
industrial[0] = "productshots/industrial/friction2.jpg";
industrial[1] = "productshots/industrial/welding2.jpg";
industrial[2] = "productshots/industrial/tile2.jpg";
industrial[3] = "productshots/industrial/pipes2.jpg";
industrial[4] = "productshots/industrial/friction2.jpg";
industrial[5] = "productshots/industrial/welding2.jpg";
pharmaceutical[0] = "productshots/pharmaceutical/vitamins2.jpg"; 
pharmaceutical[1] = "productshots/pharmaceutical/pills2.jpg";
pharmaceutical[2] = "productshots/pharmaceutical/vitamins2.jpg"; 
pharmaceutical[3] = "productshots/pharmaceutical/pills2.jpg";
pharmaceutical[4] = "productshots/pharmaceutical/vitamins2.jpg"; 
pharmaceutical[5] = "productshots/pharmaceutical/pills2.jpg";
cheese[0] = "productshots/cheese/cheese2.jpg";
cheese[1] = "productshots/cheese/more_cheese2.jpg";
cheese[2] = "productshots/cheese/cheese2.jpg";
cheese[3] = "productshots/cheese/other_cheese2.jpg";
cheese[4] = "productshots/cheese/cheese2.jpg";
cheese[5] = "productshots/cheese/more_cheese2.jpg";
petfood[0] = "productshots/petfood/petfood2.jpg";
petfood[1] = "productshots/petfood/petfood2.jpg";
petfood[2] = "productshots/petfood/petfood2.jpg";
petfood[3] = "productshots/petfood/petfood2.jpg";
petfood[4] = "productshots/petfood/petfood2.jpg";
petfood[5] = "productshots/petfood/petfood2.jpg";
food[0] = "productshots/food/breakfastbar2.jpg";
food[1] = "productshots/food/cookie2.jpg";
food[2] = "productshots/food/fragiletorillas2.jpg";
food[3] = "productshots/food/sauces2.jpg";
food[4] = "productshots/food/breakfastbar2.jpg";
food[5] = "productshots/food/cookie2.jpg";

function pickRandom(range) {
	if (Math.random)
		return Math.round(Math.random() * (range-1));
	else {
		var now = new Date();
		return (now.getTime() / 1000) % range;
	}
}
var choice = pickRandom(fi);
