// store an interval in a variable
var pause = 7000;
// create and initialise counter
var n = 0;
// create and array of image file names
var imgs1 = new Array ( "images/sfcu162011.jpg", 
                       "images/sfcu182011.jpg",  
                       "images/sfcu82011.jpg", 
                       "images/sfcu82011a.jpg", 
                       "images/sfcu122011.jpg",
                       "images/gw.jpg",
                       "images/1980s.jpg", 
                       "images/1960s.jpg",  
                       "images/1957.jpg", 
                       "images/teamtalk.jpg", 
                       "images/boblee.jpg",
                       "images/ladies.jpg",
                       "images/1969.jpg",
                       "images/sfcu152010.jpg" ); 


// preload all images
var preload1 = new Array();
for( var i = 1; i < imgs1.length; i++ )
{
  preload1[i] = new Image();
  preload1[i].src = imgs1[i];
}



// a function to display each image for the set interval



function rotate()
{
var rand1 = Math.floor(Math.random() * imgs1.length)

  document.images.pic1.src = imgs1[rand1];

  setTimeout( "rotate()", pause );
}

// specify the onload event-handler
window.onload = rotate;
