var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline = 0;
$(document).ready(function(){
  headline_count = $("div.news_headline").size();
  $("div.news_headline:eq("+current_headline+")").css('left', '10px');
  headline_interval = setInterval(headline_rotate,15000);
/*
  $('#scrollup').hover(function() {
 		clearInterval(headline_interval);
  }, function() {
 	headline_interval = setInterval(headline_rotate,15000);
 	headline_rotate();
  });*/
});

function headline_rotate() {
	current_headline = (old_headline + 1) % headline_count;
  	$("div.news_headline:eq(" + old_headline + ")").animate({left: -800},"slow", function() {
   		$(this).css('left', '800px');
		 });
  	$("div.news_headline:eq(" + current_headline + ")").animate({left: 10},8000);
  		old_headline = current_headline;
}