// JavaScript Document

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
function showImage(){
  // Set up the image files to be used.
  var theImages = new Array();
  var theCaptions = new Array ();
  
  theImages[0] = '/cs/img/front-page-images/142-classroom.jpg';
  theCaptions[0] = "A group of students hard at work in the CS department's main teaching classroom";
  theImages[1] = '/cs/img/front-page-images/GHC-2006.jpg';
  theCaptions[1] = 'Four Hope CS students enjoy a meal at the 2006 Grace Hopper Celebration of Women in Computing';

  var p = theImages.length;
  var preBuffer = new Array();
  for (i = 0; i < p; i++){
    preBuffer[i] = new Image();
    preBuffer[i].src = theImages[i];
  }
  var whichImage = Math.round(Math.random()*(p-1));
  document.write('<p style="text-align:center; font-size: smaller"><img src="'+theImages[whichImage]+'">');
  document.write('<br clear="left">' + theCaptions[whichImage] + '</p>');
}
