var images = new Array();
var caption = new Array();


images[0] = "main_images/meghan1.jpg";
images[1] = "main_images/AD-India.JPG";
images[2] = "main_images/isomopening.jpg";
images[3] = "main_images/melody.JPG";
images[4] = "main_images/shaheen.jpg";
images[5] = "main_images/Stat-1.jpg";
images[6] = "main_images/Stat-2.jpg";
images[7] = "main_images/grant-taskforce.jpg";


caption[0] = "Photo credit: Jamie Johnson";
caption[1] = "Adventure Divas try on Indian sarees";
caption[2] = "Photo credit: UM Photo Services";
caption[3] = "Photo credit: Jamie Johnson";
caption[4] = "";
caption[5] = "Source: Mississippi IHL Enrollment Statistics 2008-2009";
caption[6] = "Source: Sansing, David G., The University of Mississippi: A Sesquicentennial History";
caption[7] = "Logo taken from US Department of Justice's Office of Violence Against Women";


function ShowImg() {
var number = images.length;
increment = Math.floor(Math.random() * number);
var strTemp ='<img src="' + images[increment] + '" alt="' + caption[increment] +'">';
document.write(strTemp);

}
function ShowCap() {
var text_cap = '<div style="font-size:.7em; margin:0 20px 0 20px;">' + caption[increment] + '</div>';
document.write(text_cap);
}

var rotate = 5000; 
var count = 0;

function RotateImg(myImage){
 myImage.src=images[count];
 count++;
 if(count==images.length){count = 0;}
 setTimeout("RotateImg(myImage)",rotate);
} 
