	var fadeTime = 1200; // Fade in/out each image over 1.2 seconds
	var pauseTime = 5000; // Pause on each image for 4 seconds

	var current = 0; // Current index
	var cur; // Stores current item
	var next; // Stores next item
	var timer; // Used for starting/stopping the rotation
	var size = 0; // Stores the number of items to rotate
	var paused = false; // Are we paused?

	function StartSlideShow()
	{
		// Hide all of the items
		$('ul#slideshow > *').css("display", "none")
		.css("left", "0")
		.css("top", "0")
		.css("position", "absolute");

		// Display the first item
		$('ul#slideshow li:first').css("display", "block")
		.css("left", "0")
		.css("top", "0")
		.css("position", "absolute");

		// Set size variable to number of items
		size = $('ul#slideshow li').size();
		
		// Start the rotation timer
		StartTimer();
	}

	function StartTimer()
	{
		// Make sure we have a clean slate
		clearInterval(timer);
		// Call Switch() every x milliseconds
		timer = setInterval('Switch()', pauseTime);
	}

	function Switch()
	{	
		cur = ($('ul#slideshow li').eq(current));
		// Check to see if we are at the end of the list
		if ((current + 1) == size)
		{
			next = ($('ul#slideshow li').eq(0));
			current = 0;
		}
		else
		{
			next = ($('ul#slideshow li').eq(current + 1));
			current = current + 1;
		}
		// Fade between the images
		cur.fadeOut(fadeTime);
		next.fadeIn(fadeTime);
	}


