  // Set up the image files to be used.
  var theImages = new Array() 
  var theLinks = new Array()

  // To add more image files, continue with the pattern below, adding to the array.
  // Several additional image files are located in the rotation/ directory.

  theImages[0] = 'images/rotation/sampleImage1.jpg'
  theLinks[0] = 'http://www.abc.com/'

  theImages[1] = 'images/rotation/sampleImage2.jpg'
  theLinks[1] = 'http://www.nbc.com/'

  theImages[2] = 'images/rotation/sampleImage3.jpg'
  theLinks[2] = 'http://www.nbc.com/'


function showImage() {
  var j = 0;
  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('<a href="'+theLinks[whichImage]+'" >')
  document.write('<img src="'+theImages[whichImage]+'" height="130" width="750" style="display: block; clear: both;" alt="Sample Images" title="Sample Images" /> </a>');
}

function showImage2()  {
  if(!document.getElementById) return false;

  var imageTotal = theImages.length;

  var currentTime = new Date()
  var timeSeed = currentTime.getTime();
  var randomKey = Math.round(Math.random(timeSeed)*(imageTotal-1));

  document.getElementById("randomImage").src = theImages[randomKey];
  document.getElementById("imageLink").href = theLinks[randomKey];
}
