﻿/*
* jQuery blockUI plugin
* Version 2.20 (19-MAY-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(g) { if (/1\.(0|1|2)\.(0|1|2)/.test(g.fn.jquery) || /^1.1/.test(g.fn.jquery)) { alert("blockUI requires jQuery v1.2.3 or later!  You are using v" + g.fn.jquery); return } g.fn._fadeIn = g.fn.fadeIn; var d = (function() { if (!g.browser.msie) { return false } var o = document.createElement("div"); try { o.style.setExpression("width", "0+0") } catch (n) { return false } return true })(); g.blockUI = function(n) { c(window, n) }; g.unblockUI = function(n) { h(window, n) }; g.growlUI = function(r, p, q, n) { var o = g('<div class="growlUI"></div>'); if (r) { o.append("<h1>" + r + "</h1>") } if (p) { o.append("<h2>" + p + "</h2>") } if (q == undefined) { q = 3000 } g.blockUI({ message: o, fadeIn: 700, fadeOut: 1000, centerY: false, timeout: q, showOverlay: false, onUnblock: n, css: g.blockUI.defaults.growlCSS }) }; g.fn.block = function(n) { return this.unblock({ fadeOut: 0 }).each(function() { if (g.css(this, "position") == "static") { this.style.position = "relative" } if (g.browser.msie) { this.style.zoom = 1 } c(this, n) }) }; g.fn.unblock = function(n) { return this.each(function() { h(this, n) }) }; g.blockUI.version = 2.2; g.blockUI.defaults = { message: "<h1>Please wait...</h1>", css: { padding: 0, margin: 0, width: "30%", top: "40%", left: "35%", textAlign: "center", color: "#000", border: "3px solid #aaa", backgroundColor: "#fff", cursor: "wait" }, overlayCSS: { backgroundColor: "#000", opacity: 0.6, cursor: "wait" }, growlCSS: { width: "350px", top: "10px", left: "", right: "10px", border: "none", padding: "5px", opacity: 0.6, cursor: null, 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: 1000, 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 e = g.browser.msie && /MSIE 6.0/.test(navigator.userAgent); var b = null; var f = []; function c(p, n) { var A = (p == window); var q = n && n.message !== undefined ? n.message : undefined; n = g.extend({}, g.blockUI.defaults, n || {}); n.overlayCSS = g.extend({}, g.blockUI.defaults.overlayCSS, n.overlayCSS || {}); var y = g.extend({}, g.blockUI.defaults.css, n.css || {}); q = q === undefined ? n.message : q; if (A && b) { h(window, { fadeOut: 0 }) } if (q && typeof q != "string" && (q.parentNode || q.jquery)) { var s = q.jquery ? q[0] : q; var x = {}; g(p).data("blockUI.history", x); x.el = s; x.parent = s.parentNode; x.display = s.style.display; x.position = s.style.position; if (x.parent) { x.parent.removeChild(s) } } var B = n.baseZ; var w = (g.browser.msie || n.forceIframe) ? g('<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="' + n.iframeSrc + '"></iframe>') : g('<div class="blockUI" style="display:none"></div>'); var v = g('<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>'); var r = A ? g('<div class="blockUI blockMsg blockPage" style="z-index:' + B + ';display:none;position:fixed"></div>') : g('<div class="blockUI blockMsg blockElement" style="z-index:' + B + ';display:none;position:absolute"></div>'); if (q) { r.css(y) } if (!n.applyPlatformOpacityRules || !(g.browser.mozilla && /Linux/.test(navigator.platform))) { v.css(n.overlayCSS) } v.css("position", A ? "fixed" : "absolute"); if (g.browser.msie || n.forceIframe) { w.css("opacity", 0) } g([w[0], v[0], r[0]]).appendTo(A ? "body" : p); var E = g.browser.msie && (g.browser.version < 8 || !g.boxModel) && (!g.boxModel || g("object,embed", A ? null : p).length > 0); if (e || (E && d)) { if (A && n.allowBodyStretch && g.boxModel) { g("html,body").css("height", "100%") } if ((e || !g.boxModel) && !A) { var F = k(p, "borderTopWidth"), u = k(p, "borderLeftWidth"); var D = F ? "(0 - " + F + ")" : 0; var o = u ? "(0 - " + u + ")" : 0 } g.each([w, v, r], function(t, I) { var z = I[0].style; z.position = "absolute"; if (t < 2) { A ? z.setExpression("height", "Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:" + n.quirksmodeOffsetHack + ') + "px"') : z.setExpression("height", 'this.parentNode.offsetHeight + "px"'); A ? z.setExpression("width", 'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') : z.setExpression("width", 'this.parentNode.offsetWidth + "px"'); if (o) { z.setExpression("left", o) } if (D) { z.setExpression("top", D) } } else { if (n.centerY) { if (A) { z.setExpression("top", '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"') } z.marginTop = 0 } else { if (!n.centerY && A) { var G = (n.css && n.css.top) ? parseInt(n.css.top) : 0; var H = "((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + " + G + ') + "px"'; z.setExpression("top", H) } } } }) } if (q) { r.append(q); if (q.jquery || q.nodeType) { g(q).show() } } if ((g.browser.msie || n.forceIframe) && n.showOverlay) { w.show() } if (n.fadeIn) { if (n.showOverlay) { v._fadeIn(n.fadeIn) } if (q) { r.fadeIn(n.fadeIn) } } else { if (n.showOverlay) { v.show() } if (q) { r.show() } } j(1, p, n); if (A) { b = r[0]; f = g(":input:enabled:visible", b); if (n.focusInput) { setTimeout(m, 20) } } else { a(r[0], n.centerX, n.centerY) } if (n.timeout) { var C = setTimeout(function() { A ? g.unblockUI(n) : g(p).unblock(n) }, n.timeout); g(p).data("blockUI.timeout", C) } } function h(q, r) { var p = q == window; var o = g(q); var s = o.data("blockUI.history"); var t = o.data("blockUI.timeout"); if (t) { clearTimeout(t); o.removeData("blockUI.timeout") } r = g.extend({}, g.blockUI.defaults, r || {}); j(0, q, r); var n = p ? g("body").children().filter(".blockUI") : g(".blockUI", q); if (p) { b = f = null } if (r.fadeOut) { n.fadeOut(r.fadeOut); setTimeout(function() { i(n, s, r, q) }, r.fadeOut) } else { i(n, s, r, q) } } function i(n, q, p, o) { n.each(function(r, s) { if (this.parentNode) { this.parentNode.removeChild(this) } }); if (q && q.el) { q.el.style.display = q.display; q.el.style.position = q.position; if (q.parent) { q.parent.appendChild(q.el) } g(q.el).removeData("blockUI.history") } if (typeof p.onUnblock == "function") { p.onUnblock(o, p) } } function j(n, r, s) { var q = r == window, p = g(r); if (!n && (q && !b || !q && !p.data("blockUI.isBlocked"))) { return } if (!q) { p.data("blockUI.isBlocked", n) } if (!s.bindEvents || (n && !s.showOverlay)) { return } var o = "mousedown mouseup keydown keypress"; n ? g(document).bind(o, s, l) : g(document).unbind(o, l) } function l(q) { if (q.keyCode && q.keyCode == 9) { if (b && q.data.constrainTabKey) { var p = f; var o = !q.shiftKey && q.target == p[p.length - 1]; var n = q.shiftKey && q.target == p[0]; if (o || n) { setTimeout(function() { m(n) }, 10); return false } } } if (g(q.target).parents("div.blockMsg").length > 0) { return true } return g(q.target).parents().children().filter("div.blockUI").length == 0 } function m(n) { if (!f) { return } var o = f[n === true ? f.length - 1 : 0]; if (o) { o.focus() } } function a(u, n, w) { var v = u.parentNode, r = u.style; var o = ((v.offsetWidth - u.offsetWidth) / 2) - k(v, "borderLeftWidth"); var q = ((v.offsetHeight - u.offsetHeight) / 2) - k(v, "borderTopWidth"); if (n) { r.left = o > 0 ? (o + "px") : "0" } if (w) { r.top = q > 0 ? (q + "px") : "0" } } function k(n, o) { return parseInt(g.css(n, o)) || 0 } })(jQuery);
$.blockUI.defaults.fadeIn = 0;