// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 3000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var Picture = new Array(); // don't change this
//var Caption = new Array(); // don't change this

// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!

Picture[1]  = 'beach0.gif';
Picture[2]  = 'beach1.gif';
Picture[3]  = 'beach2.gif';
Picture[4]  = 'beach3.gif';
Picture[5]  = 'beach4.gif';
Picture[6]  = 'beach5.gif';
Picture[7]  = 'beach6.gif';
Picture[8]  = 'beach7.gif';
Picture[9]  = 'beach8.gif';
Picture[10]  = 'beach9.gif';
Picture[11]  = 'beach10.gif';
Picture[12]  = 'beach11.gif';
Picture[13]  = 'beach12.gif';
Picture[14]  = 'beach13.gif';
Picture[15]  = 'beach14.gif';

// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of Pictures!

//Caption[1]  = "This is the first caption.";
//Caption[2]  = "This is the second caption.";
//Caption[3]  = "This is the third caption.";
//Caption[4]  = "This is the fourth caption.";
//Caption[5]  = "This is the fifth caption.";
//Caption[6]  = "This is the sixth caption.";
//Caption[7]  = "This is the seventh caption.";
//Caption[8]  = "This is the eighth caption.";
//Caption[9]  = "This is the ninth caption.";
//Caption[10] = "This is the tenth caption.";

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 1;
var ifw;
var irw;
var pss = Picture.length-1;
var bStop = 0;
var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function runSlideShow(){
if (bStop==1)  return;
if (document.all) 
{
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
//if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
ifw = jss;
irw = jss;
jss = jss + 1;
if (jss > (pss)) jss=1;
if (bStop==0) tss = setTimeout('runSlideShow()', SlideShowSpeed);
}

//Stop or Play
function StopPlay()
{
	if (bStop==0)
	{
		bStop=1;
		switchImage('img1','play_w.gif');
		return;
	}

	if (bStop==1)
	{
		bStop=0;
		runSlideShow();
		switchImage('img1','stop_w.gif');
		return;
	}
}

function fw()
{
	//first check if slideshow is runing
	if (bStop==0)
	{
		bStop=1;
		switchImage('img1','play_w.gif');
	}
	
	//know switch to next image
	ifw = ifw + 1;
	jss = ifw;
	irw = ifw;
	if (ifw > (pss))
	{
		jss=1;
		ifw=1;
	}
	if (document.all) 
	{
		document.images.PictureBox.style.filter="blendTrans(duration=2)";
		document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
		document.images.PictureBox.filters.blendTrans.Apply();
	}

	document.images.PictureBox.src = preLoad[ifw].src;
	//if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
	if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}

function rw()
{
	//first check if slideshow is runing
	if (bStop==0)
	{
		bStop=1;
		switchImage('img1','play_w.gif');
	}
	
	
	//know switch to last image
	irw = irw - 1;
	jss = irw;
	ifw = irw;
	if (irw == 0)
	{
		irw=pss;
		jss=pss;
	} 
	
	if (document.all) 
	{
		document.images.PictureBox.style.filter="blendTrans(duration=2)";
		document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
		document.images.PictureBox.filters.blendTrans.Apply();
	}

	document.images.PictureBox.src = preLoad[jss].src;
	//if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
	if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}

function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}
