﻿jQuery(document).ready(function($){
  $('.scroller').each(function(){
    var lines = $('.line',this);
    var count = lines.size();
    var current = 0;
    var timer = null;
    var rotate = function(){
      lines.eq(current).slideUp('slow', function(){
        current += 1; if (current>=count) current = 0;
        lines.eq(current).slideDown('slow');
      });
    }
    $(this).hover(function() {
      clearInterval(timer);
    }, function() {
      timer = setInterval(rotate,8000);
      rotate();
    });
    lines.eq(current).slideDown('slow');
    timer = setInterval(rotate,8000);
  });
});