// Each of these arrays represents a set of images to make a random
// choice from for ONE of the sections/positions.

var homeTop = new Array();
var homeMiddle = new Array();
var homeBottom = new Array();


// Fill in the image paths, following the pattern shown here. I have
// put two sample image paths in each array. The first item in any
// array is 0, the next is 1 ... on to add as many items per array as
// you need. Note that paths will be interpreted relative to the
// location of the page which loads this javascript.

homeTop[0] = 'images/random/bucket1/ceepr_bkt_1_v1.jpg';
homeTop[1] = 'images/random/bucket1/ceepr_bkt_1_v2.jpg';
homeTop[2] = 'images/random/bucket1/ceepr_bkt_1_v3.jpg';
homeTop[3] = 'images/random/bucket1/ceepr_bkt_1_v4.jpg';
homeTop[4] = 'images/random/bucket1/ceepr_bkt_1_v5.jpg';
homeTop[5] = 'images/random/bucket1/ceepr_bkt_1_v6.jpg';
homeTop[6] = 'images/random/bucket1/ceepr_bkt_1_v7.jpg';
homeTop[7] = 'images/random/bucket1/ceepr_bkt_1_v8.jpg';
homeTop[8] = 'images/random/bucket1/ceepr_bkt_1_v9.jpg';
homeTop[9] = 'images/random/bucket1/ceepr_bkt_1_v10.jpg';
homeTop[10] = 'images/random/bucket1/ceepr_bkt_1_v11.jpg';
homeTop[11] = 'images/random/bucket1/ceepr_bkt_1_v12.jpg';
homeTop[12] = 'images/random/bucket1/ceepr_bkt_1_v13.jpg';
homeTop[13] = 'images/random/bucket1/ceepr_bkt_1_v14.jpg';
homeTop[14] = 'images/random/bucket1/ceepr_bkt_1_v15.jpg';
homeTop[15] = 'images/random/bucket1/ceepr_bkt_1_v16.jpg';
homeTop[16] = 'images/random/bucket1/ceepr_bkt_1_v17.jpg';
homeTop[17] = 'images/random/bucket1/ceepr_bkt_1_v18.jpg';
homeTop[18] = 'images/random/bucket1/ceepr_bkt_1_v19.jpg';
homeTop[19] = 'images/random/bucket1/ceepr_bkt_1_v20.jpg';
homeTop[20] = 'images/random/bucket1/ceepr_bkt_1_v21.jpg';
homeTop[21] = 'images/random/bucket1/ceepr_bkt_1_v22.jpg';

homeMiddle[0] = 'images/random/bucket2/ceepr_bkt_2_v1.jpg';
homeMiddle[1] = 'images/random/bucket2/ceepr_bkt_2_v2.jpg';
homeMiddle[2] = 'images/random/bucket2/ceepr_bkt_2_v3.jpg';
homeMiddle[3] = 'images/random/bucket2/ceepr_bkt_2_v4.jpg';
homeMiddle[4] = 'images/random/bucket2/ceepr_bkt_2_v5.jpg';
homeMiddle[5] = 'images/random/bucket2/ceepr_bkt_2_v6.jpg';
homeMiddle[6] = 'images/random/bucket2/ceepr_bkt_2_v7.jpg';
homeMiddle[7] = 'images/random/bucket2/ceepr_bkt_2_v8.jpg';
homeMiddle[8] = 'images/random/bucket2/ceepr_bkt_2_v9.jpg';
homeMiddle[9] = 'images/random/bucket2/ceepr_bkt_2_v10.jpg';
homeMiddle[10] = 'images/random/bucket2/ceepr_bkt_2_v11.jpg';
homeMiddle[11] = 'images/random/bucket2/ceepr_bkt_2_v12.jpg';

homeBottom[0] = 'images/random/bucket3/ceepr_bkt_3_v1.jpg';
homeBottom[1] = 'images/random/bucket3/ceepr_bkt_3_v2.jpg';
homeBottom[2] = 'images/random/bucket3/ceepr_bkt_3_v3.jpg';
homeBottom[3] = 'images/random/bucket3/ceepr_bkt_3_v4.jpg';
homeBottom[4] = 'images/random/bucket3/ceepr_bkt_3_v5.jpg';
homeBottom[5] = 'images/random/bucket3/ceepr_bkt_3_v6.jpg';
homeBottom[6] = 'images/random/bucket3/ceepr_bkt_3_v7.jpg';


var a1 = homeTop.length;
var a2 = homeMiddle.length;
var a3 = homeBottom.length;


// This commented-out code is to preload images. The original function
// had it. Frankly, I think loading all these images when you're only
// going to show the user one or two of them is silly, so I've left it
// out. If we put it back in, we will need to make multiple copies of it,
// just like with everything else here.
//
// var preloada1 = new Array();
// for (i = 0; i < a1; i++){
//    preloada1[i] = new Image()
//    preloada1[i].src = imgsHomeTop[i]
// }


// Each of these functions will need its own height and width
// setting, as applicable (and maybe an alt tag). The name tells you which set of images is
// involved. Call the correct one(s) as needed for that page in its onLoad property.

function showHomeTop(){
var whichImage = Math.round(Math.random() * (a1 - 1));
document.write('<img src="' + homeTop[whichImage] + '" width=121 height=121 class=paddingHomePhoto /><br />');
}

function showHomeMiddle(){
var whichImage = Math.round(Math.random() * (a2 - 1));
document.write('<img src="' + homeMiddle[whichImage] + '" width=121 height=121 class=paddingHomePhoto /><br />');
}

function showHomeBottom(){
var whichImage = Math.round(Math.random() * (a3 - 1));
document.write('<img src="' + homeBottom[whichImage] + '" width=121 height=121  class=paddingHomePhoto />');
}
