

// (C) 2003 by CodeLifter.com
// Free for all users, but leave in this header.

// ==============================
// Set the following variables...
// ==============================

// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 3000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 2;

var Picture = new Array(); 
var Thumbnail = new Array();
var origThumbnail = new Array();
var Caption = new Array(); 
var showHot = false;       

// Caution: The number of Pictures *must*
// equal the number of Captions!
Picture[0] =  'images/1.jpg';
Picture[1]  = 'images/2.jpg';
Picture[2]  = 'images/3.jpg';
Picture[3]  = 'images/4.jpg';
Picture[4]  = 'images/5.jpg';
Picture[5]  = 'images/6.jpg';
Picture[6]  = 'images/7.jpg';
Picture[7]  = 'images/8.jpg';
Picture[8] =  'images/9.jpg';
Picture[9]  = 'images/10.jpg';

Thumbnail[0] =  'images/thumb_down.gif';

origThumbnail[0] =  'images/thumb.gif';

Caption[0] = "Evening performers Carson Hudson, Ann Marie Miller, and Diane Elliott demonstrate glove puppets.";
Caption[1]  = "Ann Marie (behind the curtain) manipulates the flat wooden puppets, while Carson Hudson tells the story of Blackbeard.";
Caption[2]  = "Ann Marie reveals herself to the audience as she hears the response to her puppetry. The sailors on the left rescued the damsel in distress. Blackbeard is on the right.";
Caption[3]  = "As Carson reaches the part of the story where Blackbeard is thrown overboard and hits the water, Ann Marie sprays the water she has been holding in her mouth on the unsuspecting Carson.";
Caption[4]  = "Lily O'Connor, Kurtis Dement, and Lea Wetchler are among the kids who operate the puppets from behind the stage in \"Colonial Kids On Parade.\"";
Caption[5]  = "Emma Cross, Erin Smith, and Amanda O'Connor hold \"cast members\" from the puppet story.";
Caption[6]  = "Colonial Williamsburg juvenile performers Daniel Cross and Audrey Glassbrook interact with the audience.";
Caption[7]  = " The ship on the left will take Dick to Pasha's Island, on the right.";
Caption[8]  = "Cast of characters from the puppet play \"Dick Whittington and His Cat\" appear on stage for a curtain call.";
Caption[9]  = "\"Stars\" of the show, Dick and his cat, and the archvillain Mrs. Burnwell take a bow.";
 

var tss;
var iss;
var jss = 0;
var pss = Picture.length-1;
//pss = 1

var preLoad = new Array();
//while iss is less than 12, build array that preload1.src=picture1, preload2.src=picture2
for (iss = 0; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}


var preLoadT = new Array();
//while iss is less than 12, build array that preload1.src=picture1, preload2.src=picture2
for (iss = 0; iss < pss+1; iss++){
preLoadT[iss] = new Image();
preLoadT[iss].src = Thumbnail[0];}


var preLoadO = new Array();
//while iss is less than 12, build array that preload1.src=picture1, preload2.src=picture2
for (iss = 0; iss < pss+1; iss++){
preLoadO[iss] = new Image();
preLoadO[iss].src = origThumbnail[0];}


//start rollover script
function changeImages() {
	if (document.images) {
	
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		
		}
	}
}

//end rollover script



var x=6;

function thumbs(n,thumbnail){

//alert(document.images[8].src);
//change old down thumbnail to up position
document.images[x].src = preLoadO[0].src;

//
//need to determine what number your first thumbnail image is, then add to n in the x=n variable and to the var x=_
//

  
jss = n;
x = n+6;
//change new thumbnail to up position
document.images[x].src = preLoadT[0].src;

if (thumbnail == true) control('T');
//alert(jss);
}

var nextB = "false"; // not _over
var backB = "false" // not _over
var activeF = true;
var activeB = true;



function control(how){
if (showHot){
if (how=="H") {
	jss = 0;
	thumbs(jss,false);}

// if the next button is active, add 1 to jss otherwise do nothing
if (activeF == true){
	if (how=="F"){
	 jss = jss + 1;
	 thumbs(jss,false);}
} else { 
	null;
	}
	
// if the back button is active, subtract 1 from jss otherwise do nothing
if (activeB == true){
	if (how=="B") {jss = jss - 1;
	 thumbs(jss,false);}
} else {
	null;
}


if (how=="T") jss = jss; 

// if jss equals the total pictures, turn off next button
if (jss == (pss)) {
	nextB = "true";
	activeF = false;}
// if jss is at the first picture, turn off back button
if (jss == 0){
	backB = "true";
	activeB = false; }
// any other time turn on back and next buttons
if (jss != 0) {
	backB = "false";
	activeB = true; }
if (jss != (pss)) {
	nextB = "false";
	activeF = true;}



//get reference to CaptionBox and PictureBox for all browsers
function getRefToDiv(divID,oDoc) {
    if( !oDoc ) { oDoc = document; }
    if( document.layers ) {
        if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
            //repeatedly run through all child layers
            for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
                //on success, return that layer, else return nothing
                y = getRefToDiv(divID,oDoc.layers[x].document); }
            return y; } }
    if( document.getElementById ) {
        return document.getElementById(divID); }
    if( document.all ) {
        return document.all[divID]; }
    return false;
}


myReference2 = getRefToDiv("PictureBox");
if( myReference2.style ) { myReference2 = myReference2.style; }
myReference2.backgroundImage = 'url(' + preLoad[jss].src + ')';
//alert (myReference.backgroundImage);

myReference = getRefToDiv("CaptionBox");
//changes text in CaptionBox, technique varies by browser
if( typeof( myReference.innerHTML ) != 'undefined' ) {
  //used by the IE series, Konqueror, Opera 7+ and Gecko browsers
  myReference.innerHTML = Caption[jss];
} else {
  if( myReference.document && myReference.document != window.document ) {
    //used by layers browsers
    myReference.document.open();
    myReference.document.write(Caption[jss]);
    myReference.document.close();
  } else {
    if( window.frames && window.frames.length && window.frames['nameOfIframe'] ) {
      //used by browsers like Opera 6-
      //if we attempt to rewrite the iframe content before
      //it has loaded we will only produce errors
      myReference = window.frames['nameOfIframe'].window;
      myReference.document.open();
      myReference.document.write(Caption[jss]);
      myReference.document.close();
    }
  }
}







/*

if( myReference.innerHTML ) {
	document.getElementById("PictureBox").backgroundImage = 'url(' + preLoad[jss].src + ')'; }

if( myReference.style ) {
document.getElementById("PictureBox").style.backgroundImage = 'url(' + preLoad[jss].src + ')'; }

*/

//for explorer
//if (document.all){
//can be used with a "real" image to have a fade effect
//document.images.PictureBox.style.filter="blendTrans(duration=2)";
//document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
//document.images.PictureBox.filters.blendTrans.Apply();
//}

if (nextB == "true") document.images.next.src = 'images/next_down.gif';
if (nextB == "false") document.images.next.src = 'images/next.gif';
if (backB == "true") document.images.backB.src = 'images/back_down.gif';
if (backB == "false") document.images.backB.src = 'images/back.gif';
//document.images.PictureBox.src = preLoad[jss].src;

//if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];

//for explorer
//if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}
}

