<!--

var ImgNum2 = 0;
var ImgLength2 = preLoad2.length - 1;
var delay2 = 5000; //Time delay between Slides in milliseconds
var tmpDelay2 = 10000; // temp delay when user clicks on a photo
var lock2 = false;
var run2;
var autoPlay2 = false;
var iPlayed2 = 0;

function chgImg2(direction)
{
	var oSlideshow = document.getElementById("slideshow2")
	var oSlideshowCaption = document.getElementById("slideshowCap2")

	if (iPlayed2 > 2)
	{
		lock2 = false;
		autoPlay2 = false;
		window.clearInterval(run);
	}
	else
	{
		if (document.images)
		{
			ImgNum2 = ImgNum2 + direction;
			if (ImgNum2 > ImgLength2) 
			{
				ImgNum2 = 0;
				iPlayed2 = iPlayed2 + 1
			}
			if (ImgNum2 < 0) {ImgNum2 = ImgLength2;}

			if (document.all)
			{
				oSlideshow.style.filter = "blendTrans(duration=2)"
				oSlideshow.style.filter = "blendTrans(duration=crossFadeDuration)"
				oSlideshow.filters.blendTrans.Apply()
			}

			oSlideshow.src = preLoad2[ImgNum2].src;
			oSlideshowCaption.innerHTML = NewCap2[ImgNum2];

			if (document.all) {oSlideshow.filters.blendTrans.Play()}
		}
	}
}

function auto2()
{
	if (lock2 == true)
	{
		lock2 = false;
		autoPlay2 = false;
		window.clearInterval(run2);
		run2 = setInterval("auto()", tmpDelay2);
	}
	else if (lock2 == false)
	{
		lock2 = true;
		autoPlay2 = true;
		run2 = setInterval("chgImg2(1)", delay2);
	}
}

function showPicture2(whichPic)
{
	var oSlideshow = document.getElementById("slideshow2")
	var oSlideshowCaption = document.getElementById("slideshowCap2")

	if (whichPic == '+')
	{
		if (ImgNum2 == ImgLength2) {ImgNum2 = 0}
		else {ImgNum2 = ImgNum2 + 1}
	}
	else
	{
		if (ImgNum2 == 0) {ImgNum2 = ImgLength2}
		else {ImgNum2 = ImgNum2 - 1}
	}

	if (autoPlay2 == true) {auto2()}

	if (document.all)
	{
		oSlideshow.style.filter = "blendTrans(duration=2)"
		oSlideshow.style.filter = "blendTrans(duration=crossFadeDuration)"
		oSlideshow.filters.blendTrans.Apply()
	}

	oSlideshow.src = preLoad2[ImgNum2].src;
	oSlideshowCaption.innerHTML = NewCap[ImgNum2];

	if (document.all){document.getElementById("slideshow2").filters.blendTrans.Play()}
}

auto2()

-->
