(function(a){a.blockui=function(d,b,c){a.blockui.impl.install(window,d,b,c);
};
a.blockui.version=1.33;
a.unblockui=function(b){a.blockui.impl.remove(window,b);
};
a.fn.block=function(d,b,c){return this.each(function(){if(!this.$pos_checked){if(a.css(this,"position")=="static"){this.style.position="relative";
}if(a.browser.msie){this.style.zoom=1;
}this.$pos_checked=1;
}a.blockui.impl.install(this,d,b,c);
});
};
a.fn.unblock=function(b){return this.each(function(){a.blockui.impl.remove(this,b);
});
};
a.fn.displayBox=function(l,m,j){var e=this[0];
if(!e){return;
}var o=a(e);
l=l||{};
var n=o.width()||o.attr("width")||l.width||a.blockui.defaults.displayBoxCSS.width;
var k=o.height()||o.attr("height")||l.height||a.blockui.defaults.displayBoxCSS.height;
if(n[n.length-1]=="%"){var i=document.documentElement.clientWidth||document.body.clientWidth;
n=parseInt(n)||100;
n=(n*i)/100;
}if(k[k.length-1]=="%"){var f=document.documentElement.clientHeight||document.body.clientHeight;
k=parseInt(k)||100;
k=(k*f)/100;
}var g="-"+parseInt(n)/2+"px";
var c="-"+parseInt(k)/2+"px";
var d=navigator.userAgent.toLowerCase();
var b={displayMode:m||1,noalpha:j&&/mac/.test(d)&&/firefox/.test(d)};
a.blockui.impl.install(window,e,{width:n,height:k,marginTop:c,marginLeft:g},b);
};
a.blockui.defaults={pageMessage:"<h1>Please wait...</h1>",elementMessage:"",overlayCSS:{backgroundColor:"#fff",opacity:"0.5"},pageMessageCSS:{width:"250px",margin:"-50px 0 0 -125px",top:"50%",left:"50%",textAlign:"center",color:"#000",backgroundColor:"#fff",border:"3px solid #aaa","min-height":"80px"},elementMessageCSS:{width:"250px",padding:"10px",textAlign:"center",backgroundColor:"#fff"},displayBoxCSS:{width:"400px",height:"400px",top:"50%",left:"50%"},ie6Stretch:1,allowTabToLeave:0,closeMessage:"Click to close",fadeOut:1,fadeTime:400};
a.blockui.impl={box:null,boxCallback:null,pageBlock:null,pageBlockEls:[],op8:window.opera&&window.opera.version()<9,ie6:a.browser.msie&&/MSIE 6.0/.test(navigator.userAgent),install:function(d,e,i,b){b=b||{};
this.boxCallback=typeof b.displayMode=="function"?b.displayMode:null;
this.box=b.displayMode?e:null;
var k=(d==window);
var r=this.op8||a.browser.mozilla&&/Linux/.test(navigator.platform);
if(typeof b.alphaOverride!="undefined"){r=b.alphaOverride==0?1:0;
}if(k&&this.pageBlock){this.remove(window,{fadeOut:0});
}if(e&&typeof e=="object"&&!e.jquery&&!e.nodeType){i=e;
e=null;
}e=e?(e.nodeType?a(e):e):k?a.blockui.defaults.pageMessage:a.blockui.defaults.elementMessage;
if(b.displayMode){var s=jQuery.extend({},a.blockui.defaults.displayBoxCSS);
}else{var s=jQuery.extend({},k?a.blockui.defaults.pageMessageCSS:a.blockui.defaults.elementMessageCSS);
}i=jQuery.extend(s,i||{});
var j=(a.browser.msie)?a('<iframe class="blockui" style="z-index:1000;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>'):a('<div class="blockui" style="display:none"></div>');
var p=a('<div class="blockui" style="z-index:1001;cursor:wait;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
var g=k?a('<div class="blockui blockMsg" id="poping" style="z-index:1002;cursor:wait;padding:0;position:fixed"></div>'):a('<div class="blockui" id="poping" style="display:none;z-index:1002;cursor:wait;position:absolute"></div>');
p.css("position",k?"fixed":"absolute");
if(e){g.css(i);
}if(!r){p.css(a.blockui.defaults.overlayCSS);
}if(this.op8){p.css({width:""+d.clientWidth,height:""+d.clientHeight});
}if(a.browser.msie){j.css("opacity","0.0");
}a(k?"body":d).append(j[0]).append(p[0]).append(g[0]);
var o=a.browser.msie&&(!a.boxModel||a("object,embed",k?null:d).length>0);
if(this.ie6||o){if(k&&a.blockui.defaults.ie6Stretch&&a.boxModel){a("html,body").css("height","100%");
}if((this.ie6||!a.boxModel)&&!k){var q=this.sz(d,"borderTopWidth"),h=this.sz(d,"borderLeftWidth");
var n=q?"(0 - "+q+")":0;
var c=h?"(0 - "+h+")":0;
}a.each([j,p,g],function(f,m){var l=m[0].style;
l.position="absolute";
if(f<2){k?l.setExpression("height",'document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"'):l.setExpression("height",'this.parentNode.offsetHeight + "px"');
k?l.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):l.setExpression("width",'this.parentNode.offsetWidth + "px"');
if(c){l.setExpression("left",c);
}if(n){l.setExpression("top",n);
}}else{if(k){l.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
}l.marginTop=0;
}});
}if(b.displayMode){p.css("cursor","default").attr("title",a.blockui.defaults.closeMessage);
g.css("cursor","default");
a([j[0],p[0],g[0]]).removeClass("blockui").addClass("displayBox");
a().click(a.blockui.impl.boxHandler).bind("keypress",a.blockui.impl.boxHandler);
}else{this.bind(1,d);
}g.append(e).show();
if(e.jquery){e.show();
}if(b.displayMode){return;
}if(k){this.pageBlock=g[0];
this.pageBlockEls=a(":input:enabled:visible",this.pageBlock);
this.abscenter(g[0]);
setTimeout(this.focus,20);
}else{this.center(g[0]);
}},remove:function(d,e){var f=a.extend({},a.blockui.defaults,e);
this.bind(0,d);
var c=d==window;
var b=c?a(".blockui"):a(".blockui",d);
if(!b){b=a(".blockui");
}if(c){this.pageBlock=this.pageBlockEls=null;
}if(f.fadeOut){b.fadeOut(f.fadeTime,function(){if(this.parentNode){this.parentNode.removeChild(this);
}else{b.remove();
}});
}else{b.remove();
}},boxRemove:function(b){a().unbind("click",a.blockui.impl.boxHandler).unbind("keypress",a.blockui.impl.boxHandler);
if(this.boxCallback){this.boxCallback(this.box);
}a("body .displayBox").hide().remove();
},handler:function(f){if(f.keyCode&&f.keyCode==9){if(a.blockui.impl.pageBlock&&!a.blockui.defaults.allowTabToLeave){var d=a.blockui.impl.pageBlockEls;
var c=!f.shiftKey&&f.target==d[d.length-1];
var b=f.shiftKey&&f.target==d[0];
if(c||b){setTimeout(function(){a.blockui.impl.focus(b);
},10);
return false;
}}}if(a(f.target).parents("div.blockMsg").length>0){return true;
}return a(f.target).parents().children().filter("div.blockui").length==0;
},boxHandler:function(b){if((b.keyCode&&b.keyCode==27)||(b.type=="click"&&a(b.target).parents("div.blockMsg").length==0)){a.blockui.impl.boxRemove();
}return true;
},bind:function(c,f){var e=f==window;
if(!c&&(e&&!this.pageBlock||!e&&!f.$blocked)){return;
}if(!e){f.$blocked=c;
}var d=a(f).find("a,:input");
a.each(["mousedown","mouseup","keydown","keypress","click"],function(b,g){d[c?"bind":"unbind"](g,a.blockui.impl.handler);
});
},focus:function(b){if(!a.blockui.impl.pageBlockEls){return;
}var c=a.blockui.impl.pageBlockEls[b===true?a.blockui.impl.pageBlockEls.length-1:0];
if(c){c.focus();
}},center:function(e){var f=e.parentNode,d=e.style;
var b=((f.offsetWidth-e.offsetWidth)/2)-this.sz(f,"borderLeftWidth");
var c=((f.offsetHeight-e.offsetHeight)/2)-this.sz(f,"borderTopWidth");
d.left=b>0?(b+"px"):"0";
d.top=c>0?(c+"px"):"0";
},abscenter:function(c){a("#blockuititle",c).width(a.boxModel?"100%":"99%");
var j;
try{j=top.document||document;
}catch(h){j=document;
}var k=j.body.scrollHeight;
var f=j.body.clientHeight;
var b=j.body.clientWidth;
var d=j.body.scrollTop?j.body.scrollTop:j.documentElement.scrollTop;
var g=(window.screen.height-c.offsetHeight)/2+d-100;
var i=(b-c.offsetWidth)/2;
c.style.left=i>0?(i+"px"):"0";
c.style.top=g>0?(g+"px"):"0";
c.style["margin-top"]=0;
c.style["margin-left"]=0;
a("#popmaininfo").height(c.offsetHeight>80?c.offsetHeight-40:45);
},sz:function(b,c){return parseInt(a.css(b,c))||0;
}};
})(jQuery);
