var delay = 5000;
var count = 10;
var showing = 5;
var i = 0;
function move(i) {
   return function() {
      $('#recent_post_'+i).remove().css('display', 'none').prependTo('#recent_posts_list');
   }
}
function shift() {
   var toShow = (i + showing) % count;
   $('#recent_post_'+toShow).slideDown(1000, move(i));
   $('#recent_post_'+i).slideUp(1000, move(i));
   i = (i + 1) % count;
   setTimeout('shift()', delay);
}    
$(document).ready(function() {
   setTimeout('shift()', delay);
});
