

// (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 showHot = false;       

// separate captions in quotes with commas 
var Caption = new Array(16);

var tss;
var iss;
var jss = 0;
var pss = Caption.length-1;
//pss = 1

//set images based on number of captions
var Picture = new Array();
for (iss = 0; iss < pss+1; iss++){
		Picture[iss] = 'images/' + (iss + 1) + '.jpg';
}


var preLoad = new Array();
//while iss is less than the number of captions
for (iss = 0; iss < pss+1; iss++){
		preLoad[iss] = new Image();
		preLoad[iss].src = Picture[iss];
		}




//start rollover script
//set thumbnails based on number of captions
var thumbState = new Array();
thumbState[0] =  'down';
for (iss = 1; iss < pss+1; iss++){
		thumbState[iss] = 'up';
}

var thisThumbState;

var regularColor = "#5b131c";
var regularColor2 = "#ba6428";
var overColor = "#666666";

var thumbtogoUp = 0;


 function changeColorOn (flag) {
		var thisThumb = "thumb" + flag;
		var thisoldThumb = "thumb" + thumbtogoUp;
		document.getElementById(thisThumb).style.backgroundColor = overColor;
		if (thumbtogoUp < 8){
					 clr = regularColor;
				} else {
					clr=regularColor2;
				}
		document.getElementById(thisoldThumb).style.backgroundColor = clr;
		
		getRefToDiv();
		
		myReference2 = getRefToDiv("PictureBox");
		if( myReference2.style ) { myReference2 = myReference2.style; }
		
		myReference2.backgroundImage = 'url(' + preLoad[flag].src + ')';
 }


 function changeColorOut (flag) {
	 
		thumbtogoUp = flag;

 }
//end rollover script



var x=0;


//setting thumb state

function thumbs(n,thumbnail){

			//onclick sets the old thumb to up and the new to down
			var setThisUpThumb = "thumb" + x;
			var setThisDownThumb = "thumb" + n;
			
			thumbState[x] = "up";
			thumbState[n] = "down";
			
			if (x < 8){
			document.getElementById(setThisUpThumb).style.backgroundColor = regularColor; 
				} else {
				document.getElementById(setThisUpThumb).style.backgroundColor = regularColor2; 
			}
			if (n < 8){
			document.getElementById(setThisDownThumb).style.backgroundColor = downColor; 
				} else {
				document.getElementById(setThisDownThumb).style.backgroundColor = downColor2; 
			}
			
			jss = n;
			x = n;
			
			if (thumbnail == true) control('T');
			//alert(jss);
}

//end setting thumb state

//get reference to 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;
}

function control(how){

if (how=="T") jss = jss; 


getRefToDiv();


myReference2 = getRefToDiv("PictureBox");
if( myReference2.style ) { myReference2 = myReference2.style; }

myReference2.backgroundImage = 'url(' + preLoad[jss].src + ')';
//alert (myReference.backgroundImage);

}

