var qlib={};
qlib.tips=function(params){
	$("#qlib_tips").remove();
		if(typeof(params)!="object"){param={};if(typeof(params)=="string"){param.msg=params;} }else{
			param = params;
		}
		if(!param.icon){param.icon='warn';}
		if(!param.msg){param.msg='正在处理，请稍候';}
		if(typeof(param.timer)=="undefined"){param.timer=1000;}
		if(typeof(param.modal)=="undefined" || (param.modal!=false &&  param.modal!=true)){param.modal = true;}
		if(param.modal==true){ qlib.modal.show(); }
		param.icon = 'WB_icon_'+param.icon;
		$('body').append('<div style="left: 50%; top: 170px; margin-left: -84px; z-index: 100000;" id="qlib_tips" class="WB_tips_wait"><span class="WB_icon '+param.icon+'"></span><span class="WB_icon_txt">'+param.msg+'</span>');
	var top = $(window).scrollTop()+170;
	$("#qlib_tips").css({top:top});
	if(parseInt(param.timer,10)>=0){
		setTimeout(function(){
			$("#qlib_tips").remove();
			qlib.modal.close();
		},param.timer);
	}
}
qlib.modal={
	show:function(){
		if($("#modal_layer").length>0){$("#modal_layer").remove();}
		var val = $('<div style="left: 0px; top: 0px; width: 100%; height: 100%; filter: alpha(opacity=30);opacity:0.3 ;position: fixed; z-index: 99995; background-image: none; background-attachment: scroll; background-repeat: repeat; background-position-x: 0%; background-position-y: 0%; background-size: auto; background-origin: padding-box; background-clip: border-box; background-color: rgb(0, 0, 0);" node-type="outer" id="modal_layer"></div>');
		val.click(function(){
			$("#modal_layer").remove();$("#qlib_tips").remove();
		});
		$('body').append(val);
	},
	close:function(){
		$("#modal_layer").remove();
	}
}