(function($) {
	$.fn.legalListify = function(options) {
	 	var opts = $.extend({}, $.fn.legalListify.defaults, options);

		return this.each(function() {
			$this = $(this);
		   	var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

		   	var maj = 1;
		   	$this.children("li").each(function() {
			   	$(this).prepend('<h2>' + maj + ". </h2>");
			   	var min = 1;
			   	$(this).children("ol").children("li").each(function() {
			   		$(this).prepend('<span class="legallist_num">' + maj + "." + min + ". </span>");
				   	var minmin = 1;
				   	$(this).children("ol").children("li").each(function() {
				   		$(this).prepend('<span class="legallist_num">' + maj + "." + min + "." + minmin++ + ". </span>");
				   	});
				   	min++;
			   	});
			   	maj++;
		   	});
	 	});
  	};
  	
  	$.fn.legalListify.defaults = {
 		style: 'numbered'
  	};

})(jQuery);