// JavaScript Document

// Preload the top-left images

var imagePaths = new Array();
imagePaths[0] = 'images/2009/LeftTopHichborns.png';
imagePaths[1] = 'images/2009/LeftTopRachel.png';
imagePaths[2] = 'images/2009/LeftTopTom.png';
imagePaths[3] = 'images/2009/LeftTopLisa.png';
imagePaths[4] = 'images/2009/LeftTopMarie.png';
imagePaths[5] = 'images/2009/LeftTopJess.png';
imagePaths[6] = 'images/2009/LeftTopAngie.png';
imagePaths[7] = 'images/2009/LeftTopShannon.png';
imagePaths[8] = 'images/2009/LeftTopMeg.png';
imagePaths[9] = 'images/2009/LeftTopKatie.png';
imagePaths[10] = 'images/2009/LeftTopAlyssa.png';

var images = new Array();
for ( var i = 0; i < imagePaths.length; i++ ) {
  images[i] = new Image();
  images[i].src = imagePaths[i];
}

function swapImage() {
  var lsh = document.getElementById( 'left-swapped-header' );
  var idx = Math.floor( Math.random() * imagePaths.length );
  
  lsh.style.background = 'url( ' + imagePaths[ idx ] + ' )';
  setTimeout( 'swapImage()', 6000 );
}

