
// for rotating images
var photoLibrary = new Array();
photoLibrary[0] = "images/spirit_001.jpg";
photoLibrary[1] = "images/spirit_002.jpg";
photoLibrary[2] = "images/spirit_003.jpg";
photoLibrary[3] = "images/spirit_004.jpg";
photoLibrary[4] = "images/spirit_005.jpg";
photoLibrary[5] = "images/spirit_006.jpg";
photoLibrary[6] = "images/spirit_007.jpg";
photoLibrary[7] = "images/spirit_008.jpg";
photoLibrary[8] = "images/spirit_009.jpg";
photoLibrary[9] = "images/spirit_010.jpg";

// randomly select first image
var currentPhotoLibraryImage = Math.floor(Math.random()*9);

// change photo to next photo in library
function rotatePhotoLibrary() {
// increment photo index by 1 for next image
currentPhotoLibraryImage++;
// check to see if photo index is past library length
if (currentPhotoLibraryImage >= photoLibrary.length) {
// past library length, so go to beginning of library
currentPhotoLibraryImage = 0;
}
// replace the photos
document.getElementById("i_rotate").src = photoLibrary[currentPhotoLibraryImage];
}

// assign image source on page load
// window.onload = function () {
// rotatePhotoLibrary();
// return;
// }