rotating_images = new Array();

//Duplicate these lines here to add new images to the rotation.

var active_image_delay = 3; //in seconds

var active_image_index = 0;

var playedsong = 1;

function rotateImages() {

  //Ensure routine runs only if my_images exists on the page.
  if (!document.getElementById('my_images') || rotating_images.length < 1) return;
  var new_image_code = '';

  new_image = document.createElement('IMG');
  new_image.src = rotating_images[active_image_index].image;
  new_image.border = "0";

  new_link = document.createElement('A');
  new_link.href = rotating_images[active_image_index].url;

  new_link.appendChild(new_image);


  if (document.getElementById('my_images').hasChildNodes() ) {
    while (document.getElementById('my_images').childNodes.length >= 1 ) {
      document.getElementById('my_images').removeChild(document.getElementById('my_images').firstChild );
    }
  }

  document.getElementById('my_images').appendChild(new_link);

  active_image_index = (active_image_index+1)%rotating_images.length;

  setTimeout('rotateImages();',active_image_delay*1000);
}
function RotatingImage (image_url, url) {
  this.image = image_url;
  this.url = url;
}

