// GHSrandImage.js - Random image selection javascript
// Sets up the banner image used on a page

var GHSbannerImages = new Array() // banner images displayed with page


// file system path to image directory from HTML pages
var imagePath = 'images/photos/header/';

// To add more image files, continue with the
// pattern below.  Copy the last line, appended it to the bottom of the array
// list, increment the number and give replace the image file name in 
// the single quotes
//
// Note: each image should be exactly 900 by 275 pixels, otherwise it will not
// display on the page correctly
GHSbannerImages[0] = imagePath + 'AdvWomen_Dec2010-0.jpg';
GHSbannerImages[1] = imagePath + 'AdvWomen_drummer-1.jpg';
GHSbannerImages[2] = imagePath + 'AdvWomen2-2.jpg';
GHSbannerImages[3] = imagePath + 'AVE_Dec2010_2-3.jpg';
GHSbannerImages[4] = imagePath + 'AVE_Dec2010-4.jpg';
GHSbannerImages[5] = imagePath + 'AVE_Grinch_Dec2010-5.jpg';
GHSbannerImages[6] = imagePath + 'CC_Alumni_Dec2010_2-6.jpg';
GHSbannerImages[7] = imagePath + 'CC_Alumni_Dec2010-7.jpg';
GHSbannerImages[8] = imagePath + 'CC_Dec2010_2-8.jpg';
GHSbannerImages[9] = imagePath + 'CC_Dec2010-9.jpg';
GHSbannerImages[10] = imagePath + 'CC_SingALong_Dec2010-10.jpg';
GHSbannerImages[11] = imagePath + 'Chorale_Dec2010_2-11.jpg';
GHSbannerImages[12] = imagePath + 'Chorale_Dec2010-12.jpg';
GHSbannerImages[13] = imagePath + 'Chorale_MensChoir_Dec2010-13.jpg';
GHSbannerImages[14] = imagePath + 'Womens_Dec2010-14.jpg';





// Random image selection code follows (no need to change any of the following)
var i = 0
var j = 0
var p = GHSbannerImages.length;
var preBuffer = new Array()

for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = GHSbannerImages[i]
}

var whichImage = Math.round(Math.random()*(p-1));

function showRandImage(){
	document.write('<style type="text/css">');
	document.write('#header {background:url(' +GHSbannerImages[whichImage]+ ') no-repeat bottom left #fff; color:#505050; height:275px; margin:0 0 10px; padding:0;}');
	document.write('</style>'); 
}

// end


