
// Array push() Function
Array.prototype.push=function()
{
	var i=0;
	b=this.length,a=arguments;
	for(i;i<a.length;i++)this[b+i]=a[i];
	return this.length
}
//  Begin Varibale Declarations
var url = document.URL;
var photos = new Array(3); //  Array fo Photos
photos[0] = new Array(); //  Outdoor Photos
photos[1] = new Array(); //  Indoor Photos
photos[2] = new Array(); //  Generic Photos
alt = new Array();  // ALT Tags for Photos

var maxLength=0; //  Number of Photos Per Catagory
var cat=0;		 //  Catagory to be Displayed
var ranNum1=0;  //  First Random Number


// ==================== DO NOT EDIT ABOVE THIS LINE ==========================

/*
								+INSTRUCTIONS+

Category 0 contains pictures for: Outdoor Photos
Category 1 contains pictures for: Indoor Photos
Category 2 contains pictures for: Generic Photos


To add a new picture to the list type "photos[category number].push(“file name”);" 
in the appropriate section below.

EXAMPLE: photos[0].push("pic1.jpg"); Adds the file pic1.jpg in to the Outdoor Photos category (category 0)

NOTE: All images that apply to more than one category must be entered 
      individually in each applicable section below.


								+END INSTRUCTIONS+
*/

//  Defines the Outdoor Photos
photos[0].push("0.jpg");
photos[0].push("10.jpg");
photos[0].push("11.jpg");
photos[0].push("12.jpg");
photos[0].push("13.jpg");
photos[0].push("14.jpg");
photos[0].push("15.jpg");
photos[0].push("16.jpg");
photos[0].push("19.jpg");
photos[0].push("2.jpg");
photos[0].push("16.jpg");
photos[0].push("23.jpg");
photos[0].push("24.jpg");
photos[0].push("4.jpg");
photos[0].push("6.jpg");
photos[0].push("7.jpg");
photos[0].push("8.jpg");
photos[0].push("8.jpg");


//  Defines the Indoor Photos
photos[1].push("1.jpg");
photos[1].push("17.jpg");
photos[1].push("20.jpg");
photos[1].push("21.jpg");
photos[1].push("22.jpg");
photos[1].push("25.jpg");
photos[1].push("3.jpg");



// Defines the Generic Photos
photos[2].push("0.jpg");
photos[2].push("1.jpg");
photos[2].push("2.jpg");
photos[2].push("3.jpg");
photos[2].push("4.jpg");
photos[2].push("5.jpg");
photos[2].push("6.jpg");
photos[2].push("7.jpg");
photos[2].push("8.jpg");
photos[2].push("9.jpg");
photos[2].push("10.jpg");
photos[2].push("11.jpg");
photos[2].push("12.jpg");
photos[2].push("13.jpg");
photos[2].push("14.jpg");
photos[2].push("15.jpg");
photos[2].push("16.jpg");
photos[2].push("17.jpg");
photos[2].push("18.jpg");
photos[2].push("19.jpg");
photos[2].push("20.jpg");
photos[2].push("21.jpg");
photos[2].push("22.jpg");
photos[2].push("23.jpg");
photos[2].push("24.jpg");
photos[2].push("25.jpg");


alt[0]="Students Hiking";
alt[1]="Step Aerobics";
alt[2]="Students Packing";
alt[3]="Students Playing Pool";
alt[4]="Students Camping";
alt[5]="Happy Campus Rec-ers";
alt[6]="Student Horseback Riding";
alt[7]="Students Horseback Riding";
alt[8]="Student Jumping";
alt[9]="Students";
alt[10]="Students";
alt[11]="Students";
alt[12]="Human Chain";
alt[13]="Students";
alt[14]="Students Rappelling";
alt[15]="Students";
alt[16]="Students";
alt[17]="Pilates";
alt[18]="Camping Equipment";
alt[19]="Happy Student Campers";
alt[20]="Swimming Pool";
alt[21]="Swimming Pool";
alt[22]="Happy Campus Rec-ers";
alt[23]="Student Rock Climbing";
alt[24]="Student Rappelling";
alt[25]="Student Lifting Weights";

// ==================== DO NOT EDIT BELOW THIS LINE ==========================
	//document.write(url+"<br>")
if (url.indexOf('.html')==-1)
{
	url+="index.html";
	//document.write(url);
}


//  Get selected directory array size
if (url.indexOf('outdoor.html')!=-1)
{
	maxLength = photos[0].length-1;
	randomize(maxLength, 0);
}
else if(url.indexOf('/union/index.html')!=-1 || url.indexOf('locker.html')!=-1)
{
	maxLength = photos[1].length-1;
	randomize(maxLength, 1);
}
else 
{
	maxLength = photos[2].length-1;
	randomize(maxLength, 2);
}


function randomize(maxLength, cat)
{
	ranNum1= Math.round(Math.random()*maxLength);
	display(cat);
}

function display(cat)
{
document.write('<img src="/crec/images/photos/random/'+photos[cat][ranNum1]+'"  alt="Photo of '+ alt[ranNum1] +'" vpsace="8" hspace="8" align="right">');

}
