// JavaScript Document
jQuery.easing.def = "easeOutExpo";

$(document).ready(function()
{
    $('div.podcasts').find('div.entry').hide();
	
	initNews();
});

// News Scroller
function initNews()
{
	var s = 0;
	
	$('img.down').click(function()
	{
		if(s < $('div.newsEntry').length-3)
		{
			if(s == 0) 
			{
				$('img.up').fadeTo(250, 1);
			}
			
			sHeight = Number($('div.newsEntry:eq(' + s + ')').outerHeight()) + 2;

			$('div.newsSlider').animate({"top": "-=" + sHeight + "px"}, "easeOut");
			s++;
			
			if(s == $('div.newsEntry').length-3)
			{
				$(this).fadeTo(250, .5);
			}
		}
	});
	
	$('img.up').click(function()
	{
		if(s > 0)
		{
			if(s == $('div.newsEntry').length-3)
			{
				$('img.down').fadeTo(250, 1);
			}
			
			sHeight = Number($('div.newsEntry:eq(' + s + ')').outerHeight()) + 2;

			$('div.newsSlider').animate({"top": "+=" + sHeight + "px"}, "easeOut");
			s--;
			
			if(s == 0)
			{
				$(this).fadeTo(250, .5);
			}
		}
	})
		.fadeTo(250, .5);	
}