
// Browser Slide-Show script.
// With image cross fade effect for those browsers that support it.
// Script copyright (C) 2004 www.cryer.co.uk.
// Script is free to use provided this copyright header is included.
var slideCache = new Array();
function RunSlideShow(pictureName,imageFiles,URLs,rels,displaySecs)
{
  var imageSeparator = imageFiles.indexOf("##");
  var nextImage = imageFiles.substring(0,imageSeparator);
  var URLSeparator = URLs.indexOf("##");
  var nextURL = URLs.substring(0,URLSeparator);
  var relSeparator = rels.indexOf("##");
  var nextrel = rels.substring(0,relSeparator);

  var nextrelwindowname = nextrel.split("|")[0];
  var nextrelfeatures = nextrel.split("|")[1];
  
  if (nextrelfeatures == undefined) nextrelfeatures='';

  if (document.all)
  {
    document.getElementById(pictureName).style.filter="blendTrans(duration=1)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }
  document.getElementById(pictureName).src = 'w.gif';
  document.getElementById(pictureName).onmouseover = function(evt) {this.style.cursor='auto';}
  document.getElementById(pictureName).onclick = ''; 
  if (document.all)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }


    if (nextrel!='') {
		document.getElementById(pictureName).onmouseover = function(evt) {this.style.cursor='pointer';} 
		document.getElementById(pictureName).onclick = function(evt) {window.open(nextURL,nextrelwindowname ,nextrelfeatures )}
    } else if (nextURL!='') {
		document.getElementById(pictureName).onmouseover = function(evt) {this.style.cursor='pointer';} 
		document.getElementById(pictureName).onclick = function(evt) {window.location.href=nextURL;}
    } else {
		document.getElementById(pictureName).onmouseover = function(evt) {this.style.cursor='auto';}
		document.getElementById(pictureName).style.border='0';
    }
    
  if (document.all)
  {    
    document.getElementById(pictureName).style.filter="blendTrans(duration=1)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }  
  document.getElementById(pictureName).src = nextImage;
  if (document.all)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }

  var futureImages= imageFiles.substring(imageSeparator+2,imageFiles.length) + '##' + nextImage;
  var futureURLs= URLs.substring(URLSeparator+2,URLs.length) + '##' + nextURL;
  var futurerels= rels.substring(relSeparator+2,rels.length) + '##' + nextrel;

  setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"','"+futureURLs+"','"+futurerels+"',"+displaySecs+")", displaySecs*1000);
  // Cache the next image to improve performance.
  imageSeparator = futureImages.indexOf("##");
  nextImage = futureImages.substring(0,imageSeparator);
  if (slideCache[nextImage] == null) {
    slideCache[nextImage] = new Image;
    slideCache[nextImage].src = nextImage;
  }
}