<!-- Hide from old browsers
// Unless otherwise noted, all JavaScript is copyright 
// (c) SilverDisc Ltd 1996-2002: all rights reserved. 

// Language constants:
var English = 1;
var NumLanguages = 1;

// Variables:
var timerID = null;
var timerRunning = false;

var months;
var days;

// Controls:
var language = English;
var twentyfourhour = false;

function MakeEmptyArray(n)
{
    var i;
    this.length = n;
    for(i = 1; i <= n; i++)
    {
        this[i] = null;
    }
    return this;
}

function MakeFilledArray()
{
    // Make an array of strings
    var i;

    this.length = MakeFilledArray.arguments.length;
    for(i = 1; i <= this.length; i++)
    {
        this[i] = MakeFilledArray.arguments[i - 1];
    }
    return this;
}


// Slideshow

var NUMITEMS=3;
var timerID = null;
var timerRunning = false;
var timerInt = 4; // Timer interval in seconds
var pictureCount=1;
var preloadedImages = new Array();

var useFilters=false;
var use55Filters=false;
var aCount=0;

function preloadPictures()
{
  var img=0;
  for (img=0; img<(pictures.length/NUMITEMS); img++)
  {
     //alert("Preload:"+imgRefs[img]);
     preloadedImages[img]= new Image;
     preloadedImages[img].src=pictures[img*NUMITEMS];
  }
}

function initShow()
{
  if (document.all)
  {
    if (document.all.picture.filters)
    {
      // IF ie 5.5 or greater we can use 5.5 filters
      use55Filters=((navigator.appName.indexOf("Microsoft Internet Explorer") != -1)&&
      (parseFloat(navigator.appVersion.substr((navigator.appVersion.toLowerCase().indexOf('msie')+4))) >= 5.5));
    
      // IF ie 4 or greater we can use 4.0 filters
      useFilters=((navigator.appName.indexOf("Microsoft Internet Explorer") != -1)&&(parseInt(navigator.appVersion) >= 4));
    
      if (use55Filters)
      {
        // IE5.5 only!
        document.all.picture.style.filter="progid:DXImageTransform.Microsoft.Fade(overlap=1)";
      }
      else
      {
        document.all.picture.style.filter="blendTrans(duration=2)";
      }
    }
  }

  if (document.images)
  {
    preloadPictures();
    startShow();
  }
}


function stopShow()
{
  timerRunning = false;
  clearInterval(timerID);
  timerID = null;
}


function startShow()
{
  timerRunning = true;
  timerID = setInterval("nextPicture()",timerInt*1000)
}

function nextPicture()
{
  if (useFilters)
  {
    aCount=aCount+1;
    if (aCount>37) {aCount=0;}
    document.all.picture.filters(0).Apply();
  }

  if (pictureCount>=(pictures.length/NUMITEMS))
  {
   // we have been around once.
   pictureCount=0;
   document.images["picture"].src=preloadedImages[pictureCount].src;
   document.images["picture"].alt=pictures[(pictureCount*NUMITEMS)+1]+"  ";
   window.status=pictures[(pictureCount*NUMITEMS)+1]+"   ";
   pictureCount=1;
  }

  else
  {
    if ((preloadedImages[pictureCount].complete || preloadedImages[pictureCount].complete==null))
    {
      document.images["picture"].src=preloadedImages[pictureCount].src;
      document.images["picture"].alt=pictures[(pictureCount*NUMITEMS)+1]+"";
      window.status=pictures[(pictureCount*NUMITEMS)+1]+"";
      pictureCount++;
    }
  }
  if (useFilters)
  {
    document.all.picture.filters(0).Play();
  }

}




function toggleShow()
{
  if (timerRunning)
  {
   var currentPicture=pictureCount-1;
   stopShow();
   document.images["picture"].alt=pictures[(currentPicture*NUMITEMS)+1]+"";
   window.status=pictures[(currentPicture*NUMITEMS)+1]+"";
  }
  else
  {
   nextPicture();
   startShow();
  }
}

// End hiding -->

