;(function($){
	$.fn.extend({
		"bz_tree":function(options){
			var opt=$.extend({},$.fn.bz_tree.defaults,options);
			$("ul:empty").remove();
			$(this).each(function(){
				$(this).find("li").each(function(){
					if($(this).is(":has(ul)"))
					{
						if(opt.is_expand)
						{
							$(this).find("ul").show();
							$(this).find("span").addClass("ui-tx-expand");
						}	
						else
						{
							$(this).find("ul").hide();
							$(this).find("span").addClass("ui-tx-plus");
						}
					}
					else
					{
						$(this).find("span").addClass("ui-tx-expand");
					}	
			   });
			});
			$(this).find("span").click(function(event){
				var jQueryul = $(this).next("ul");
				if(jQueryul.is(":visible")){
					$(this).removeClass("ui-tx-expand").addClass("ui-tx-plus");
					jQueryul.hide();
				}else{
					$(this).removeClass("ui-tx-plus").addClass("ui-tx-expand");
					jQueryul.show();
				}
				event.stopPropagation();    //  阻止事件冒泡
				//return false;
		   });
		}
	});
	$.fn.bz_tree.defaults={
		is_expand:true//是否默认展开
	};
})(jQuery);
