current_news = "";
news_on = 0;
current_news_id = 1;

//-----------------------------------------------------------------------------
// function showNews(<id to show>
function showNews(id)
{
	// if there is a currently highlighted item, hide it
	hideNews();

	// highlight identified short desc block
	document.getElementById("newsshort_" + id).className = 'content_on';
	document.getElementById("newsshort_" + id + "_connector").className = 'connector_on';
	
	// display identified long desc block
	document.getElementById("newslong_" + id).style.display = "block";
	
	current_news = id;
}


//-----------------------------------------------------------------------------
// function hideNews(<id to show>
function hideNews()
{
	if (current_news != "")
	{
		// un-highlight identified short desc block
		document.getElementById("newsshort_" + current_news).className = 'content_off';
		document.getElementById("newsshort_" + current_news + "_connector").className = 'connector_off';
		
		// hide identified long desc block
		document.getElementById("newslong_" + current_news).style.display = "none";
		
		current_news = "";
	}
}


//-----------------------------------------------------------------------------
// newsGoUrl(section, url, bucket, name, target)
function goNewsUrl(section, url, bucket, name, target)
{
	redir_url = "fsa_redir_" + section + ".asp?name=" + escape(name) + "&bucket=" + escape(bucket) + "&url=" + escape(url);

	if (target != "")
	{
		window.open(redir_url);
	}
	else if (url.search(/javascript\:/gi) != -1)
	{
		eval(url.replace(/javascript\:/gi, ""));
	}
	else
	{
		location.href = redir_url;
	}
}

//-----------------------------------------------------------------------------
// newsGoUrl2(section, url, bucket, name, target)
function goNewsUrl2(url, target)
{
	if (target == "_blank")
	{
		window.open(url);
	}
	else
	{
		location.href = url;
	}
}

//-----------------------------------------------------------------------------
// startRotate
function rotate()
{
	news_on = setTimeout("showNextNews()", 4000);
}

//-----------------------------------------------------------------------------
// stopRotate
function stopRotate()
{
	if (news_on != 0)
	{
		clearTimeout(news_on);
	}

	news_on = 0;
}


//-----------------------------------------------------------------------------
// showNextNews()
function showNextNews()
{
	current_news_id++;
	
	if (current_news_id > news_count)
	{
		current_news_id = 1;
	}

	showNews(current_news_id);
	rotate();
}

//-----------------------------------------------------------------------------
// homepage popup window
function directDepositWindow()
{
	window.open('fsa_direct_deposit.asp','directDeposit','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=500,height=273');
}