<!--

/* Random Image .js file
 *
 * This file stores pic info for possible header pics, and selects a single pic to use.
 * Chosen pic is put in as 'headerPic' var and 'headerPicAlt' to be used in main page.
 *
 * Most images are 778 x 200, and layout works best when using similar multiples.
 *
 */

// Setup
var i = 0 ;
var path = "images/header/" ;

// List of possible pics
var picArr = new Array();
picArr[0] = "images/header/bkGnd_crystalGarden.jpg" ;
picArr[1] = "images/header/bkGnd_caveMountain.jpg" ;
picArr[2] = "images/header/bkGnd_landBridge.jpg" ;
picArr[3] = "images/header/bkGnd_passage03.jpg" ;
picArr[4] = "images/header/bkGnd_sodaColumns.jpg" ;
picArr[5] = "images/header/bkGnd_teeth.jpg" ;
picArr[6] = "images/header/bkGnd_oldFlow.jpg" ;
picArr[7] = "images/header/bkGnd_passage02.jpg" ;
picArr[8] = "images/header/bkGnd_passage05.jpg" ;


var numPics = picArr.length ;

//alt text (<img alt="this" ... />)
var altArr = new Array() ;
altArr[0] = "Anthodites in Skyline Caverns, VA" ;
altArr[1] = "Looking out of Cave Mountain cave" ;
altArr[2] = "Natural bridge at Arch Spring, Blair County, PA" ;
altArr[3] = "Fossil Avenue (new discovery section) in Mammoth Cave" ;
altArr[4] = "Cumberland Caverns, TN" ;
altArr[5] = "Stalactites resembling white teeth in Ohio Caverns" ;
altArr[6] = "Anastomosis channels in Lee Cave, KY" ;
altArr[7] = "Roux room, Overholt Blowing Cave, WV" ;
altArr[8] = "Fossil Avenue (new discovery section) in Mammoth Cave" ;


//pic weight: choose some more than others. 1 is normal, 5 is high, 0 is never
var picWeightArr = new Array();
picWeightArr[0] = 2 ; 
picWeightArr[1] = 1 ; 
picWeightArr[2] = 1 ; 
picWeightArr[3] = 2 ; 
picWeightArr[4] = 1 ; 
picWeightArr[5] = 1 ; 
picWeightArr[6] = 3 ; 
picWeightArr[7] = 1 ; 
picWeightArr[8] = 1 ; 


//calculate random weighted value
var weightArr = new Array() ;
for ( i=0; i<numPics; i++ ) 
{
	if ( picWeightArr[i] == 1 ) 
	{
		weightArr.push(i) ;
	}
	else 
	{
		for ( var j=0; j<picWeightArr[i]; j++ ) 
		{
			weightArr.push(i) ;
		}
	}
}
var chosenWeighted = Math.floor ( Math.random() * weightArr.length ) ;
var chosenPic = weightArr[chosenWeighted] ;

//declare final selections
headerPic = picArr[chosenPic] ;
headerAltText = altArr[chosenPic] ;

//-->

