$(document).ready(function() {
  $('.scroll-box').bind('marquee', function() {
    var boxWidth = $(this).width();
    var textWidth = $('.scroll-text', $(this)).width();
    if (textWidth > boxWidth) {
      var animSpeed = (textWidth - boxWidth) * 7;
      $(this)
        .animate({scrollLeft: textWidth - boxWidth}, animSpeed, "linear", function() {
        	$(this).animate({scrollLeft: 0}, -1);
        	$("ul li:first-child", $(this)).css("margin-left", "894px");
        	$(this).trigger('marquee');
        })
        .hover(
        	function () {
        		$(this).stop();
	        }, 
	        function () {
	        	$(this).animate({scrollLeft: textWidth - boxWidth}, animSpeed, "linear", function() {
	            	$(this).animate({scrollLeft: 0}, -1);
	            	$("ul li:first-child", $(this)).css("margin-left", "894px");
	            	$(this).trigger('marquee');
	            });
	        }
	    );
    }
  }).trigger('marquee');
});