var itemHeight = 44; // px
var itemNb = 10;
var visibleItems = 6;

var newsboxInterval;
var curItem = 0;

$(document).ready(function(){
  if($("div.news-box-items") && $("div.news-box-items").length)
  {
    newsboxInterval = setInterval(itemsRotate, 2500);
  }
});

function itemsRotate() {
  //alert(curItem);
  curItem += 1;
  $("div.news-box-items:first").animate({top: "-" + itemHeight * curItem + "px"}, 500, "linear", function() {
    if(curItem >= itemNb)
    {
      //clearInterval(newsboxInterval);
      curItem = 0;
      $(this).css('top', '0px');
    }
  });
}
