////  begin random images

//  how many images?
var arrayLength = 5

var showninLabel = "shown in"
var photoCreditDef = "John Wells"

//  not using preload array cuz we don't need to waste the time
var image0 = 'images/left/left_image01.jpg'
var image1 = 'images/left/left_image02.jpg'
var image2 = 'images/left/left_image03.jpg'
var image3 = 'images/left/left_image04.jpg'
var image4 = 'images/left/left_image06.jpg'
//  Christmas
//var image5 = 'images/left_image05.jpg'

//  image colors
var color0 = 'white black/cognac'
var color1 = 'white blue/green'
var color2 = 'white black/cognac, black cognac, and white'
var color3 = 'saffron'
var color4 = 'custom blue, green with black'
//  Christmas
//var color5 = 'Xmas'

//  extra image only on Our Candles, not in rotation
var image99 = "images/left/jp_2227_06flame-380.jpg"
var color99 = "green"

var photoCredit0 = "John Wells"
var photoCredit1 = "John Wells"
var photoCredit2 = "John Wells"
var photoCredit3 = "John Wells"
var photoCredit4 = "John Wells"
//var photoCredit5 = "John Wells"
var photoCredit99 = "Richard Bachmann, NYC"

//  set up random number seeds
rnd.today = new Date()
rnd.seed = rnd.today.getTime()

//  return random base for making random number
function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280
        return rnd.seed/(233280.0)
};

//  build the real random integer
var rand = (Math.ceil(rnd()*arrayLength) - 1)

if (cat == 1)
	rand = 99

//  function that gets called from onload
//  sets the image src from the image array
function randomImage() {
	document.random_image.src = eval('image' + rand)

	var showninWells = document.getElementById("showninWells")
	//var color = eval("color" + rand)
	showninWells.innerHTML = showninLabel + " " + eval("color" + rand)
	
	var photoCredit = eval("photoCredit" + rand)
	document.getElementById("photoCredit").innerHTML = photoCredit || photoCreditDef
}

////  end random images
