jQuery(function() {
	
	// Spotlight image slideshow using the jQuery Cycle plugin
	$('#spotlight').cycle({
		fx: 'scrollVert',
		speedIn: 2500,
		speedOut: 2500,
		timeout: 5000,
		delay: 10000,
		prev: '#goto-previous',
		next: '#goto-next',
		pager: '#spotlight-pager',
		
		pagerAnchorBuilder: function(idx, slide) {
			return '<li><a href"#"></a></li>';
		}
	});
	
	// Adds links to the slideshow images. Cycle plugin causing problems with placing images in anchor tags
	$('img#shield').click(function()		{ window.location.href = "aboutUs.php" });
	$('img#income').click(function()		{ window.location.href = "toolsEdu.php#income" });
	$('img#fast-start').click(function()	{ window.location.href = "marketingInc.php#fast-start" });
	$('img#conference').click(function()	{ window.location.href = "marketingInc.php#conference" });
	$('img#rewards').click(function()		{ window.location.href = "marketingInc.php#rewards" });
	$('img#university').click(function()	{ window.location.href = "toolsEdu.php#university" });
	$('img#elite').click(function()			{ window.location.href = "toolsEdu.php#elite" });
		
	// Controls click behavior on logo bar.
	//A click on a program logo switches the Spotlight slide to that program's slide	
	$('#dc-logo a').click(function() {
		$('#spotlight-pager li:eq(1) a').trigger('click');
		return false;
	});
	
	$('#propulsion-logo a').click(function() {
		$('#spotlight-pager li:eq(1) a').trigger('click');
		return false;
	});
	
	$('#nashville-logo a').click(function() {
		$('#spotlight-pager li:eq(2) a').trigger('click');
		return false;
	});
	
	$('#rewards-logo a').click(function() {
		$('#spotlight-pager li:eq(3) a').trigger('click');
		return false;
	});
	
	$('#ru-logo a').click(function() {
		$('#spotlight-pager li:eq(4) a').trigger('click');
		return false;
	});
	
	$('#epf-logo a').click(function() {
		$('#spotlight-pager li:eq(5) a').trigger('click');
		return false;
	});
			
});
