/*!
 * jQuery blockUI plugin
 * Version 2.29 (10-DEC-2009)
 * @requires jQuery v1.2.3 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2008 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */
(function(a){if(/1\.(0|1|2)\.(0|1|2)/.test(a.fn.jquery)||/^1.1/.test(a.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+a.fn.jquery);return}a.fn._fadeIn=a.fn.fadeIn;var f=document.documentMode||0,m=a.browser.msie&&(a.browser.version<8&&!f||f<8),l=a.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!f;a.blockUI=function(a){h(window,a)};a.unblockUI=function(a){e(window,a)};a.growlUI=function(e,d,b,f){var c=a('<div class="growlUI"></div>');e&&c.append("<h1>"+e+"</h1>");d&&c.append("<h2>"+d+"</h2>");if(b==undefined)b=3e3;a.blockUI({message:c,fadeIn:700,fadeOut:1e3,centerY:false,timeout:b,showOverlay:false,onUnblock:f,css:a.blockUI.defaults.growlCSS})};a.fn.block=function(b){return this.unblock({fadeOut:0}).each(function(){if(a.css(this,"position")=="static")this.style.position="relative";if(a.browser.msie)this.style.zoom=1;h(this,b)})};a.fn.unblock=function(a){return this.each(function(){e(this,a)})};a.blockUI.version=2.29;a.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1e3,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onUnblock:null,quirksmodeOffsetHack:4};var c=null,b=[];function h(o,f){var h=o==window,g=f&&f.message!==undefined?f.message:undefined;f=a.extend({},a.blockUI.defaults,f||{});f.overlayCSS=a.extend({},a.blockUI.defaults.overlayCSS,f.overlayCSS||{});var C=a.extend({},a.blockUI.defaults.css,f.css||{}),y=a.extend({},a.blockUI.defaults.themedCSS,f.themedCSS||{});g=g===undefined?f.message:g;h&&c&&e(window,{fadeOut:0});if(g&&typeof g!="string"&&(g.parentNode||g.jquery)){var r=g.jquery?g[0]:g,p={};a(o).data("blockUI.history",p);p.el=r;p.parent=r.parentNode;p.display=r.style.display;p.position=r.style.position;p.parent&&p.parent.removeChild(r)}var s=f.baseZ,t=a.browser.msie||f.forceIframe?a('<iframe class="blockUI" style="z-index:'+s+++';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+f.iframeSrc+'"></iframe>'):a('<div class="blockUI" style="display:none"></div>'),q=a('<div class="blockUI blockOverlay" style="z-index:'+s+++';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),j;if(f.theme&&h){var E='<div class="blockUI blockMsg blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+s+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(f.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>';j=a(E)}else j=h?a('<div class="blockUI blockMsg blockPage" style="z-index:'+s+';display:none;position:fixed"></div>'):a('<div class="blockUI blockMsg blockElement" style="z-index:'+s+';display:none;position:absolute"></div>');if(g)if(f.theme){j.css(y);j.addClass("ui-widget-content")}else j.css(C);(!f.applyPlatformOpacityRules||!(a.browser.mozilla&&/Linux/.test(navigator.platform)))&&q.css(f.overlayCSS);q.css("position",h?"fixed":"absolute");(a.browser.msie||f.forceIframe)&&t.css("opacity",0);var z=[t,q,j],A=h?a("body"):a(o);a.each(z,function(){this.appendTo(A)});f.theme&&f.draggable&&a.fn.draggable&&j.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var B=m&&(!a.boxModel||a("object,embed",h?null:o).length>0);if(l||B){h&&f.allowBodyStretch&&a.boxModel&&a("html,body").css("height","100%");if((l||!a.boxModel)&&!h)var x=d(o,"borderTopWidth"),w=d(o,"borderLeftWidth"),v=x?"(0 - "+x+")":0,u=w?"(0 - "+w+")":0;a.each([t,q,j],function(d,e){var a=e[0].style;a.position="absolute";if(d<2){h?a.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+f.quirksmodeOffsetHack+') + "px"'):a.setExpression("height",'this.parentNode.offsetHeight + "px"');h?a.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):a.setExpression("width",'this.parentNode.offsetWidth + "px"');u&&a.setExpression("left",u);v&&a.setExpression("top",v)}else if(f.centerY){h&&a.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');a.marginTop=0}else if(!f.centerY&&h){var c=f.css&&f.css.top?parseInt(f.css.top):0,b="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+c+') + "px"';a.setExpression("top",b)}})}if(g){if(f.theme)j.find(".ui-widget-content").append(g);else j.append(g);(g.jquery||g.nodeType)&&a(g).show()}(a.browser.msie||f.forceIframe)&&f.showOverlay&&t.show();if(f.fadeIn){f.showOverlay&&q._fadeIn(f.fadeIn);g&&j._fadeIn(f.fadeIn)}else{f.showOverlay&&q.show();g&&j.show()}k(1,o,f);if(h){c=j[0];b=a(":input:enabled:visible",c);f.focusInput&&setTimeout(i,20)}else n(j[0],f.centerX,f.centerY);if(f.timeout){var D=setTimeout(function(){h?a.unblockUI(f):a(o).unblock(f)},f.timeout);a(o).data("blockUI.timeout",D)}}function e(e,d){var i=e==window,g=a(e),h=g.data("blockUI.history"),l=g.data("blockUI.timeout");if(l){clearTimeout(l);g.removeData("blockUI.timeout")}d=a.extend({},a.blockUI.defaults,d||{});k(0,e,d);var f;if(i)f=a("body").children().filter(".blockUI").add("body > .blockUI");else f=a(".blockUI",e);if(i)c=b=null;if(d.fadeOut){f.fadeOut(d.fadeOut);setTimeout(function(){j(f,h,d,e)},d.fadeOut)}else j(f,h,d,e)}function j(e,b,c,d){e.each(function(){this.parentNode&&this.parentNode.removeChild(this)});if(b&&b.el){b.el.style.display=b.display;b.el.style.position=b.position;b.parent&&b.parent.appendChild(b.el);a(d).removeData("blockUI.history")}if(typeof c.onUnblock=="function")c.onUnblock(d,c)}function k(b,i,e){var d=i==window,h=a(i);if(!b&&(d&&!c||!d&&!h.data("blockUI.isBlocked")))return;!d&&h.data("blockUI.isBlocked",b);if(!e.bindEvents||b&&!e.showOverlay)return;var f="mousedown mouseup keydown keypress";b?a(document).bind(f,e,g):a(document).unbind(f,g)}function g(d){if(d.keyCode&&d.keyCode==9)if(c&&d.data.constrainTabKey){var e=b,g=!d.shiftKey&&d.target==e[e.length-1],f=d.shiftKey&&d.target==e[0];if(g||f){setTimeout(function(){i(f)},10);return false}}return a(d.target).parents("div.blockMsg").length>0?true:a(d.target).parents().children().filter("div.blockUI").length==0}function i(c){if(!b)return;var a=b[c===true?b.length-1:0];a&&a.focus()}function n(a,g,h){var b=a.parentNode,e=a.style,c=(b.offsetWidth-a.offsetWidth)/2-d(b,"borderLeftWidth"),f=(b.offsetHeight-a.offsetHeight)/2-d(b,"borderTopWidth");if(g)e.left=c>0?c+"px":"0";if(h)e.top=f>0?f+"px":"0"}function d(b,c){return parseInt(a.css(b,c))||0}})(jQuery)