﻿<!---
function nextGallerySlide (HandleID, path, fromSlide, toSlide)
{
   crossfade(HandleID, path, '2');   
}
   
var galleryHandle;
function setupGallery(divName)
{
   var d = new Array(3);
   
   d[0] = 'Images/gallery';
   d[1] = new Array ("sb1.jpg", "sb20.png", "sb21.png", "sb22.png", "sb23.png", "sb8.jpg");
   d[2] = divName;
   d[3] = 4000;
   d[4] = -1;
   d[5] = null;
   d[6] = 1;
   d[7] = null; 
   d[8] = null;    
   galleryHandle = new imageSlideShow(d);
   galleryHandle.startSlideShow();
}

function setupGalleryWithButtons(divName)
{
   var d = new Array(3);
   
   d[0] = 'Images/gallery';
   d[1] = new Array ("sb1.jpg", "sb20.png", "sb21.png", "sb22.png", "sb23.png", "sb8.jpg");
   d[2] = divName;
   d[3] = 4000;
   d[4] = 1;
   d[5] = null;
   d[6] = 1;
   d[7] = null; 
   d[8] = activateStopButton;    
   galleryHandle = new imageSlideShow(d);
   galleryHandle.startSlideShow();
}

   function activatePlayButton()
   {
      addClassName("gallery-button-play-link", "gallery-active-button");
      removeClassName("gallery-button-stop-link", "gallery-active-button");
   }
   
   function activateStopButton()
   {
      addClassName("gallery-button-stop-link", "gallery-active-button");
      removeClassName("gallery-button-play-link", "gallery-active-button");
   }

   function addClassName(e,t)
   {
      if (typeof e == "string")
         e = document.getElementById(e);

      // code to change and replace strings
      // regular expression dumps leading/trailing spaces
      var ec = ' ' + e.className.replace(/^s*|s*$/g, '') + ' ';
      var nc = ec;
      t = t.replace(/^s*|s*$/g, '');

      // check if not already there
      if (ec.indexOf(' ' + t + ' ') == -1)
         nc = ec + t;     // not found, add it

      // return the changed text!
      e.className = nc.replace(/^s*|s*$/g, ''); // trimmed whitespace
      return true;
   }
   
   function removeClassName(e,t)
   {
      if (typeof e == "string")
        e = document.getElementById(e);
 
      // code to change and replace strings
      // regular expression dumps leading/trailing spaces      
      var ec = ' ' + e.className.replace(/^s*|s*$/g, '') + ' ';
      var nc = ec;
      t = t.replace(/^s*|s*$/g,'');
      
      // check if not already there
      if (ec.indexOf(' ' + t + ' ') != -1)      
         nc = ec.replace(' ' + t.replace(/^s*|s*$/g, '') + ' ', ' ');  //found, so lets remove it

      // return the changed text!
      e.className = nc.replace(/^s*|s*$/g,''); //trimmed whitespace
      return true;
   }
-->
