//LoadProdImg
//This file contains javascript needed to load a random image into an image
//on the HTML page.
//Requires: images are in the /images/products directory
//Requires: images are type jpg
//Requires: image will have a name of "RandProdImg" in HTML tag
//Requires: onload event to call setImg() function

//*****SET # OF IMAGES HERE *******//
//current number of images in images/products directory
var NUMIMGS = 5; 

//BROWSER VERSION 
var agt=navigator.userAgent.toLowerCase(); 
// Note: On IE5, these return 4, so use is_ie5up to detect IE5. 
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion); 
var is_ie   = (agt.indexOf("msie") != -1); 
var is_ie3  = (is_ie && (is_major < 4)); 
	
//get image set up
if (!is_ie3)
	{
	var x = Math.round((Math.random() * 10)) % NUMIMGS;
	var ProdImg = new Image();
	ProdImg.src = "../html/images/products/" + x + ".jpg";
	}

//load image into page, based on random number
//called onload
function setImg()
{
if (!is_ie3)
	document.images.RandProdImg.src = ProdImg.src;
		
}

