

// (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';

Thumbnail[0] =  'images/thumb_down.gif';

origThumbnail[0] =  'images/thumb.gif';

Caption[0] = "Stan Beadle (right) plays the part of the unsuspecting victim of pickpocket Tom Bell, portrayed by Mark Schneider.";
Caption[1]  = "The watch is deftly removed from the weskit pocket.";
Caption[2]  = "\"Dandy\" Mr. Bell admires his plunder.";
Caption[3]  = "The unsuspecting victim is unaware he has been robbed.";
Caption[4]  = "Tom Hay carries the instrument of punishment.";
Caption[5]  = "In an interpretation of the punishment of the pickpocket, Tom Hay performs the flogging of Schneider, while Bob Shewanick, Kristen, Megan, and Jamie Spivey look on.";
Caption[6]  = "The pickpocket&#8217;s wrists are tied to the cart so he cannot escape the flogging.";
Caption[7]  = "Kristen and Megan Spivey portray a mother and daughter who are distressed by the thief's beating but do not turn away.";
 


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=5;

function thumbs(n,thumbnail){

//alert(document.images[5].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+5;
//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();
}
}

