(function($) {
	$.fn.jqScroller = function(settings) {
		settings = $.extend({
			height: 175,
			speed: 75
	}, settings);

	var l1, l2, h, i, j, i, intervalID;
	return this.each(function(){
		l1 = $(this).find("ul");
		l2 = l1.clone().insertAfter(l1);
		
		h = Math.max(l1.height(), 200);
		i = 0;
		j = h;
		
		l2.css("margin-top", j);

		function loop(){
			l1.css("margin-top",i);
			l2.css("margin-top",j);
			i = i - 1;
			j = j - 1;
			
			if (i < (-h))
				i = j + h;
			if (j < (-h))
				j = i + h;
			return true;
		}
		
		function loop_stop(i){
			window.clearInterval(i);
			return true;
		}
		
		function loop_start(){
			var i = window.setInterval(loop, settings.speed);
			return i;
		}

		$(this).hover(function(){if (typeof(loop_stop) != 'undefined') loop_stop(intervalID);}, function(){if (typeof(loop_start) != 'undefined') intervalID = loop_start()});
		intervalID = loop_start();

	});
}
})(jQuery);