function LoadGallery(pictureName,imageFile,titleCaption,captionText)
{
  //cross fade effect Script copyright (C) 2004 www.cryer.co.uk
  if (document.all)
  {
    document.getElementById(pictureName).style.filter="blendTrans(duration=1)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }
  document.getElementById(pictureName).src = imageFile;
  if (document.all)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }
  document.getElementById(titleCaption).innerHTML=captionText;
}

function next() {
current = ++current;
if (current <= totalpics) {
LoadGallery('ThePic', galPic[current][0], 'TheCaption', galPic[current][1]);
   }
else first();
}
function previous() {
current = --current;
if (current > 0) {
LoadGallery('ThePic', galPic[current][0], 'TheCaption', galPic[current][1]);
   }
else last();
}
function first() {
current = 1;
LoadGallery('ThePic', galPic[1][0], 'TheCaption', galPic[1][1]);
}
function last() {
current = totalpics;
LoadGallery('ThePic', galPic[current][0], 'TheCaption', galPic[current][1]);
}
function change(picNum) {
current = picNum;
LoadGallery('ThePic', galPic[current][0], 'TheCaption', galPic[current][1]);
if (document.slideform.slidebutton.value == "Pause") {
	ap("Pause");
    current = picNum;
    //ap("Pause"); 
  }
}
function ap(text) {
document.slideform.slidebutton.value = (text == "Pause") ? "Start" : "Pause";
rotate();
}
function rotate() {
if (document.slideform.slidebutton.value == "Pause") {
current = (current == totalpics) ? 1 : current+1;
if (current > totalpics) {
	current = 1;}
LoadGallery('ThePic', galPic[current][0], 'TheCaption', galPic[current][1]);
window.setTimeout("rotate()", rotate_delay);
   }
}
