var intervalID
var numberOfPics
var currentPic
numberOfPics = 11
currentPic = 0

var numberOfAttractions
var currentAttraction
numberOfAttractions = 5
currentAttraction = 0

var attractions = new Array(10)
attractions[0]="<font color='#000080'>Smithsonian Institution...</font>"
attractions[1]="<font color='#000080'>National Gallery of Art...</font>"
attractions[2]="<font color='#000080'>Library of Congress...</font>"
attractions[3]="<font color='#000080'>National Archives...</font>"
attractions[4]="<font color='#000080'>Baltimore Museum of Art...</font>"
attractions[5]="<font color='#000080'>... and more</font>"


var slideImage = new Array(12)
slideImage[0]="images/2009small2.jpg"
slideImage[1]="images/2009small9.jpg"
slideImage[2]="images/2009small1.jpg"
slideImage[3]="images/2009small3.jpg"
slideImage[4]="images/2009small8.jpg"
slideImage[5]="images/2009small7.jpg"
slideImage[6]="images/2009small10.jpg"
slideImage[7]="images/2009small11.jpg"
slideImage[8]="images/2009small4.jpg"
slideImage[9]="images/2009small6.jpg"
slideImage[10]="images/2009small5.jpg"
slideImage[11]="images/2009small12.jpg"

function Preload() {
 	var args = Preload.arguments;
	document.imageArray = new Array(args.length);
	for(var i=0; i<args.length; i++) {
		document.imageArray[i] = new Image;
		document.imageArray[i].src = args[i];
	}
   }

      
function startShow()
 {
 	  Preload('images/2009small4.jpg','images/2009small5.jpg','images/2009small6.jpg', 'images/2009small7.jpg', 'images/2009small8.jpg', 'images/2009small9.jpg')
 	  Preload('images/2009small1.jpg','images/2009small2.jpg','images/2009small3.jpg','images/2009small10.jpg', 'images/2009small11.jpg', 'images/2009small12.jpg')
      intervalID = setInterval("swapall()",1800);
 }
function stopShow()
{
      clearInterval(intervalID);
}
function swapall()
{
	currentPic = currentPic + 3
	currentAttraction = currentAttraction + 1
	
     if (currentPic > numberOfPics)
     {
       currentPic = 0
     }
     if (currentAttraction > numberOfAttractions)
     {
       currentAttraction = 0
     }

      document.mainimage1.src=slideImage[currentPic];
      document.mainimage2.src=slideImage[currentPic+1];
      document.mainimage3.src=slideImage[currentPic+2];

	  attraction.innerHTML=attractions[currentAttraction]
      
}



