/// <summary>
/// The Home class adds the javascript logic for the processing feature item images on the home page.
/// </summary>
var IMAGETIMER;
var IMAGETIMEOUTLENGTH;

$(document).ready(function(){   	
	//Set our global timeout.
    IMAGETIMEOUTLENGTH = 4000;
    
	//Start cycling through images.
	IMAGETIMER = setInterval("cycleImage()", IMAGETIMEOUTLENGTH);
	
	//Add Mouseover/out actions to stop/start animation.
	$("div#divImageCollectionContainer > a:visible").hover(
		function() {
			clearInterval(IMAGETIMER);
		},
		function() {
			IMAGETIMER = setInterval("cycleImage()", IMAGETIMEOUTLENGTH);
		}
	);
});
function cycleImage() 
{
	var activeImage = $("div#divImageCollectionContainer > a:visible");
	var nextImage = (!activeImage.next().attr("id")) ? $("div#divImageCollectionContainer > a:first") : (activeImage.next(".imgAnchor"));
	activeImage.fadeOut("slow");
	nextImage.fadeIn("slow");
}