//*****************************
// Rollover scripts
//*****************************

// Global variables 

// navigation

var btnZoris = new Array( "btnLeftZoris","btnRightZoris");
var objNormalZoris = new Array( btnZoris.length );
var objRolloverZoris = new Array( btnZoris.length );

// slideshow

//NOTE: strip count includes strip intro (designated as strip0)
// All strips are ".gif" except for the first which is "jpg"
var stripCnt = 4;   // does not include the latest strip
var thisPic = 0;

//************************
// function loadImages:
//
// Preload button images
//************************

function loadZoriImages( )
{
   var length = btnZoris.length;
   var i;

   if (document.images) {
         for (i=0; i<length; i++) {
               var imageZoris = btnZoris[ i ]; 
               objNormalZoris[ imageZoris ] = new Image( );
               objRolloverZoris[ imageZoris ] = new Image( );
   
               objNormalZoris[ imageZoris ].src = "images/funStuff/" + btnZoris[ i ] + ".gif";
               objRolloverZoris[ imageZoris ].src = "images/funStuff/" + btnZoris[ i ]  + 
                                                              "Over.gif";
         }
   }
}

//************************
// function makeRollover:
//
// Loads document image object
// with rollover object's image source
//************************

function makeRolloverZoris( objName )
{
   if (document.images) {
         if ( objRolloverZoris[ objName ] ) 
               document.images[ objName ].src = objRolloverZoris[ objName ].src;
   }
}

//************************
// function makeNormalZoris:
//
// Loads document image object
// with normal object's image source
//************************

function makeNormalZoris( objName )
{
   if (document.images) {
         if ( objRolloverZoris[ objName ] ) 
               document.images[ objName ].src = objNormalZoris[ objName ].src;
   }
}

//************************
// function chgSlide:
//
// Displays next image in 
// slideshow array
//************************

function chgSlide( dir )
{
	var ext = ".gif";
    if (document.images) {
		thisPic = thisPic + dir;
		if (thisPic > stripCnt) {
			thisPic = 0;
		}
		if (thisPic < 0) {
			thisPic = stripCnt;
		}
		if (thisPic == 0 || thisPic == 4) ext = ".jpg";  // Strip intro is JPEG
			
		for (var i=0; i<4; i++) {
			document.getElementById("strip"+i).src = "images/funStuff/strip" + thisPic + "_" + i + ext; 
		}
	}
}

