// Hold all image info in this array
var imageArray = new Array();
imageArray[0] = "tsunami.gif";
imageArray[1] = "breather.jpg";
imageArray[2] = "cloaking.jpg";
imageArray[3] = "thetafun.png";

var captionArray = new Array();
captionArray[0] = "Modeling the 2004 Indian Ocean tsunami using adaptive finite volume methods";
captionArray[1] = "A periodic breather solution in a mode-locked laser system";
captionArray[2] = "Acoustic pressure for the cloaking of a ball";
captionArray[3] = "The real part of a 2-phase Riemann theta function";


var attributeArray = new Array();
attributeArray[0] = "(Courtesy of Randy LeVeque)";
attributeArray[1] = "(Courtesy of J. Nathan Kutz)";
attributeArray[2] = "(Courtesy of Ulrich Hetmaniuk)";
attributeArray[3] = "(Courtesy of Bernard Deconinck)";


var linkArray = new Array();
linkArray[0] = "http://www.amath.washington.edu/research/LeVeque/";
linkArray[1] = "http://www.amath.washington.edu/research/Kutz/";
linkArray[2] = "http://www.amath.washington.edu/research/Hetmaniuk/";
linkArray[3] = "http://www.amath.washington.edu/research/Deconinck/";

var randval = Math.floor(Math.random()*4);

function randomImage()
 {

     var rand = Math.floor(Math.random() * 4);
     var imgPath = "<img src='features/rotate/pics/" + imageArray[rand] + "' width='256px'  alt='" + captionArray[rand] +"'/>";

     var captionPath = captionArray[rand] + " <a href='" + linkArray[rand] + "'>" + attributeArray[rand] + "</a>";

     document.getElementById("image").innerHTML = imgPath;
     document.getElementById("caption").innerHTML = captionPath;
}



