﻿var headline_count;
var current_headline=0;

$(document).ready(function(){
  headline_count = $("li.headline").size();
  $("li.headline:eq("+current_headline+")").css('top', '5px');
  setInterval(headline_rotate,5000); //time in milliseconds
});

function headline_rotate() {
  old_headline = current_headline % headline_count;
  new_headline = ++current_headline % headline_count;
  $("li.headline:eq(" + old_headline + ")").css('top', '70px');
  $("li.headline:eq(" + new_headline + ")").show().animate({top: 5},"medium");     
}