// Slide Show Script
// edited image and text display 08/15/2008 by Frank Maskus

// Global variables
// Set the number of images and size here

var numImages = 18   
var width = 480
var height = 360
var index = 1
var count = numImages
var slide = new Array()

// Cache the images
for(var i=1; i<=count; i++)
{
   slide[i] = new Image(width, height);
}

// Cache these images
   slide[1].src = "Images/start.jpg"
   slide[2].src = "Images/babies.jpg"
   slide[3].src = "Images/daistent.jpg"
   slide[4].src = "Images/cinn02.jpg"
   slide[5].src = "Images/both4.jpg"
   slide[6].src = "Images/blkfoot.jpg"
   slide[7].src = "Images/daisy07.jpg"
   slide[8].src = "Images/condo.jpg"
   slide[9].src = "Images/jasper.jpg"
   slide[10].src = "Images/jasper1.jpg"
   slide[11].src = "Images/daisy09.jpg"
   slide[12].src = "Images/jasper2.jpg"
   slide[13].src = "Images/jas_cin.jpg"
   slide[14].src = "Images/jascouch.jpg"
   slide[15].src = "Images/treats.jpg"
   slide[16].src = "Images/all3.jpg"
   slide[17].src = "Images/olivia.jpg"
   slide[18].src = "Images/skunk1.jpg"
   
      // Display image description
      var caption = [
      '',
      ' Start Slide  (click the next button)',
      ' A litter of Ferret babies getting near 4 weeks old.',
      ' Daisy camping out in their new Tent.',
      ' Cinnamon riding her Tennis Ball. Daisy is in the bag.', 
      ' Buddies, Daisy and Cinnamon in one of their Hammocks.',
      ' A nice picture of a Wild Black Footed Ferret.',
      ' Daisy my domestic Black Footed Ferret.',
      ' I Added a 2nd Floor to the Ferret Condo.',
      ' My New addition... Jasper about 7 months old.',
      ' Jasper is an Albino Ferret.',      
      ' Daisy sleeping half in half out of the Hammock.',
      ' Jasper sleeping half in and half out of the Hammock.',
      ' Jasper and Cinnamon in their Hammock.',
      ' Jasper re-arranging the couch cushons.',
      ' Jasper Cinnamon and Daisy having their FerretVite.',
      ' Daisy Cinnamon and Jasper ready for bed.',
      ' Olivia my Angora Ferret from European Parents.',
      ' I want to play....  Where did everybody go?'
      ];

    function loadHandler()
	{
		  // Get a reference to our text container
		  var textNode = document.getElementById('text');
		  
		  // Set the text containers value to Temp
		  textNode.firstChild.nodeValue = caption[index];
	}

 
	function newslide(direction)
	{
	   if(document.images)
	   {
		  index = index + direction;
	
		  // Check index range
		  if(index < 1) index = 1;
		  if(index > count) index = count;
	
		  // Swap the image
		  document.slider.src = slide[index].src;
		  
		  // Fetch the next image
		  if(direction > 0 && index < count)
		  {
		    next = index + 1;
		  }
		  
		  // Get a reference to our text container
		  var textNode = document.getElementById('text');
		  
		  // Set the text containers value to Temp
		  textNode.firstChild.nodeValue = caption[index];
		  
		  // Set the count button values
		  document.frm2.left.value = "Image "+ index +" of "+ numImages; 
	   }
	}   
