jQuery.fn.showLoading=function(n){var s,t={addClass:"",beforeShow:"",afterShow:"",hPos:"center",vPos:"center",indicatorZIndex:5001,overlayZIndex:5e3,parent:"",marginTop:0,marginLeft:0,overlayWidth:null,overlayHeight:null},i,r,a,v,e,o,h,c,u,f,l;return jQuery.extend(t,n),i=jQuery("<div><\/div>"),r=jQuery("<div><\/div>"),s=t.indicatorID?t.indicatorID:jQuery(this).attr("id"),jQuery(i).attr("id","loading-indicator-"+s),jQuery(i).addClass("loading-indicator"),t.addClass&&jQuery(i).addClass(t.addClass),jQuery(r).css("display","none"),jQuery(document.body).append(r),jQuery(r).attr("id","loading-indicator-"+s+"-overlay"),jQuery(r).addClass("loading-indicator-overlay"),t.addClass&&jQuery(r).addClass(t.addClass+"-overlay"),e=jQuery(this).css("border-top-width"),o=jQuery(this).css("border-left-width"),e=isNaN(parseInt(e))?0:e,o=isNaN(parseInt(o))?0:o,h=jQuery(this).offset().left+parseInt(o),c=jQuery(this).offset().top+parseInt(e),a=t.overlayWidth!==null?t.overlayWidth:parseInt(jQuery(this).width())+parseInt(jQuery(this).css("padding-right"))+parseInt(jQuery(this).css("padding-left")),v=t.overlayHeight!==null?t.overlayWidth:parseInt(jQuery(this).height())+parseInt(jQuery(this).css("padding-top"))+parseInt(jQuery(this).css("padding-bottom")),jQuery(r).css("width",a.toString()+"px"),jQuery(r).css("height",v.toString()+"px"),jQuery(r).css("left",h.toString()+"px"),jQuery(r).css("position","absolute"),jQuery(r).css("top",c.toString()+"px"),jQuery(r).css("z-index",t.overlayZIndex),t.overlayCSS&&jQuery(r).css(t.overlayCSS),jQuery(i).css("display","none"),jQuery(document.body).append(i),jQuery(i).css("position","absolute"),jQuery(i).css("z-index",t.indicatorZIndex),u=c,t.marginTop&&(u+=parseInt(t.marginTop)),f=h,t.marginLeft&&(f+=parseInt(t.marginTop)),t.hPos.toString().toLowerCase()=="center"?jQuery(i).css("left",(f+(jQuery(r).width()-parseInt(jQuery(i).width()))/2).toString()+"px"):t.hPos.toString().toLowerCase()=="left"?jQuery(i).css("left",(f+parseInt(jQuery(r).css("margin-left"))).toString()+"px"):t.hPos.toString().toLowerCase()=="right"?jQuery(i).css("left",(f+(jQuery(r).width()-parseInt(jQuery(i).width()))).toString()+"px"):jQuery(i).css("left",(f+parseInt(t.hPos)).toString()+"px"),t.vPos.toString().toLowerCase()=="center"?jQuery(i).css("top",(u+(jQuery(r).height()-parseInt(jQuery(i).height()))/2).toString()+"px"):t.vPos.toString().toLowerCase()=="top"?jQuery(i).css("top",u.toString()+"px"):t.vPos.toString().toLowerCase()=="bottom"?jQuery(i).css("top",(u+(jQuery(r).height()-parseInt(jQuery(i).height()))).toString()+"px"):jQuery(i).css("top",(u+parseInt(t.vPos)).toString()+"px"),t.css&&jQuery(i).css(t.css),l={overlay:r,indicator:i,element:this},typeof t.beforeShow=="function"&&t.beforeShow(l),jQuery(r).show(),jQuery(i).show(),typeof t.afterShow=="function"&&t.afterShow(l),this};jQuery.fn.hideLoading=function(n){var t={};return jQuery.extend(t,n),indicatorID=t.indicatorID?t.indicatorID:jQuery(this).attr("id"),jQuery(document.body).find("#loading-indicator-"+indicatorID).remove(),jQuery(document.body).find("#loading-indicator-"+indicatorID+"-overlay").remove(),this}