// JavaScript Document
//choose a photo at random for the technology classrooms page
//from the technologyclassroom_photos folder

//if you delete photos from the folder, you must renumber
//the images so they are numbered consecutively from 1 up

//if you add photos, they must be named like this: 1.jpg, 2.jpg, 3.jpg, etc.
//if there are seven photos in the folder and you add a new one, you must
//name it 8.jpg and change the variable "maxphoto" in this script to 8.

//VERY IMPORTANT: The variable "maxphoto" must equal the number of photos
//in the technologyclassroom_photos folder. If this variable is larger than
//the number of photos, sometimes no photo will load. If this variable is
//smaller, the higher-numbered photos will never be chosen.





var maxphoto=1; 
//Tells the script how many photos are in the photo folder.





var folder="training_photos";
//defines the name of the folder where
//the photos are located.








//pick the image to display at random
maxphoto++;
var r=Math.floor(Math.random()*maxphoto);
maxphoto--;
if (r < 1)
{
	r = 1;
}
if (r > maxphoto)
{
	r = maxphoto;
}

//write the beginning of the img tag
document.write("<img src='");
document.write(folder);
document.write("/");

//Write the number of the image to be used
document.write(r);

//write the end of the img tag
document.write(".jpg' width='300px' />");