var newss_count;
var newss_interval;
var old_newss = 0;
var current_newss = 0;

$(document).ready(function()
{
	$('#news-ticker').load("ajax.asp",{action:'news'},function()
	{
		newss_count = $(".newss").size();

		$("div.newss:eq("+current_newss+")").css('top', '5px');
		newss_interval = setInterval(newss_rotate,10000);
		$('#news-ticker').hover(function() 
			{
			  clearInterval(newss_interval);
			}, function() 
			{
			  newss_interval = setInterval(newss_rotate,10000);
			  newss_rotate();
			});
	});

});

       

function newss_rotate() 
{

	current_newss = (old_newss + 1) % newss_count;
    $("div.newss:eq(" + old_newss + ")")
    .animate({top: -205},"slow", function() 
	{
        $(this).css('top', '210px');
     });

    $("div.newss:eq(" + current_newss + ")")
        .animate({top: 5},"slow");
   old_newss = current_newss;

}