// JavaScript Document
var timeout = 3000; //timeout is in milliseconds - eg. 5000 = 5 seconds.
var dimages=new Array();
var dlinks=new Array();

function swapPicture()
{
  if (document.images)
  {
    var nextImage=curImage+1;
    if (nextImage>=numImages)
      nextImage=0;
    if (dimages[nextImage] && dimages[nextImage].complete)
    {
      var target=0;
      if (document.images.myImage)
        target=document.images.myImage;
      if (document.all && document.getElementById("myImage"))
        target=document.getElementById("myImage");
  
      // make sure target is valid.  It might not be valid
      //   if the page has not finished loading
      if (target)
      {
        target.src=dimages[nextImage].src;
        curImage=nextImage;
		target.parentNode.href = dlinks[nextImage];
      }
      setTimeout("swapPicture()", timeout);
    }
    else
    {
      setTimeout("swapPicture()", timeout/10);
    }
  }
}
setTimeout("swapPicture()", timeout);
