// JavaScript by PrizeByte

$(function(){
	$("#news p").each(function(){
		zy.pararr.push($(this).html());
	});
	$("#news").html("<div id='nscroll' style='position:relative;top:16px;width:540px;height:50px;overflow:hidden;font-size:1.1em;'></div>");
	zy.totpar = zy.pararr.length;
	for(var i = 0; i < zy.totpar; i++) $("#nscroll").append(zy.newSliderHtml(zy.pararr[i]));
	$("#nscroll div.ncont").eq(zy.curpar).css('top', '0');
	zy.oldpar = zy.curpar;
	zy.parint = setInterval(zy.nextNews, 8000);
	$('#nscroll').hover(function(){
		clearInterval(zy.parint);
		}, function(){
		zy.parint = setInterval(zy.nextNews, 8000); 
		zy.nextNews();
	});
});


var zy = new Object;
zy.pararr = [];
zy.oldpar = 0;
zy.curpar = 0;
zy.totpar = 0;
zy.parint = 0;

zy.newSliderHtml = function(s){
	return("<div class='ncont' style='position:absolute;top:50px'>" + s + "</div>");
};
zy.nextNews = function(){
	zy.curpar = (zy.oldpar + 1) % zy.totpar;
	$("#nscroll div.ncont:eq(" + zy.oldpar + ")")
    .animate({top:'-50px'},"slow", "linear", function() {
      $(this).css('top', '50px');
    });
  $("#nscroll div.ncont:eq(" + zy.curpar + ")")
    .animate({top: '0'},"slow");
	zy.oldpar = zy.curpar;
};