 var headline_count;
 var headline_interval;
 var old_headline = 0;
 var current_headline;
 
 $(document).ready(function(){
   headline_count = $("div.onetopvidefeed").size();
   current_headline = Math.floor(Math.random()*headline_count);
   old_headline = current_headline;
   $("div.onetopvidefeed:eq("+current_headline+")").css('top','0px');
 
   headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
   $('#topvideofeed').hover(function() {
     clearInterval(headline_interval);
   }, function() {
     headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
   });
 });
 
 function headline_rotate() {
   while (current_headline == old_headline)
   {
	current_headline = Math.floor(Math.random()*headline_count);
   }
   $("div.onetopvidefeed:eq(" + old_headline + ")").animate({top: -40},"slow", function() {
     $(this).css('top','60px');
   });
   $("div.onetopvidefeed:eq(" + current_headline + ")").show().animate({top: 0},"slow");  
   old_headline = current_headline;
 }