/* Common.lib.js JavaScript Library by Jake Chappell */


/* SLIDE SHOWS */

// GLOBALS
var slideShowNumber = 1;
var slideShowTrans = 1.00;

// SLIDE SHOW (TEST ACTION)
function SlideShow(slideIndex, hasTitle)
{
	if (slideShowTrans == 1.00)
		LoadSlide(slideIndex, hasTitle);
}

// LoadSlide()
function LoadSlide(slideIndex, hasTitle)
{
	var CS = document.getElementById("slideShow" + slideShowNumber);

	if (hasTitle)
		var CST = document.getElementById("slideShowTitle" + slideShowNumber);

	if (slideShowTrans > 0)
	{
		slideShowTrans = slideShowTrans - 0.10;
		CS.style.opacity = slideShowTrans;
		CS.style.filter = "alpha(opacity=" + slideShowTrans * 100 + ")";

		if (hasTitle)
		{
			CST.style.opacity = slideShowTrans;
			CST.style.filter = "alpha(opacity=" + slideShowTrans * 100 + ")";
		}

		setTimeout("LoadSlide(" + slideIndex + ", " + hasTitle + ")", 100);
	}
	else
	{
		CS.style.display = "none";

		document.getElementById("slideShow" + slideIndex).style.opacity = 0;
		document.getElementById("slideShow" + slideIndex).style.filter = "alpha(opacity=0)";

		document.getElementById("slideShow" + slideIndex).style.display = "block";

		if (hasTitle)
		{
			CST.style.display = "none";

			document.getElementById("slideShowTitle" + slideIndex).style.opacity = 0;
			document.getElementById("slideShowTitle" + slideIndex).style.filter = "alpha(opacity=0)";

			document.getElementById("slideShowTitle" + slideIndex).style.display = "block";
		}
		
                slideShowNumber = slideIndex;
		LoadSlideCont(slideIndex, hasTitle);
	}
}

// LoadSlideCont()
function LoadSlideCont(slideIndex, hasTitle)
{
	var CS = document.getElementById("slideShow" + slideIndex);
	
	if (hasTitle)
		var CST = document.getElementById("slideShowTitle" + slideIndex);

	if (slideShowTrans < 1.00)
	{
		slideShowTrans = slideShowTrans + 0.10;
		CS.style.opacity = slideShowTrans;
		CS.style.filter = "alpha(opacity=" + slideShowTrans * 100 + ")";

		if (hasTitle)
		{
			CST.style.opacity = slideShowTrans;
			CST.style.filter = "alpha(opacity=" + slideShowTrans * 100 + ")";
		}

		setTimeout("LoadSlideCont(" + slideIndex + ", " + hasTitle + ")", 100);
	}
}