﻿
var g_i15BWhatsNewLinkCount = Number(0);
var g_i15BWhatsNewTimerID = Number(0);
var g_i15BWhatsNewCurrent = Number(1);

function f15BStartWhatsNew() {
	// How many links are there?
	g_i15BWhatsNewLinkCount = jQuery('#whats-new a').length;

	// Show the first link
	jQuery('#whats-new-link-1').fadeIn("normal");
	
	// Resume the slideshow
	f15BResumeWhatsNew();
}

function f15BPauseWhatsNew() {
	// Clear the timer if any
	clearTimeout(g_i15BWhatsNewTimerID);
}

function f15BResumeWhatsNew() {
	// Clear the timer if any
	clearTimeout(g_i15BWhatsNewTimerID);
	// Set the new timer
	g_i15BWhatsNewTimerID = setTimeout('f15BNextWhatsNew()', 5000);
}

function f15BNextWhatsNew() {
	// Hide the old link
	jQuery('#whats-new-link-'+g_i15BWhatsNewCurrent).fadeOut("normal", f15BFadedOutWhatsNew);
	
	// Increment the counter
	g_i15BWhatsNewCurrent = (g_i15BWhatsNewCurrent + 1);
	if ( g_i15BWhatsNewCurrent > g_i15BWhatsNewLinkCount ) {
		g_i15BWhatsNewCurrent = 1;
	}
}

function f15BFadedOutWhatsNew() {
	// Show the new link
	jQuery('#whats-new-link-'+g_i15BWhatsNewCurrent).fadeIn("normal", f15BFadedInWhatsNew);
}

function f15BFadedInWhatsNew() {
	// Resume the slideshow
	f15BResumeWhatsNew();
}