// The current
var lCurrent;

// And a timer
var objTimer;

// Start the ticker
$(function(){
	$("ul#ticker01").liScroll({travelocity: 0.03});
});

// ================================================================================================= //

function InitialiseHomePageSplash(vlCurrent)
{

	// Preload images
	if (document.images)
	{
	  pic1= new Image(100, 100); 
	  pic1.src="./Images/Content/Home-Image1.jpg"; 

	  pic2= new Image(100, 100); 
	  pic2.src="./Images/Content/Home-Image2.jpg"; 

	  pic3= new Image(100, 100); 
	  pic3.src="./Images/Content/Home-Image3.jpg"; 
	}

	// Set an interval for changing the image
	objTimer = setInterval('ChangeHomePageImage()', 5000);
	
	// Store
	lCurrent = vlCurrent;

	// Fade in the photo by fading out the black div
	$("#HomePageFade").fadeOut(1000);
}

// ================================================================================================= //

function ChangeHomePageImage()
{
	
	// Update the current
	if (lCurrent == 3)
	{
		lCurrent = 1;
	}
	else
	{
		lCurrent = lCurrent + 1;
	}

	// Fade out the photo by fading in the black div
	$("#HomePageFade").fadeIn(1000, function() { FadeNewCurrent(); });

}

function FadeNewCurrent()
{
	// Change the image
	if (document.getElementById('HomePageSplash')) document.getElementById('HomePageSplash').className = 'HomePage' + lCurrent;

	// Fade in the photo by fading out the black div
	$("#HomePageFade").fadeOut(1000);
}