/*
* jQuery UI 1.8
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI
*/
jQuery.ui || (function(a) { a.ui = { version: "1.8", plugin: { add: function(c, d, f) { var e = a.ui[c].prototype; for (var b in f) { e.plugins[b] = e.plugins[b] || []; e.plugins[b].push([d, f[b]]) } }, call: function(b, d, c) { var f = b.plugins[d]; if (!f || !b.element[0].parentNode) { return } for (var e = 0; e < f.length; e++) { if (b.options[f[e][0]]) { f[e][1].apply(b.element, c) } } } }, contains: function(d, c) { return document.compareDocumentPosition ? d.compareDocumentPosition(c) & 16 : d !== c && d.contains(c) }, hasScroll: function(e, c) { if (a(e).css("overflow") == "hidden") { return false } var b = (c && c == "left") ? "scrollLeft" : "scrollTop", d = false; if (e[b] > 0) { return true } e[b] = 1; d = (e[b] > 0); e[b] = 0; return d }, isOverAxis: function(c, b, d) { return (c > b) && (c < (b + d)) }, isOver: function(g, c, f, e, b, d) { return a.ui.isOverAxis(g, f, b) && a.ui.isOverAxis(c, e, d) }, keyCode: { BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38} }; a.fn.extend({ _focus: a.fn.focus, focus: function(b, c) { return typeof b === "number" ? this.each(function() { var d = this; setTimeout(function() { a(d).focus(); (c && c.call(d)) }, b) }) : this._focus.apply(this, arguments) }, enableSelection: function() { return this.attr("unselectable", "off").css("MozUserSelect", "").unbind("selectstart.ui") }, disableSelection: function() { return this.attr("unselectable", "on").css("MozUserSelect", "none").bind("selectstart.ui", function() { return false }) }, scrollParent: function() { var b; if ((a.browser.msie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) { b = this.parents().filter(function() { return (/(relative|absolute|fixed)/).test(a.curCSS(this, "position", 1)) && (/(auto|scroll)/).test(a.curCSS(this, "overflow", 1) + a.curCSS(this, "overflow-y", 1) + a.curCSS(this, "overflow-x", 1)) }).eq(0) } else { b = this.parents().filter(function() { return (/(auto|scroll)/).test(a.curCSS(this, "overflow", 1) + a.curCSS(this, "overflow-y", 1) + a.curCSS(this, "overflow-x", 1)) }).eq(0) } return (/fixed/).test(this.css("position")) || !b.length ? a(document) : b }, zIndex: function(e) { if (e !== undefined) { return this.css("zIndex", e) } if (this.length) { var c = a(this[0]), b, d; while (c.length && c[0] !== document) { b = c.css("position"); if (b == "absolute" || b == "relative" || b == "fixed") { d = parseInt(c.css("zIndex")); if (!isNaN(d) && d != 0) { return d } } c = c.parent() } } return 0 } }); a.extend(a.expr[":"], { data: function(d, c, b) { return !!a.data(d, b[3]) }, focusable: function(c) { var d = c.nodeName.toLowerCase(), b = a.attr(c, "tabindex"); return (/input|select|textarea|button|object/.test(d) ? !c.disabled : "a" == d || "area" == d ? c.href || !isNaN(b) : !isNaN(b)) && !a(c)["area" == d ? "parents" : "closest"](":hidden").length }, tabbable: function(c) { var b = a.attr(c, "tabindex"); return (isNaN(b) || b >= 0) && a(c).is(":focusable") } }) })(jQuery); ; 
/*!
 * jQuery UI Widget 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b) { var a = b.fn.remove; b.fn.remove = function(c, d) { return this.each(function() { if (!d) { if (!c || b.filter(c, [this]).length) { b("*", this).add(this).each(function() { b(this).triggerHandler("remove") }) } } return a.call(b(this), c, d) }) }; b.widget = function(d, f, c) { var e = d.split(".")[0], h; d = d.split(".")[1]; h = e + "-" + d; if (!c) { c = f; f = b.Widget } b.expr[":"][h] = function(i) { return !!b.data(i, d) }; b[e] = b[e] || {}; b[e][d] = function(i, j) { if (arguments.length) { this._createWidget(i, j) } }; var g = new f(); g.options = b.extend({}, g.options); b[e][d].prototype = b.extend(true, g, { namespace: e, widgetName: d, widgetEventPrefix: b[e][d].prototype.widgetEventPrefix || d, widgetBaseClass: h }, c); b.widget.bridge(d, b[e][d]) }; b.widget.bridge = function(d, c) { b.fn[d] = function(g) { var e = typeof g === "string", f = Array.prototype.slice.call(arguments, 1), h = this; g = !e && f.length ? b.extend.apply(null, [true, g].concat(f)) : g; if (e && g.substring(0, 1) === "_") { return h } if (e) { this.each(function() { var i = b.data(this, d), j = i && b.isFunction(i[g]) ? i[g].apply(i, f) : i; if (j !== i && j !== undefined) { h = j; return false } }) } else { this.each(function() { var i = b.data(this, d); if (i) { if (g) { i.option(g) } i._init() } else { b.data(this, d, new c(g, this)) } }) } return h } }; b.Widget = function(c, d) { if (arguments.length) { this._createWidget(c, d) } }; b.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", options: { disabled: false }, _createWidget: function(d, e) { this.element = b(e).data(this.widgetName, this); this.options = b.extend(true, {}, this.options, b.metadata && b.metadata.get(e)[this.widgetName], d); var c = this; this.element.bind("remove." + this.widgetName, function() { c.destroy() }); this._create(); this._init() }, _create: function() { }, _init: function() { }, destroy: function() { this.element.unbind("." + this.widgetName).removeData(this.widgetName); this.widget().unbind("." + this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled") }, widget: function() { return this.element }, option: function(e, f) { var d = e, c = this; if (arguments.length === 0) { return b.extend({}, c.options) } if (typeof e === "string") { if (f === undefined) { return this.options[e] } d = {}; d[e] = f } b.each(d, function(g, h) { c._setOption(g, h) }); return c }, _setOption: function(c, d) { this.options[c] = d; if (c === "disabled") { this.widget()[d ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled").attr("aria-disabled", d) } return this }, enable: function() { return this._setOption("disabled", false) }, disable: function() { return this._setOption("disabled", true) }, _trigger: function(d, e, f) { var h = this.options[d]; e = b.Event(e); e.type = (d === this.widgetEventPrefix ? d : this.widgetEventPrefix + d).toLowerCase(); f = f || {}; if (e.originalEvent) { for (var c = b.event.props.length, g; c; ) { g = b.event.props[--c]; e[g] = e.originalEvent[g] } } this.element.trigger(e, f); return !(b.isFunction(h) && h.call(this.element[0], e, f) === false || e.isDefaultPrevented()) } } })(jQuery); ; /*
 * jQuery UI Position 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Position
 */
(function(f) { f.ui = f.ui || {}; var c = /left|center|right/, e = "center", d = /top|center|bottom/, g = "center", a = f.fn.position, b = f.fn.offset; f.fn.position = function(i) { if (!i || !i.of) { return a.apply(this, arguments) } i = f.extend({}, i); var l = f(i.of), n = (i.collision || "flip").split(" "), m = i.offset ? i.offset.split(" ") : [0, 0], k, h, j; if (i.of.nodeType === 9) { k = l.width(); h = l.height(); j = { top: 0, left: 0} } else { if (i.of.scrollTo && i.of.document) { k = l.width(); h = l.height(); j = { top: l.scrollTop(), left: l.scrollLeft()} } else { if (i.of.preventDefault) { i.at = "left top"; k = h = 0; j = { top: i.of.pageY, left: i.of.pageX} } else { k = l.outerWidth(); h = l.outerHeight(); j = l.offset() } } } f.each(["my", "at"], function() { var o = (i[this] || "").split(" "); if (o.length === 1) { o = c.test(o[0]) ? o.concat([g]) : d.test(o[0]) ? [e].concat(o) : [e, g] } o[0] = c.test(o[0]) ? o[0] : e; o[1] = d.test(o[1]) ? o[1] : g; i[this] = o }); if (n.length === 1) { n[1] = n[0] } m[0] = parseInt(m[0], 10) || 0; if (m.length === 1) { m[1] = m[0] } m[1] = parseInt(m[1], 10) || 0; if (i.at[0] === "right") { j.left += k } else { if (i.at[0] === e) { j.left += k / 2 } } if (i.at[1] === "bottom") { j.top += h } else { if (i.at[1] === g) { j.top += h / 2 } } j.left += m[0]; j.top += m[1]; return this.each(function() { var r = f(this), q = r.outerWidth(), p = r.outerHeight(), o = f.extend({}, j); if (i.my[0] === "right") { o.left -= q } else { if (i.my[0] === e) { o.left -= q / 2 } } if (i.my[1] === "bottom") { o.top -= p } else { if (i.my[1] === g) { o.top -= p / 2 } } f.each(["left", "top"], function(t, s) { if (f.ui.position[n[t]]) { f.ui.position[n[t]][s](o, { targetWidth: k, targetHeight: h, elemWidth: q, elemHeight: p, offset: m, my: i.my, at: i.at }) } }); if (f.fn.bgiframe) { r.bgiframe() } r.offset(f.extend(o, { using: i.using })) }) }; f.ui.position = { fit: { left: function(h, i) { var k = f(window), j = h.left + i.elemWidth - k.width() - k.scrollLeft(); h.left = j > 0 ? h.left - j : Math.max(0, h.left) }, top: function(h, i) { var k = f(window), j = h.top + i.elemHeight - k.height() - k.scrollTop(); h.top = j > 0 ? h.top - j : Math.max(0, h.top) } }, flip: { left: function(i, j) { if (j.at[0] === "center") { return } var l = f(window), k = i.left + j.elemWidth - l.width() - l.scrollLeft(), h = j.my[0] === "left" ? -j.elemWidth : j.my[0] === "right" ? j.elemWidth : 0, m = -2 * j.offset[0]; i.left += i.left < 0 ? h + j.targetWidth + m : k > 0 ? h - j.targetWidth + m : 0 }, top: function(i, k) { if (k.at[1] === "center") { return } var m = f(window), l = i.top + k.elemHeight - m.height() - m.scrollTop(), h = k.my[1] === "top" ? -k.elemHeight : k.my[1] === "bottom" ? k.elemHeight : 0, j = k.at[1] === "top" ? k.targetHeight : -k.targetHeight, n = -2 * k.offset[1]; i.top += i.top < 0 ? h + k.targetHeight + n : l > 0 ? h + j + n : 0 } } }; if (!f.offset.setOffset) { f.offset.setOffset = function(l, i) { if (/static/.test(f.curCSS(l, "position"))) { l.style.position = "relative" } var k = f(l), n = k.offset(), h = parseInt(f.curCSS(l, "top", true), 10) || 0, m = parseInt(f.curCSS(l, "left", true), 10) || 0, j = { top: (i.top - n.top) + h, left: (i.left - n.left) + m }; if ("using" in i) { i.using.call(l, j) } else { k.css(j) } }; f.fn.offset = function(h) { var i = this[0]; if (!i || !i.ownerDocument) { return null } if (h) { return this.each(function() { f.offset.setOffset(this, h) }) } return b.call(this) } } } (jQuery)); ;
/*
* jQuery UI Dialog 1.8.1
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Dialog
*
* Depends:
*	jquery.ui.core.js
*	jquery.ui.widget.js
*  jquery.ui.button.js
*	jquery.ui.draggable.js
*	jquery.ui.mouse.js
*	jquery.ui.position.js
*	jquery.ui.resizable.js
*/
(function(b) { var a = "ui-dialog ui-widget ui-widget-content ui-corner-all "; b.widget("ui.dialog", { options: { autoOpen: true, buttons: {}, closeOnEscape: true, closeText: "close", dialogClass: "", draggable: true, hide: null, height: "auto", maxHeight: false, maxWidth: false, minHeight: 150, minWidth: 150, modal: false, position: "center", resizable: true, show: null, stack: true, title: "", width: 300, zIndex: 1000 }, _create: function() { this.originalTitle = this.element.attr("title"); var k = this, l = k.options, i = l.title || k.originalTitle || "&#160;", d = b.ui.dialog.getTitleId(k.element), j = (k.uiDialog = b("<div></div>")).appendTo(document.body).hide().addClass(a + l.dialogClass).css({ zIndex: l.zIndex }).attr("tabIndex", -1).css("outline", 0).keydown(function(m) { if (l.closeOnEscape && m.keyCode && m.keyCode === b.ui.keyCode.ESCAPE) { k.close(m); m.preventDefault() } }).attr({ role: "dialog", "aria-labelledby": d }).mousedown(function(m) { k.moveToTop(false, m) }), f = k.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(j), e = (k.uiDialogTitlebar = b("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(j), h = b('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", "button").hover(function() { h.addClass("ui-state-hover") }, function() { h.removeClass("ui-state-hover") }).focus(function() { h.addClass("ui-state-focus") }).blur(function() { h.removeClass("ui-state-focus") }).click(function(m) { k.close(m); return false }).appendTo(e), g = (k.uiDialogTitlebarCloseText = b("<span></span>")).addClass("ui-icon ui-icon-closethick").text(l.closeText).appendTo(h), c = b("<span></span>").addClass("ui-dialog-title").attr("id", d).html(i).prependTo(e); if (b.isFunction(l.beforeclose) && !b.isFunction(l.beforeClose)) { l.beforeClose = l.beforeclose } e.find("*").add(e).disableSelection(); if (l.draggable && b.fn.draggable) { k._makeDraggable() } if (l.resizable && b.fn.resizable) { k._makeResizable() } k._createButtons(l.buttons); k._isOpen = false; if (b.fn.bgiframe) { j.bgiframe() } }, _init: function() { if (this.options.autoOpen) { this.open() } }, destroy: function() { var c = this; if (c.overlay) { c.overlay.destroy() } c.uiDialog.hide(); c.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); c.uiDialog.remove(); if (c.originalTitle) { c.element.attr("title", c.originalTitle) } return c }, widget: function() { return this.uiDialog }, close: function(e) { var c = this, d; if (false === c._trigger("beforeClose", e)) { return } if (c.overlay) { c.overlay.destroy() } c.uiDialog.unbind("keypress.ui-dialog"); c._isOpen = false; if (c.options.hide) { c.uiDialog.hide(c.options.hide, function() { c._trigger("close", e) }) } else { c.uiDialog.hide(); c._trigger("close", e) } b.ui.dialog.overlay.resize(); if (c.options.modal) { d = 0; b(".ui-dialog").each(function() { if (this !== c.uiDialog[0]) { d = Math.max(d, b(this).css("z-index")) } }); b.ui.dialog.maxZ = d } return c }, isOpen: function() { return this._isOpen }, moveToTop: function(g, f) { var c = this, e = c.options, d; if ((e.modal && !g) || (!e.stack && !e.modal)) { return c._trigger("focus", f) } if (e.zIndex > b.ui.dialog.maxZ) { b.ui.dialog.maxZ = e.zIndex } if (c.overlay) { b.ui.dialog.maxZ += 1; c.overlay.$el.css("z-index", b.ui.dialog.overlay.maxZ = b.ui.dialog.maxZ) } d = { scrollTop: c.element.attr("scrollTop"), scrollLeft: c.element.attr("scrollLeft") }; b.ui.dialog.maxZ += 1; c.uiDialog.css("z-index", b.ui.dialog.maxZ); c.element.attr(d); c._trigger("focus", f); return c }, open: function() { if (this._isOpen) { return } var d = this, e = d.options, c = d.uiDialog; d.overlay = e.modal ? new b.ui.dialog.overlay(d) : null; if (c.next().length) { c.appendTo("body") } d._size(); d._position(e.position); c.show(e.show); d.moveToTop(true); if (e.modal) { c.bind("keypress.ui-dialog", function(h) { if (h.keyCode !== b.ui.keyCode.TAB) { return } var g = b(":tabbable", this), i = g.filter(":first"), f = g.filter(":last"); if (h.target === f[0] && !h.shiftKey) { i.focus(1); return false } else { if (h.target === i[0] && h.shiftKey) { f.focus(1); return false } } }) } d._trigger("open"); d._isOpen = true; return d }, _createButtons: function(f) { var e = this, c = false, d = b("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"); e.uiDialog.find(".ui-dialog-buttonpane").remove(); if (typeof f === "object" && f !== null) { b.each(f, function() { return !(c = true) }) } if (c) { b.each(f, function(g, i) { var h = b('<button type="button"></button>').text(g).click(function() { i.apply(e.element[0], arguments) }).appendTo(d); if (b.fn.button) { h.button() } }); d.appendTo(e.uiDialog) } }, _makeDraggable: function() { var c = this, f = c.options, g = b(document), e; function d(h) { return { position: h.position, offset: h.offset} } c.uiDialog.draggable({ cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", handle: ".ui-dialog-titlebar", containment: "document", start: function(h, i) { e = f.height === "auto" ? "auto" : b(this).height(); b(this).height(b(this).height()).addClass("ui-dialog-dragging"); c._trigger("dragStart", h, d(i)) }, drag: function(h, i) { c._trigger("drag", h, d(i)) }, stop: function(h, i) { f.position = [i.position.left - g.scrollLeft(), i.position.top - g.scrollTop()]; b(this).removeClass("ui-dialog-dragging").height(e); c._trigger("dragStop", h, d(i)); b.ui.dialog.overlay.resize() } }) }, _makeResizable: function(h) { h = (h === undefined ? this.options.resizable : h); var d = this, g = d.options, c = d.uiDialog.css("position"), f = (typeof h === "string" ? h : "n,e,s,w,se,sw,ne,nw"); function e(i) { return { originalPosition: i.originalPosition, originalSize: i.originalSize, position: i.position, size: i.size} } d.uiDialog.resizable({ cancel: ".ui-dialog-content", containment: "document", alsoResize: d.element, maxWidth: g.maxWidth, maxHeight: g.maxHeight, minWidth: g.minWidth, minHeight: d._minHeight(), handles: f, start: function(i, j) { b(this).addClass("ui-dialog-resizing"); d._trigger("resizeStart", i, e(j)) }, resize: function(i, j) { d._trigger("resize", i, e(j)) }, stop: function(i, j) { b(this).removeClass("ui-dialog-resizing"); g.height = b(this).height(); g.width = b(this).width(); d._trigger("resizeStop", i, e(j)); b.ui.dialog.overlay.resize() } }).css("position", c).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se") }, _minHeight: function() { var c = this.options; if (c.height === "auto") { return c.minHeight } else { return Math.min(c.minHeight, c.height) } }, _position: function(d) { var e = [], f = [0, 0], c; d = d || b.ui.dialog.prototype.options.position; if (typeof d === "string" || (typeof d === "object" && "0" in d)) { e = d.split ? d.split(" ") : [d[0], d[1]]; if (e.length === 1) { e[1] = e[0] } b.each(["left", "top"], function(h, g) { if (+e[h] === e[h]) { f[h] = e[h]; e[h] = g } }) } else { if (typeof d === "object") { if ("left" in d) { e[0] = "left"; f[0] = d.left } else { if ("right" in d) { e[0] = "right"; f[0] = -d.right } } if ("top" in d) { e[1] = "top"; f[1] = d.top } else { if ("bottom" in d) { e[1] = "bottom"; f[1] = -d.bottom } } } } c = this.uiDialog.is(":visible"); if (!c) { this.uiDialog.show() } this.uiDialog.css({ top: 0, left: 0 }).position({ my: e.join(" "), at: e.join(" "), offset: f.join(" "), of: window, collision: "fit", using: function(h) { var g = b(this).css(h).offset().top; if (g < 0) { b(this).css("top", h.top - g) } } }); if (!c) { this.uiDialog.hide() } }, _setOption: function(f, g) { var d = this, c = d.uiDialog, h = c.is(":data(resizable)"), e = false; switch (f) { case "beforeclose": f = "beforeClose"; break; case "buttons": d._createButtons(g); break; case "closeText": d.uiDialogTitlebarCloseText.text("" + g); break; case "dialogClass": c.removeClass(d.options.dialogClass).addClass(a + g); break; case "disabled": if (g) { c.addClass("ui-dialog-disabled") } else { c.removeClass("ui-dialog-disabled") } break; case "draggable": if (g) { d._makeDraggable() } else { c.draggable("destroy") } break; case "height": e = true; break; case "maxHeight": if (h) { c.resizable("option", "maxHeight", g) } e = true; break; case "maxWidth": if (h) { c.resizable("option", "maxWidth", g) } e = true; break; case "minHeight": if (h) { c.resizable("option", "minHeight", g) } e = true; break; case "minWidth": if (h) { c.resizable("option", "minWidth", g) } e = true; break; case "position": d._position(g); break; case "resizable": if (h && !g) { c.resizable("destroy") } if (h && typeof g === "string") { c.resizable("option", "handles", g) } if (!h && g !== false) { d._makeResizable(g) } break; case "title": b(".ui-dialog-title", d.uiDialogTitlebar).html("" + (g || "&#160;")); break; case "width": e = true; break } b.Widget.prototype._setOption.apply(d, arguments); if (e) { d._size() } }, _size: function() { var d = this.options, c; this.element.css({ width: "auto", minHeight: 0, height: 0 }); c = this.uiDialog.css({ height: "auto", width: d.width }).height(); this.element.css(d.height === "auto" ? { minHeight: Math.max(d.minHeight - c, 0), height: "auto"} : { minHeight: 0, height: Math.max(d.height - c, 0) }).show(); if (this.uiDialog.is(":data(resizable)")) { this.uiDialog.resizable("option", "minHeight", this._minHeight()) } } }); b.extend(b.ui.dialog, { version: "1.8.1", uuid: 0, maxZ: 0, getTitleId: function(c) { var d = c.attr("id"); if (!d) { this.uuid += 1; d = this.uuid } return "ui-dialog-title-" + d }, overlay: function(c) { this.$el = b.ui.dialog.overlay.create(c) } }); b.extend(b.ui.dialog.overlay, { instances: [], oldInstances: [], maxZ: 0, events: b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","), function(c) { return c + ".dialog-overlay" }).join(" "), create: function(d) { if (this.instances.length === 0) { setTimeout(function() { if (b.ui.dialog.overlay.instances.length) { b(document).bind(b.ui.dialog.overlay.events, function(e) { return (b(e.target).zIndex() >= b.ui.dialog.overlay.maxZ) }) } }, 1); b(document).bind("keydown.dialog-overlay", function(e) { if (d.options.closeOnEscape && e.keyCode && e.keyCode === b.ui.keyCode.ESCAPE) { d.close(e); e.preventDefault() } }); b(window).bind("resize.dialog-overlay", b.ui.dialog.overlay.resize) } var c = (this.oldInstances.pop() || b("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({ width: this.width(), height: this.height() }); if (b.fn.bgiframe) { c.bgiframe() } this.instances.push(c); return c }, destroy: function(c) { this.oldInstances.push(this.instances.splice(b.inArray(c, this.instances), 1)[0]); if (this.instances.length === 0) { b([document, window]).unbind(".dialog-overlay") } c.remove(); var d = 0; b.each(this.instances, function() { d = Math.max(d, this.css("z-index")) }); this.maxZ = d }, height: function() { var d, c; if (b.browser.msie && b.browser.version < 7) { d = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); c = Math.max(document.documentElement.offsetHeight, document.body.offsetHeight); if (d < c) { return b(window).height() + "px" } else { return d + "px" } } else { return b(document).height() + "px" } }, width: function() { var c, d; if (b.browser.msie && b.browser.version < 7) { c = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth); d = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); if (c < d) { return b(window).width() + "px" } else { return c + "px" } } else { return b(document).width() + "px" } }, resize: function() { var c = b([]); b.each(b.ui.dialog.overlay.instances, function() { c = c.add(this) }); c.css({ width: 0, height: 0 }).css({ width: b.ui.dialog.overlay.width(), height: b.ui.dialog.overlay.height() }) } }); b.extend(b.ui.dialog.overlay.prototype, { destroy: function() { b.ui.dialog.overlay.destroy(this.$el) } }) } (jQuery));

