!function(a){window.JP={},JP.f_cancel=function(){var a=parent||window;a.closeCurrentTab(null)},JP.f_heightChanged=function(a){tab&&tab.addHeight(a.diff),accordion&&a.middleHeight-24>0&&accordion.setHeight(a.middleHeight-24)},JP.f_addTab=function(a,b,c){tab.addTabItem({tabid:a,text:b,url:c})},JP.closeCurrentTab=function(b){b||(b=a("#framecenter > .l-tab-content > .l-tab-content-item:visible").attr("tabid")),tab&&tab.removeTabItem(b)},JP.closeAndReloadParent=function(b,c){var d,e,f;JP.closeCurrentTab(b),d=a("#mainmenu ul.menulist li[menuno="+c+"]"),e=d.attr("tabid"),f=window.frames[e],tab&&tab.selectTabItem(e),f&&f.f_reload?f.f_reload():tab&&tab.reload(e)},JP.overrideGridLoading=function(){a.extend(a.ligerDefaults.Grid,{onloading:function(){LG.showLoading("正在加载表格数据中...")},onloaded:function(){LG.hideLoading()}})},JP.showLoading=function(b){b=b||"正在加载中...",a("body").append("<div class='jloading'>"+b+"</div>"),a.ligerui.win.mask()},JP.hideLoading=function(){a("body > div.jloading").remove(),a.ligerui.win.unmask({id:(new Date).getTime()})},JP.encodeHTML=function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\\/g,"&#92;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")},JP.ajax=function(b){var c=b||{},d=c.url;a.ajax({cache:!1,async:!0,url:d,data:c.data,dataType:"json",type:"post",beforeSend:function(){JP.loading=!0,c.beforeSend?c.beforeSend():JP.showLoading(c.loading)},complete:function(){JP.loading=!1,c.complete?c.complete():JP.hideLoading()},success:function(a){1==a.status?c.success():c.error()}})}}(jQuery);