/*!
* jQuery blockUI plugin
* Version 2.39 (23-MAY-2011)
* @requires jQuery v1.2.3 or later
*
* Examples at: http://malsup.com/jquery/block/
* Copyright (c) 2007-2010 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(n){function h(e,o){var a=e==window,h=o&&o.message!==undefined?o.message:undefined,ot,st,d,w,ht,lt,ct,ut;o=n.extend({},n.blockUI.defaults,o||{}),o.overlayCSS=n.extend({},n.blockUI.defaults.overlayCSS,o.overlayCSS||{}),ot=n.extend({},n.blockUI.defaults.css,o.css||{}),st=n.extend({},n.blockUI.defaults.themedCSS,o.themedCSS||{}),h=h===undefined?o.message:h,a&&i&&u(window,{fadeOut:0}),h&&typeof h!="string"&&(h.parentNode||h.jquery)&&(d=h.jquery?h[0]:h,w={},n(e).data("blockUI.history",w),w.el=d,w.parent=d.parentNode,w.display=d.style.display,w.position=d.style.position,w.parent&&w.parent.removeChild(d)),n(e).data("blockUI.onUnblock",o.onUnblock);var b=o.baseZ,nt=n.browser.msie||o.forceIframe?n('<iframe class="blockUI" style="z-index:'+b+++';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+o.iframeSrc+'"></iframe>'):n('<div class="blockUI" style="display:none"></div>'),k=o.theme?n('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+b+++';display:none"></div>'):n('<div class="blockUI blockOverlay" style="z-index:'+b+++';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),p,g;g=o.theme&&a?'<div class="blockUI '+o.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(b+10)+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(o.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>':o.theme?'<div class="blockUI '+o.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(b+10)+';display:none;position:absolute"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(o.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>':a?'<div class="blockUI '+o.blockMsgClass+' blockPage" style="z-index:'+(b+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+o.blockMsgClass+' blockElement" style="z-index:'+(b+10)+';display:none;position:absolute"></div>',p=n(g),h&&(o.theme?(p.css(st),p.addClass("ui-widget-content")):p.css(ot)),o.theme||o.applyPlatformOpacityRules&&n.browser.mozilla&&/Linux/.test(navigator.platform)||k.css(o.overlayCSS),k.css("position",a?"fixed":"absolute"),(n.browser.msie||o.forceIframe)&&nt.css("opacity",0),ht=[nt,k,p],lt=a?n("body"):n(e),n.each(ht,function(){this.appendTo(lt)}),o.theme&&o.draggable&&n.fn.draggable&&p.draggable({handle:".ui-dialog-titlebar",cancel:"li"}),ct=v&&(!n.boxModel||n("object,embed",a?null:e).length>0);if(l||ct){a&&o.allowBodyStretch&&n.boxModel&&n("html,body").css("height","100%");if((l||!n.boxModel)&&!a)var et=r(e,"borderTopWidth"),tt=r(e,"borderLeftWidth"),it=et?"(0 - "+et+")":0,rt=tt?"(0 - "+tt+")":0;n.each([nt,k,p],function(n,t){var i=t[0].style,u,r;i.position="absolute",n<2?(a?i.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+o.quirksmodeOffsetHack+') + "px"'):i.setExpression("height",'this.parentNode.offsetHeight + "px"'),a?i.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):i.setExpression("width",'this.parentNode.offsetWidth + "px"'),rt&&i.setExpression("left",rt),it&&i.setExpression("top",it)):o.centerY?(a&&i.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),i.marginTop=0):!o.centerY&&a&&(u=o.css&&o.css.top?parseInt(o.css.top):0,r="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+u+') + "px"',i.setExpression("top",r))})}h&&(o.theme?p.find(".ui-widget-content").append(h):p.append(h),(h.jquery||h.nodeType)&&n(h).show()),(n.browser.msie||o.forceIframe)&&o.showOverlay&&nt.show();if(o.fadeIn){var ft=o.onBlock?o.onBlock:f,at=o.showOverlay&&!h?ft:f,vt=h?ft:f;o.showOverlay&&k._fadeIn(o.fadeIn,at),h&&p._fadeIn(o.fadeIn,vt)}else o.showOverlay&&k.show(),h&&p.show(),o.onBlock&&o.onBlock();c(1,e,o),a?(i=p[0],t=n(":input:enabled:visible",i),o.focusInput&&setTimeout(s,20)):y(p[0],o.centerX,o.centerY),o.timeout&&(ut=setTimeout(function(){a?n.unblockUI(o):n(e).unblock(o)},o.timeout),n(e).data("blockUI.timeout",ut))}function u(r,u){var o=r==window,e=n(r),h=e.data("blockUI.history"),s=e.data("blockUI.timeout"),f;s&&(clearTimeout(s),e.removeData("blockUI.timeout")),u=n.extend({},n.blockUI.defaults,u||{}),c(0,r,u),u.onUnblock===null&&(u.onUnblock=e.data("blockUI.onUnblock"),e.removeData("blockUI.onUnblock")),f=o?n("body").children().filter(".blockUI").add("body > .blockUI"):n(".blockUI",r),o&&(i=t=null),u.fadeOut?(f.fadeOut(u.fadeOut),setTimeout(function(){a(f,h,u,r)},u.fadeOut)):a(f,h,u,r)}function a(t,i,r,u){t.each(function(){this.parentNode&&this.parentNode.removeChild(this)}),i&&i.el&&(i.el.style.display=i.display,i.el.style.position=i.position,i.parent&&i.parent.appendChild(i.el),n(u).removeData("blockUI.history"));if(typeof r.onUnblock=="function")r.onUnblock(u,r)}function c(t,r,u){var e=r==window,s=n(r),f;if(!t&&(e&&!i||!e&&!s.data("blockUI.isBlocked")))return;e||s.data("blockUI.isBlocked",t);if(!u.bindEvents||t&&!u.showOverlay)return;f="mousedown mouseup keydown keypress",t?n(document).bind(f,u,o):n(document).unbind(f,o)}function o(r){var e;if(r.keyCode&&r.keyCode==9)if(i&&r.data.constrainTabKey){var u=t,o=!r.shiftKey&&r.target===u[u.length-1],f=r.shiftKey&&r.target===u[0];if(o||f)return setTimeout(function(){s(f)},10),!1}return e=r.data,n(r.target).parents("div."+e.blockMsgClass).length>0?!0:n(r.target).parents().children().filter("div.blockUI").length==0}function s(n){if(!t)return;var i=t[n===!0?t.length-1:0];i&&i.focus()}function y(n,t,i){var u=n.parentNode,o=n.style,e=(u.offsetWidth-n.offsetWidth)/2-r(u,"borderLeftWidth"),f=(u.offsetHeight-n.offsetHeight)/2-r(u,"borderTopWidth");t&&(o.left=e>0?e+"px":"0"),i&&(o.top=f>0?f+"px":"0")}function r(t,i){return parseInt(n.css(t,i))||0}var i,t;if(/1\.(0|1|2)\.(0|1|2)/.test(n.fn.jquery)||/^1.1/.test(n.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+n.fn.jquery);return}n.fn._fadeIn=n.fn.fadeIn;var f=function(){},e=document.documentMode||0,v=n.browser.msie&&(n.browser.version<8&&!e||e<8),l=n.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!e;n.blockUI=function(n){h(window,n)},n.unblockUI=function(n){u(window,n)},n.growlUI=function(t,i,r,u){var f=n('<div class="growlUI"></div>');t&&f.append("<h1>"+t+"</h1>"),i&&f.append("<h2>"+i+"</h2>"),r==undefined&&(r=3e3),n.blockUI({message:f,fadeIn:700,fadeOut:1e3,centerY:!1,timeout:r,showOverlay:!1,onUnblock:u,css:n.blockUI.defaults.growlCSS})},n.fn.block=function(t){return this.unblock({fadeOut:0}).each(function(){n.css(this,"position")=="static"&&(this.style.position="relative"),n.browser.msie&&(this.style.zoom=1),h(this,t)})},n.fn.unblock=function(n){return this.each(function(){u(this,n)})},n.blockUI.version=2.39,n.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,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","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,applyPlatformOpacityRules:!0,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"},i=null,t=[]})(jQuery)
