//Random Image set

function randomImage(){
	holder = placeholders.shift();
		
	image = holder[1].shift(); //rotate images
	if(document.getElementById('random_'+holder[0])){
		document.getElementById('random_'+holder[0]).src = "images/homepage_images/"+image[1]+"";
		document.getElementById('random_'+holder[0]).title = ""+image[0];
	}
	holder[1].push(image);
				
	placeholders.push(holder);
}

var imagesA = [];
var imagesB = [];
var imagesC = [];
var imagesD = [];
//images[i] = array(ALT TEXT, IMAGE FILENAME);
imagesB.push(["Anderson Hall",'AndersonHall.jpg']);
imagesA.push(["Alaskan-Yukon Pacific Exposition Forestry Building",'AYPEforestrybldg.jpg']);
imagesA.push(["Alaskan-Yukon Pacific Exposition Forestry Building",'AYPEforestrybldg2.jpg']);
imagesD.push(["Bunch Berry",'bunchberry.jpg']);
imagesA.push(["Choke Setters D, Kinsey 1728",'chokesettersD_Kinsey1728.jpg']);
imagesB.push(["Drumheller Fountain",'drumheller.jpg']);
imagesB.push(["Union Bay Natural Area",'floatingbridge_ubna.jpg']);
imagesA.push(["Forest Products Lab, circa 1940",'forestproductslab.jpg']);
imagesA.push(["Forestry Students, circa 1910",'forestryclass.jpg']);
imagesA.push(["Forestry Field Lecture, circa 1940",'forestryfieldlecture.jpg']);
imagesA.push(["Forestry Library, 1948",'forestrylibrary.jpg']);
imagesA.push(["Forestry Professor and Students, 1946",'forestryprof_students.jpg']);
imagesC.push(["Forest Soil Field Trip",'forestsoilsclass.jpg']);
imagesA.push(["Garb Day, 1964",'garbday1964.jpg']);
imagesD.push(["Glacier Lilies in the Cascades",'Glacier_Lily.jpg']);
imagesB.push(["Hyde Herbarium Volunteer",'herbariumvolunteer.jpg']);
imagesC.push(["Stand Management Cooperative Log Quality Research",'loqqualitySMC.jpg']);
imagesA.push(["Mock Campsite in Front of Anderson Hall, 1925",'mockcampsiteAndHall.jpg']);
imagesD.push(["Mountain Goat, Olympic Natural Park",'mountaingoat.jpg']);
imagesD.push(["Mountain Reflection",'mountainreflection.jpg']);
imagesD.push(["Mt. Rainier",'mtrainier.jpg']);
imagesC.push(["Nature Mapping",'naturemapping.jpg']);
imagesA.push(["Pack Experimental Forest, 1940",'packforest1940.jpg']);
imagesD.push(["Pack Forest Mushrooms",'packforestmushrooms.jpg']);
imagesD.push(["Plant Collections in China",'plantcollecting.jpg']);
imagesD.push(["Sea Holly, Soest Garden",'seaholly.jpg']);
imagesB.push(["Seattle Sunset",'seattleurban.jpg']);
imagesC.push(["Sediment Sampling",'sedimentsampling.jpg']);
imagesB.push(["Soest Garden",'SoestGarden.jpg']);
imagesC.push(["Stream Research",'streamresearch.jpg']);
imagesC.push(["Stream Sampling",'streamsampling.jpg']);
imagesC.push(["Bioresource Science and Engineering Lab",'student_PSElab.jpg']);
imagesC.push(["Students, Cascades Field Trip",'studentfieldtrip1.jpg']);
imagesC.push(["Sustainable Forest Management Field Trip",'studentfieldtrip2.jpg']);
imagesC.push(["ESRM Field Trip",'studentfieldtrip3.jpg']);
imagesC.push(["Wind River Canopy Crane",'studentsatWRCCRF.jpg']);
imagesC.push(["Students, UW Botanic Gardens",'studentsUWBG.jpg']);
imagesD.push(["Sunbeam through Trees",'Sunbeam_Tree.jpg']);
imagesD.push(["Taos Creek Falls",'taoscreekfalls.jpg']);
imagesB.push(["Washington Weekend Tree Planting",'UBNAtreeplanting.jpg']);
imagesB.push(["Urban Trees",'urbantrees.jpg']);
imagesD.push(["Wildlife, Elk Herd",'wildlife.jpg']);
imagesC.push(["Wildlife Science, Raven Research",'wildlifestudent_raven.jpg']);
imagesB.push(["Winkerwerder Bench",'winkenwerderbench.jpg']);
imagesB.push(["Washington Park Arboretum Guide Training",'WPAguidetraining.jpg']);

//Randomizing individual set of images
shuffle(imagesA);
shuffle(imagesB);
shuffle(imagesC);
shuffle(imagesD);

var placeholders = [];
placeholders.push(['A',imagesA]);
placeholders.push(['B',imagesB]);
placeholders.push(['C',imagesC]);
placeholders.push(['D',imagesD]);

function shuffle( array ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // *     example 1: shuffle(['Kevin', 'van', 'Zonneveld']);
    // *     returns 1: true
 
    for(var j, x, i = array.length; i; j = parseInt(Math.random() * i), x = array[--i], array[i] = array[j], array[j] = x);
    return true;
}



