//Start jquery-ui.js 1.5.3 with ui draggable, resizable, dialog and tabs
/*
* jQuery UI 1.5.3
*
* Copyright (c) 2008 Paul Bakaus (ui.jquery.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI
* UI Core, Draggable, Droppable, Resizable, Dialog, Tabs
* chg by chia: added 2 '$.cookie('dialogOpen', null, { path: '/', expires: 1000 });' in the dialog section
*/
(function (C) { C.ui = { plugin: { add: function (E, F, H) { var G = C.ui[E].prototype; for (var D in H) { G.plugins[D] = G.plugins[D] || []; G.plugins[D].push([F, H[D]]) } }, call: function (D, F, E) { var H = D.plugins[F]; if (!H) { return } for (var G = 0; G < H.length; G++) { if (D.options[H[G][0]]) { H[G][1].apply(D.element, E) } } } }, cssCache: {}, css: function (D) { if (C.ui.cssCache[D]) { return C.ui.cssCache[D] } var E = C('<div class="ui-gen">').addClass(D).css({ position: "absolute", top: "-5000px", left: "-5000px", display: "block" }).appendTo("body"); C.ui.cssCache[D] = !!((!(/auto|default/).test(E.css("cursor")) || (/^[1-9]/).test(E.css("height")) || (/^[1-9]/).test(E.css("width")) || !(/none/).test(E.css("backgroundImage")) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor")))); try { C("body").get(0).removeChild(E.get(0)) } catch (F) { } return C.ui.cssCache[D] }, disableSelection: function (D) { C(D).attr("unselectable", "on").css("MozUserSelect", "none") }, enableSelection: function (D) { C(D).attr("unselectable", "off").css("MozUserSelect", "") }, hasScroll: function (G, E) { var D = /top/.test(E || "top") ? "scrollTop" : "scrollLeft", F = false; if (G[D] > 0) { return true } G[D] = 1; F = G[D] > 0 ? true : false; G[D] = 0; return F } }; var B = C.fn.remove; C.fn.remove = function () { C("*", this).add(this).triggerHandler("remove"); return B.apply(this, arguments) }; function A(E, F, G) { var D = C[E][F].getter || []; D = (typeof D == "string" ? D.split(/,?\s+/) : D); return (C.inArray(G, D) != -1) } C.widget = function (E, D) { var F = E.split(".")[0]; E = E.split(".")[1]; C.fn[E] = function (J) { var H = (typeof J == "string"), I = Array.prototype.slice.call(arguments, 1); if (H && A(F, E, J)) { var G = C.data(this[0], E); return (G ? G[J].apply(G, I) : undefined) } return this.each(function () { var K = C.data(this, E); if (H && K && C.isFunction(K[J])) { K[J].apply(K, I) } else { if (!H) { C.data(this, E, new C[F][E](this, J)) } } }) }; C[F][E] = function (I, H) { var G = this; this.widgetName = E; this.widgetBaseClass = F + "-" + E; this.options = C.extend({}, C.widget.defaults, C[F][E].defaults, H); this.element = C(I).bind("setData." + E, function (L, J, K) { return G.setData(J, K) }).bind("getData." + E, function (K, J) { return G.getData(J) }).bind("remove", function () { return G.destroy() }); this.init() }; C[F][E].prototype = C.extend({}, C.widget.prototype, D) }; C.widget.prototype = { init: function () { }, destroy: function () { this.element.removeData(this.widgetName) }, getData: function (D) { return this.options[D] }, setData: function (D, E) { this.options[D] = E; if (D == "disabled") { this.element[E ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled") } }, enable: function () { this.setData("disabled", false) }, disable: function () { this.setData("disabled", true) } }; C.widget.defaults = { disabled: false }; C.ui.mouse = { mouseInit: function () { var D = this; this.element.bind("mousedown." + this.widgetName, function (E) { return D.mouseDown(E) }); if (C.browser.msie) { this._mouseUnselectable = this.element.attr("unselectable"); this.element.attr("unselectable", "on") } this.started = false }, mouseDestroy: function () { this.element.unbind("." + this.widgetName); (C.browser.msie && this.element.attr("unselectable", this._mouseUnselectable)) }, mouseDown: function (F) { (this._mouseStarted && this.mouseUp(F)); this._mouseDownEvent = F; var E = this, G = (F.which == 1), D = (typeof this.options.cancel == "string" ? C(F.target).parents().add(F.target).filter(this.options.cancel).length : false); if (!G || D || !this.mouseCapture(F)) { return true } this._mouseDelayMet = !this.options.delay; if (!this._mouseDelayMet) { this._mouseDelayTimer = setTimeout(function () { E._mouseDelayMet = true }, this.options.delay) } if (this.mouseDistanceMet(F) && this.mouseDelayMet(F)) { this._mouseStarted = (this.mouseStart(F) !== false); if (!this._mouseStarted) { F.preventDefault(); return true } } this._mouseMoveDelegate = function (H) { return E.mouseMove(H) }; this._mouseUpDelegate = function (H) { return E.mouseUp(H) }; C(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate); return false }, mouseMove: function (D) { if (C.browser.msie && !D.button) { return this.mouseUp(D) } if (this._mouseStarted) { this.mouseDrag(D); return false } if (this.mouseDistanceMet(D) && this.mouseDelayMet(D)) { this._mouseStarted = (this.mouseStart(this._mouseDownEvent, D) !== false); (this._mouseStarted ? this.mouseDrag(D) : this.mouseUp(D)) } return !this._mouseStarted }, mouseUp: function (D) { C(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate); if (this._mouseStarted) { this._mouseStarted = false; this.mouseStop(D) } return false }, mouseDistanceMet: function (D) { return (Math.max(Math.abs(this._mouseDownEvent.pageX - D.pageX), Math.abs(this._mouseDownEvent.pageY - D.pageY)) >= this.options.distance) }, mouseDelayMet: function (D) { return this._mouseDelayMet }, mouseStart: function (D) { }, mouseDrag: function (D) { }, mouseStop: function (D) { }, mouseCapture: function (D) { return true } }; C.ui.mouse.defaults = { cancel: null, distance: 1, delay: 0} })(jQuery); (function (A) { A.widget("ui.draggable", A.extend({}, A.ui.mouse, { init: function () { var B = this.options; if (B.helper == "original" && !(/(relative|absolute|fixed)/).test(this.element.css("position"))) { this.element.css("position", "relative") } this.element.addClass("ui-draggable"); (B.disabled && this.element.addClass("ui-draggable-disabled")); this.mouseInit() }, mouseStart: function (F) { var H = this.options; if (this.helper || H.disabled || A(F.target).is(".ui-resizable-handle")) { return false } var C = !this.options.handle || !A(this.options.handle, this.element).length ? true : false; A(this.options.handle, this.element).find("*").andSelf().each(function () { if (this == F.target) { C = true } }); if (!C) { return false } if (A.ui.ddmanager) { A.ui.ddmanager.current = this } this.helper = A.isFunction(H.helper) ? A(H.helper.apply(this.element[0], [F])) : (H.helper == "clone" ? this.element.clone() : this.element); if (!this.helper.parents("body").length) { this.helper.appendTo((H.appendTo == "parent" ? this.element[0].parentNode : H.appendTo)) } if (this.helper[0] != this.element[0] && !(/(fixed|absolute)/).test(this.helper.css("position"))) { this.helper.css("position", "absolute") } this.margins = { left: (parseInt(this.element.css("marginLeft"), 10) || 0), top: (parseInt(this.element.css("marginTop"), 10) || 0) }; this.cssPosition = this.helper.css("position"); this.offset = this.element.offset(); this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }; this.offset.click = { left: F.pageX - this.offset.left, top: F.pageY - this.offset.top }; this.offsetParent = this.helper.offsetParent(); var B = this.offsetParent.offset(); if (this.offsetParent[0] == document.body && A.browser.mozilla) { B = { top: 0, left: 0} } this.offset.parent = { top: B.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: B.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) }; var E = this.element.position(); this.offset.relative = this.cssPosition == "relative" ? { top: E.top - (parseInt(this.helper.css("top"), 10) || 0) + this.offsetParent[0].scrollTop, left: E.left - (parseInt(this.helper.css("left"), 10) || 0) + this.offsetParent[0].scrollLeft} : { top: 0, left: 0 }; this.originalPosition = this.generatePosition(F); this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() }; if (H.cursorAt) { if (H.cursorAt.left != undefined) { this.offset.click.left = H.cursorAt.left + this.margins.left } if (H.cursorAt.right != undefined) { this.offset.click.left = this.helperProportions.width - H.cursorAt.right + this.margins.left } if (H.cursorAt.top != undefined) { this.offset.click.top = H.cursorAt.top + this.margins.top } if (H.cursorAt.bottom != undefined) { this.offset.click.top = this.helperProportions.height - H.cursorAt.bottom + this.margins.top } } if (H.containment) { if (H.containment == "parent") { H.containment = this.helper[0].parentNode } if (H.containment == "document" || H.containment == "window") { this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, A(H.containment == "document" ? document : window).width() - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"), 10) || 0), (A(H.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"), 10) || 0)] } if (!(/^(document|window|parent)$/).test(H.containment)) { var D = A(H.containment)[0]; var G = A(H.containment).offset(); this.containment = [G.left + (parseInt(A(D).css("borderLeftWidth"), 10) || 0) - this.offset.relative.left - this.offset.parent.left, G.top + (parseInt(A(D).css("borderTopWidth"), 10) || 0) - this.offset.relative.top - this.offset.parent.top, G.left + Math.max(D.scrollWidth, D.offsetWidth) - (parseInt(A(D).css("borderLeftWidth"), 10) || 0) - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"), 10) || 0), G.top + Math.max(D.scrollHeight, D.offsetHeight) - (parseInt(A(D).css("borderTopWidth"), 10) || 0) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"), 10) || 0)] } } this.propagate("start", F); this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() }; if (A.ui.ddmanager && !H.dropBehaviour) { A.ui.ddmanager.prepareOffsets(this, F) } this.helper.addClass("ui-draggable-dragging"); this.mouseDrag(F); return true }, convertPositionTo: function (C, D) { if (!D) { D = this.position } var B = C == "absolute" ? 1 : -1; return { top: (D.top + this.offset.relative.top * B + this.offset.parent.top * B - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) * B + (this.cssPosition == "fixed" ? A(document).scrollTop() : 0) * B + this.margins.top * B), left: (D.left + this.offset.relative.left * B + this.offset.parent.left * B - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) * B + (this.cssPosition == "fixed" ? A(document).scrollLeft() : 0) * B + this.margins.left * B)} }, generatePosition: function (E) { var F = this.options; var B = { top: (E.pageY - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) - (this.cssPosition == "fixed" ? A(document).scrollTop() : 0)), left: (E.pageX - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) - (this.cssPosition == "fixed" ? A(document).scrollLeft() : 0)) }; if (!this.originalPosition) { return B } if (this.containment) { if (B.left < this.containment[0]) { B.left = this.containment[0] } if (B.top < this.containment[1]) { B.top = this.containment[1] } if (B.left > this.containment[2]) { B.left = this.containment[2] } if (B.top > this.containment[3]) { B.top = this.containment[3] } } if (F.grid) { var D = this.originalPosition.top + Math.round((B.top - this.originalPosition.top) / F.grid[1]) * F.grid[1]; B.top = this.containment ? (!(D < this.containment[1] || D > this.containment[3]) ? D : (!(D < this.containment[1]) ? D - F.grid[1] : D + F.grid[1])) : D; var C = this.originalPosition.left + Math.round((B.left - this.originalPosition.left) / F.grid[0]) * F.grid[0]; B.left = this.containment ? (!(C < this.containment[0] || C > this.containment[2]) ? C : (!(C < this.containment[0]) ? C - F.grid[0] : C + F.grid[0])) : C } return B }, mouseDrag: function (B) { this.position = this.generatePosition(B); this.positionAbs = this.convertPositionTo("absolute"); this.position = this.propagate("drag", B) || this.position; if (!this.options.axis || this.options.axis != "y") { this.helper[0].style.left = this.position.left + "px" } if (!this.options.axis || this.options.axis != "x") { this.helper[0].style.top = this.position.top + "px" } if (A.ui.ddmanager) { A.ui.ddmanager.drag(this, B) } return false }, mouseStop: function (C) { var D = false; if (A.ui.ddmanager && !this.options.dropBehaviour) { var D = A.ui.ddmanager.drop(this, C) } if ((this.options.revert == "invalid" && !D) || (this.options.revert == "valid" && D) || this.options.revert === true) { var B = this; A(this.helper).animate(this.originalPosition, parseInt(this.options.revert, 10) || 500, function () { B.propagate("stop", C); B.clear() }) } else { this.propagate("stop", C); this.clear() } return false }, clear: function () { this.helper.removeClass("ui-draggable-dragging"); if (this.options.helper != "original" && !this.cancelHelperRemoval) { this.helper.remove() } this.helper = null; this.cancelHelperRemoval = false }, plugins: {}, uiHash: function (B) { return { helper: this.helper, position: this.position, absolutePosition: this.positionAbs, options: this.options} }, propagate: function (C, B) { A.ui.plugin.call(this, C, [B, this.uiHash()]); if (C == "drag") { this.positionAbs = this.convertPositionTo("absolute") } return this.element.triggerHandler(C == "drag" ? C : "drag" + C, [B, this.uiHash()], this.options[C]) }, destroy: function () { if (!this.element.data("draggable")) { return } this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable"); this.mouseDestroy() } })); A.extend(A.ui.draggable, { defaults: { appendTo: "parent", axis: false, cancel: ":input", delay: 0, distance: 1, helper: "original"} }); A.ui.plugin.add("draggable", "cursor", { start: function (D, C) { var B = A("body"); if (B.css("cursor")) { C.options._cursor = B.css("cursor") } B.css("cursor", C.options.cursor) }, stop: function (C, B) { if (B.options._cursor) { A("body").css("cursor", B.options._cursor) } } }); A.ui.plugin.add("draggable", "zIndex", { start: function (D, C) { var B = A(C.helper); if (B.css("zIndex")) { C.options._zIndex = B.css("zIndex") } B.css("zIndex", C.options.zIndex) }, stop: function (C, B) { if (B.options._zIndex) { A(B.helper).css("zIndex", B.options._zIndex) } } }); A.ui.plugin.add("draggable", "opacity", { start: function (D, C) { var B = A(C.helper); if (B.css("opacity")) { C.options._opacity = B.css("opacity") } B.css("opacity", C.options.opacity) }, stop: function (C, B) { if (B.options._opacity) { A(B.helper).css("opacity", B.options._opacity) } } }); A.ui.plugin.add("draggable", "iframeFix", { start: function (C, B) { A(B.options.iframeFix === true ? "iframe" : B.options.iframeFix).each(function () { A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({ width: this.offsetWidth + "px", height: this.offsetHeight + "px", position: "absolute", opacity: "0.001", zIndex: 1000 }).css(A(this).offset()).appendTo("body") }) }, stop: function (C, B) { A("div.DragDropIframeFix").each(function () { this.parentNode.removeChild(this) }) } }); A.ui.plugin.add("draggable", "scroll", { start: function (D, C) { var E = C.options; var B = A(this).data("draggable"); E.scrollSensitivity = E.scrollSensitivity || 20; E.scrollSpeed = E.scrollSpeed || 20; B.overflowY = function (F) { do { if (/auto|scroll/.test(F.css("overflow")) || (/auto|scroll/).test(F.css("overflow-y"))) { return F } F = F.parent() } while (F[0].parentNode); return A(document) } (this); B.overflowX = function (F) { do { if (/auto|scroll/.test(F.css("overflow")) || (/auto|scroll/).test(F.css("overflow-x"))) { return F } F = F.parent() } while (F[0].parentNode); return A(document) } (this); if (B.overflowY[0] != document && B.overflowY[0].tagName != "HTML") { B.overflowYOffset = B.overflowY.offset() } if (B.overflowX[0] != document && B.overflowX[0].tagName != "HTML") { B.overflowXOffset = B.overflowX.offset() } }, drag: function (D, C) { var E = C.options; var B = A(this).data("draggable"); if (B.overflowY[0] != document && B.overflowY[0].tagName != "HTML") { if ((B.overflowYOffset.top + B.overflowY[0].offsetHeight) - D.pageY < E.scrollSensitivity) { B.overflowY[0].scrollTop = B.overflowY[0].scrollTop + E.scrollSpeed } if (D.pageY - B.overflowYOffset.top < E.scrollSensitivity) { B.overflowY[0].scrollTop = B.overflowY[0].scrollTop - E.scrollSpeed } } else { if (D.pageY - A(document).scrollTop() < E.scrollSensitivity) { A(document).scrollTop(A(document).scrollTop() - E.scrollSpeed) } if (A(window).height() - (D.pageY - A(document).scrollTop()) < E.scrollSensitivity) { A(document).scrollTop(A(document).scrollTop() + E.scrollSpeed) } } if (B.overflowX[0] != document && B.overflowX[0].tagName != "HTML") { if ((B.overflowXOffset.left + B.overflowX[0].offsetWidth) - D.pageX < E.scrollSensitivity) { B.overflowX[0].scrollLeft = B.overflowX[0].scrollLeft + E.scrollSpeed } if (D.pageX - B.overflowXOffset.left < E.scrollSensitivity) { B.overflowX[0].scrollLeft = B.overflowX[0].scrollLeft - E.scrollSpeed } } else { if (D.pageX - A(document).scrollLeft() < E.scrollSensitivity) { A(document).scrollLeft(A(document).scrollLeft() - E.scrollSpeed) } if (A(window).width() - (D.pageX - A(document).scrollLeft()) < E.scrollSensitivity) { A(document).scrollLeft(A(document).scrollLeft() + E.scrollSpeed) } } } }); A.ui.plugin.add("draggable", "snap", { start: function (D, C) { var B = A(this).data("draggable"); B.snapElements = []; A(C.options.snap === true ? ".ui-draggable" : C.options.snap).each(function () { var F = A(this); var E = F.offset(); if (this != B.element[0]) { B.snapElements.push({ item: this, width: F.outerWidth(), height: F.outerHeight(), top: E.top, left: E.left }) } }) }, drag: function (J, N) { var I = A(this).data("draggable"); var L = N.options.snapTolerance || 20; var D = N.absolutePosition.left, C = D + I.helperProportions.width, P = N.absolutePosition.top, O = P + I.helperProportions.height; for (var H = I.snapElements.length - 1; H >= 0; H--) { var E = I.snapElements[H].left, B = E + I.snapElements[H].width, R = I.snapElements[H].top, M = R + I.snapElements[H].height; if (!((E - L < D && D < B + L && R - L < P && P < M + L) || (E - L < D && D < B + L && R - L < O && O < M + L) || (E - L < C && C < B + L && R - L < P && P < M + L) || (E - L < C && C < B + L && R - L < O && O < M + L))) { continue } if (N.options.snapMode != "inner") { var K = Math.abs(R - O) <= 20; var Q = Math.abs(M - P) <= 20; var G = Math.abs(E - C) <= 20; var F = Math.abs(B - D) <= 20; if (K) { N.position.top = I.convertPositionTo("relative", { top: R - I.helperProportions.height, left: 0 }).top } if (Q) { N.position.top = I.convertPositionTo("relative", { top: M, left: 0 }).top } if (G) { N.position.left = I.convertPositionTo("relative", { top: 0, left: E - I.helperProportions.width }).left } if (F) { N.position.left = I.convertPositionTo("relative", { top: 0, left: B }).left } } if (N.options.snapMode != "outer") { var K = Math.abs(R - P) <= 20; var Q = Math.abs(M - O) <= 20; var G = Math.abs(E - D) <= 20; var F = Math.abs(B - C) <= 20; if (K) { N.position.top = I.convertPositionTo("relative", { top: R, left: 0 }).top } if (Q) { N.position.top = I.convertPositionTo("relative", { top: M - I.helperProportions.height, left: 0 }).top } if (G) { N.position.left = I.convertPositionTo("relative", { top: 0, left: E }).left } if (F) { N.position.left = I.convertPositionTo("relative", { top: 0, left: B - I.helperProportions.width }).left } } } } }); A.ui.plugin.add("draggable", "connectToSortable", { start: function (D, C) { var B = A(this).data("draggable"); B.sortables = []; A(C.options.connectToSortable).each(function () { if (A.data(this, "sortable")) { var E = A.data(this, "sortable"); B.sortables.push({ instance: E, shouldRevert: E.options.revert }); E.refreshItems(); E.propagate("activate", D, B) } }) }, stop: function (D, C) { var B = A(this).data("draggable"); A.each(B.sortables, function () { if (this.instance.isOver) { this.instance.isOver = 0; B.cancelHelperRemoval = true; this.instance.cancelHelperRemoval = false; if (this.shouldRevert) { this.instance.options.revert = true } this.instance.mouseStop(D); this.instance.element.triggerHandler("sortreceive", [D, A.extend(this.instance.ui(), { sender: B.element })], this.instance.options["receive"]); this.instance.options.helper = this.instance.options._helper } else { this.instance.propagate("deactivate", D, B) } }) }, drag: function (F, E) { var D = A(this).data("draggable"), B = this; var C = function (K) { var H = K.left, J = H + K.width, I = K.top, G = I + K.height; return (H < (this.positionAbs.left + this.offset.click.left) && (this.positionAbs.left + this.offset.click.left) < J && I < (this.positionAbs.top + this.offset.click.top) && (this.positionAbs.top + this.offset.click.top) < G) }; A.each(D.sortables, function (G) { if (C.call(D, this.instance.containerCache)) { if (!this.instance.isOver) { this.instance.isOver = 1; this.instance.currentItem = A(B).clone().appendTo(this.instance.element).data("sortable-item", true); this.instance.options._helper = this.instance.options.helper; this.instance.options.helper = function () { return E.helper[0] }; F.target = this.instance.currentItem[0]; this.instance.mouseCapture(F, true); this.instance.mouseStart(F, true, true); this.instance.offset.click.top = D.offset.click.top; this.instance.offset.click.left = D.offset.click.left; this.instance.offset.parent.left -= D.offset.parent.left - this.instance.offset.parent.left; this.instance.offset.parent.top -= D.offset.parent.top - this.instance.offset.parent.top; D.propagate("toSortable", F) } if (this.instance.currentItem) { this.instance.mouseDrag(F) } } else { if (this.instance.isOver) { this.instance.isOver = 0; this.instance.cancelHelperRemoval = true; this.instance.options.revert = false; this.instance.mouseStop(F, true); this.instance.options.helper = this.instance.options._helper; this.instance.currentItem.remove(); if (this.instance.placeholder) { this.instance.placeholder.remove() } D.propagate("fromSortable", F) } } }) } }); A.ui.plugin.add("draggable", "stack", { start: function (D, B) { var C = A.makeArray(A(B.options.stack.group)).sort(function (F, E) { return (parseInt(A(F).css("zIndex"), 10) || B.options.stack.min) - (parseInt(A(E).css("zIndex"), 10) || B.options.stack.min) }); A(C).each(function (E) { this.style.zIndex = B.options.stack.min + E }); this[0].style.zIndex = B.options.stack.min + C.length } }) })(jQuery); (function (A) { A.widget("ui.droppable", { init: function () { this.element.addClass("ui-droppable"); this.isover = 0; this.isout = 1; var C = this.options, B = C.accept; C = A.extend(C, { accept: C.accept && C.accept.constructor == Function ? C.accept : function (D) { return A(D).is(B) } }); this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; A.ui.ddmanager.droppables.push(this) }, plugins: {}, ui: function (B) { return { draggable: (B.currentItem || B.element), helper: B.helper, position: B.position, absolutePosition: B.positionAbs, options: this.options, element: this.element} }, destroy: function () { var B = A.ui.ddmanager.droppables; for (var C = 0; C < B.length; C++) { if (B[C] == this) { B.splice(C, 1) } } this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable") }, over: function (C) { var B = A.ui.ddmanager.current; if (!B || (B.currentItem || B.element)[0] == this.element[0]) { return } if (this.options.accept.call(this.element, (B.currentItem || B.element))) { A.ui.plugin.call(this, "over", [C, this.ui(B)]); this.element.triggerHandler("dropover", [C, this.ui(B)], this.options.over) } }, out: function (C) { var B = A.ui.ddmanager.current; if (!B || (B.currentItem || B.element)[0] == this.element[0]) { return } if (this.options.accept.call(this.element, (B.currentItem || B.element))) { A.ui.plugin.call(this, "out", [C, this.ui(B)]); this.element.triggerHandler("dropout", [C, this.ui(B)], this.options.out) } }, drop: function (D, C) { var B = C || A.ui.ddmanager.current; if (!B || (B.currentItem || B.element)[0] == this.element[0]) { return false } var E = false; this.element.find(".ui-droppable").not(".ui-draggable-dragging").each(function () { var F = A.data(this, "droppable"); if (F.options.greedy && A.ui.intersect(B, A.extend(F, { offset: F.element.offset() }), F.options.tolerance)) { E = true; return false } }); if (E) { return false } if (this.options.accept.call(this.element, (B.currentItem || B.element))) { A.ui.plugin.call(this, "drop", [D, this.ui(B)]); this.element.triggerHandler("drop", [D, this.ui(B)], this.options.drop); return true } return false }, activate: function (C) { var B = A.ui.ddmanager.current; A.ui.plugin.call(this, "activate", [C, this.ui(B)]); if (B) { this.element.triggerHandler("dropactivate", [C, this.ui(B)], this.options.activate) } }, deactivate: function (C) { var B = A.ui.ddmanager.current; A.ui.plugin.call(this, "deactivate", [C, this.ui(B)]); if (B) { this.element.triggerHandler("dropdeactivate", [C, this.ui(B)], this.options.deactivate) } } }); A.extend(A.ui.droppable, { defaults: { disabled: false, tolerance: "intersect"} }); A.ui.intersect = function (L, F, J) { if (!F.offset) { return false } var D = (L.positionAbs || L.position.absolute).left, C = D + L.helperProportions.width, I = (L.positionAbs || L.position.absolute).top, H = I + L.helperProportions.height; var E = F.offset.left, B = E + F.proportions.width, K = F.offset.top, G = K + F.proportions.height; switch (J) { case "fit": return (E < D && C < B && K < I && H < G); break; case "intersect": return (E < D + (L.helperProportions.width / 2) && C - (L.helperProportions.width / 2) < B && K < I + (L.helperProportions.height / 2) && H - (L.helperProportions.height / 2) < G); break; case "pointer": return (E < ((L.positionAbs || L.position.absolute).left + (L.clickOffset || L.offset.click).left) && ((L.positionAbs || L.position.absolute).left + (L.clickOffset || L.offset.click).left) < B && K < ((L.positionAbs || L.position.absolute).top + (L.clickOffset || L.offset.click).top) && ((L.positionAbs || L.position.absolute).top + (L.clickOffset || L.offset.click).top) < G); break; case "touch": return ((I >= K && I <= G) || (H >= K && H <= G) || (I < K && H > G)) && ((D >= E && D <= B) || (C >= E && C <= B) || (D < E && C > B)); break; default: return false; break } }; A.ui.ddmanager = { current: null, droppables: [], prepareOffsets: function (D, F) { var B = A.ui.ddmanager.droppables; var E = F ? F.type : null; for (var C = 0; C < B.length; C++) { if (B[C].options.disabled || (D && !B[C].options.accept.call(B[C].element, (D.currentItem || D.element)))) { continue } B[C].visible = B[C].element.css("display") != "none"; if (!B[C].visible) { continue } B[C].offset = B[C].element.offset(); B[C].proportions = { width: B[C].element[0].offsetWidth, height: B[C].element[0].offsetHeight }; if (E == "dragstart" || E == "sortactivate") { B[C].activate.call(B[C], F) } } }, drop: function (B, C) { var D = false; A.each(A.ui.ddmanager.droppables, function () { if (!this.options) { return } if (!this.options.disabled && this.visible && A.ui.intersect(B, this, this.options.tolerance)) { D = this.drop.call(this, C) } if (!this.options.disabled && this.visible && this.options.accept.call(this.element, (B.currentItem || B.element))) { this.isout = 1; this.isover = 0; this.deactivate.call(this, C) } }); return D }, drag: function (B, C) { if (B.options.refreshPositions) { A.ui.ddmanager.prepareOffsets(B, C) } A.each(A.ui.ddmanager.droppables, function () { if (this.options.disabled || this.greedyChild || !this.visible) { return } var E = A.ui.intersect(B, this, this.options.tolerance); var G = !E && this.isover == 1 ? "isout" : (E && this.isover == 0 ? "isover" : null); if (!G) { return } var F; if (this.options.greedy) { var D = this.element.parents(".ui-droppable:eq(0)"); if (D.length) { F = A.data(D[0], "droppable"); F.greedyChild = (G == "isover" ? 1 : 0) } } if (F && G == "isover") { F["isover"] = 0; F["isout"] = 1; F.out.call(F, C) } this[G] = 1; this[G == "isout" ? "isover" : "isout"] = 0; this[G == "isover" ? "over" : "out"].call(this, C); if (F && G == "isout") { F["isout"] = 0; F["isover"] = 1; F.over.call(F, C) } }) } }; A.ui.plugin.add("droppable", "activeClass", { activate: function (C, B) { A(this).addClass(B.options.activeClass) }, deactivate: function (C, B) { A(this).removeClass(B.options.activeClass) }, drop: function (C, B) { A(this).removeClass(B.options.activeClass) } }); A.ui.plugin.add("droppable", "hoverClass", { over: function (C, B) { A(this).addClass(B.options.hoverClass) }, out: function (C, B) { A(this).removeClass(B.options.hoverClass) }, drop: function (C, B) { A(this).removeClass(B.options.hoverClass) } }) })(jQuery); (function (A) { A.widget("ui.resizable", A.extend({}, A.ui.mouse, { init: function () { var M = this, N = this.options; var Q = this.element.css("position"); this.originalElement = this.element; this.element.addClass("ui-resizable").css({ position: /static/.test(Q) ? "relative" : Q }); A.extend(N, { _aspectRatio: !!(N.aspectRatio), helper: N.helper || N.ghost || N.animate ? N.helper || "proxy" : null, knobHandles: N.knobHandles === true ? "ui-resizable-knob-handle" : N.knobHandles }); var H = "1px solid #DEDEDE"; N.defaultTheme = { "ui-resizable": { display: "block" }, "ui-resizable-handle": { position: "absolute", background: "#F2F2F2", fontSize: "0.1px" }, "ui-resizable-n": { cursor: "n-resize", height: "4px", left: "0px", right: "0px", borderTop: H }, "ui-resizable-s": { cursor: "s-resize", height: "4px", left: "0px", right: "0px", borderBottom: H }, "ui-resizable-e": { cursor: "e-resize", width: "4px", top: "0px", bottom: "0px", borderRight: H }, "ui-resizable-w": { cursor: "w-resize", width: "4px", top: "0px", bottom: "0px", borderLeft: H }, "ui-resizable-se": { cursor: "se-resize", width: "4px", height: "4px", borderRight: H, borderBottom: H }, "ui-resizable-sw": { cursor: "sw-resize", width: "4px", height: "4px", borderBottom: H, borderLeft: H }, "ui-resizable-ne": { cursor: "ne-resize", width: "4px", height: "4px", borderRight: H, borderTop: H }, "ui-resizable-nw": { cursor: "nw-resize", width: "4px", height: "4px", borderLeft: H, borderTop: H} }; N.knobTheme = { "ui-resizable-handle": { background: "#F2F2F2", border: "1px solid #808080", height: "8px", width: "8px" }, "ui-resizable-n": { cursor: "n-resize", top: "0px", left: "45%" }, "ui-resizable-s": { cursor: "s-resize", bottom: "0px", left: "45%" }, "ui-resizable-e": { cursor: "e-resize", right: "0px", top: "45%" }, "ui-resizable-w": { cursor: "w-resize", left: "0px", top: "45%" }, "ui-resizable-se": { cursor: "se-resize", right: "0px", bottom: "0px" }, "ui-resizable-sw": { cursor: "sw-resize", left: "0px", bottom: "0px" }, "ui-resizable-nw": { cursor: "nw-resize", left: "0px", top: "0px" }, "ui-resizable-ne": { cursor: "ne-resize", right: "0px", top: "0px"} }; N._nodeName = this.element[0].nodeName; if (N._nodeName.match(/canvas|textarea|input|select|button|img/i)) { var B = this.element; if (/relative/.test(B.css("position")) && A.browser.opera) { B.css({ position: "relative", top: "auto", left: "auto" }) } B.wrap(A('<div class="ui-wrapper"	style="overflow: hidden;"></div>').css({ position: B.css("position"), width: B.outerWidth(), height: B.outerHeight(), top: B.css("top"), left: B.css("left") })); var J = this.element; this.element = this.element.parent(); this.element.data("resizable", this); this.element.css({ marginLeft: J.css("marginLeft"), marginTop: J.css("marginTop"), marginRight: J.css("marginRight"), marginBottom: J.css("marginBottom") }); J.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0 }); if (A.browser.safari && N.preventDefault) { J.css("resize", "none") } N.proportionallyResize = J.css({ position: "static", zoom: 1, display: "block" }); this.element.css({ margin: J.css("margin") }); this._proportionallyResize() } if (!N.handles) { N.handles = !A(".ui-resizable-handle", this.element).length ? "e,s,se" : { n: ".ui-resizable-n", e: ".ui-resizable-e", s: ".ui-resizable-s", w: ".ui-resizable-w", se: ".ui-resizable-se", sw: ".ui-resizable-sw", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw"} } if (N.handles.constructor == String) { N.zIndex = N.zIndex || 1000; if (N.handles == "all") { N.handles = "n,e,s,w,se,sw,ne,nw" } var O = N.handles.split(","); N.handles = {}; var G = { handle: "position: absolute; display: none; overflow:hidden;", n: "top: 0pt; width:100%;", e: "right: 0pt; height:100%;", s: "bottom: 0pt; width:100%;", w: "left: 0pt; height:100%;", se: "bottom: 0pt; right: 0px;", sw: "bottom: 0pt; left: 0px;", ne: "top: 0pt; right: 0px;", nw: "top: 0pt; left: 0px;" }; for (var R = 0; R < O.length; R++) { var S = A.trim(O[R]), L = N.defaultTheme, F = "ui-resizable-" + S, C = !A.ui.css(F) && !N.knobHandles, P = A.ui.css("ui-resizable-knob-handle"), T = A.extend(L[F], L["ui-resizable-handle"]), D = A.extend(N.knobTheme[F], !P ? N.knobTheme["ui-resizable-handle"] : {}); var K = /sw|se|ne|nw/.test(S) ? { zIndex: ++N.zIndex} : {}; var I = (C ? G[S] : ""), E = A(['<div class="ui-resizable-handle ', F, '" style="', I, G.handle, '"></div>'].join("")).css(K); N.handles[S] = ".ui-resizable-" + S; this.element.append(E.css(C ? T : {}).css(N.knobHandles ? D : {}).addClass(N.knobHandles ? "ui-resizable-knob-handle" : "").addClass(N.knobHandles)) } if (N.knobHandles) { this.element.addClass("ui-resizable-knob").css(!A.ui.css("ui-resizable-knob") ? {} : {}) } } this._renderAxis = function (Y) { Y = Y || this.element; for (var V in N.handles) { if (N.handles[V].constructor == String) { N.handles[V] = A(N.handles[V], this.element).show() } if (N.transparent) { N.handles[V].css({ opacity: 0 }) } if (this.element.is(".ui-wrapper") && N._nodeName.match(/textarea|input|select|button/i)) { var W = A(N.handles[V], this.element), X = 0; X = /sw|ne|nw|se|n|s/.test(V) ? W.outerHeight() : W.outerWidth(); var U = ["padding", /ne|nw|n/.test(V) ? "Top" : /se|sw|s/.test(V) ? "Bottom" : /^e$/.test(V) ? "Right" : "Left"].join(""); if (!N.transparent) { Y.css(U, X) } this._proportionallyResize() } if (!A(N.handles[V]).length) { continue } } }; this._renderAxis(this.element); N._handles = A(".ui-resizable-handle", M.element); if (N.disableSelection) { N._handles.each(function (U, V) { A.ui.disableSelection(V) }) } N._handles.mouseover(function () { if (!N.resizing) { if (this.className) { var U = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i) } M.axis = N.axis = U && U[1] ? U[1] : "se" } }); if (N.autoHide) { N._handles.hide(); A(M.element).addClass("ui-resizable-autohide").hover(function () { A(this).removeClass("ui-resizable-autohide"); N._handles.show() }, function () { if (!N.resizing) { A(this).addClass("ui-resizable-autohide"); N._handles.hide() } }) } this.mouseInit() }, plugins: {}, ui: function () { return { originalElement: this.originalElement, element: this.element, helper: this.helper, position: this.position, size: this.size, options: this.options, originalSize: this.originalSize, originalPosition: this.originalPosition} }, propagate: function (C, B) { A.ui.plugin.call(this, C, [B, this.ui()]); if (C != "resize") { this.element.triggerHandler(["resize", C].join(""), [B, this.ui()], this.options[C]) } }, destroy: function () { var D = this.element, C = D.children(".ui-resizable").get(0); this.mouseDestroy(); var B = function (E) { A(E).removeClass("ui-resizable ui-resizable-disabled").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove() }; B(D); if (D.is(".ui-wrapper") && C) { D.parent().append(A(C).css({ position: D.css("position"), width: D.outerWidth(), height: D.outerHeight(), top: D.css("top"), left: D.css("left") })).end().remove(); B(C) } }, mouseStart: function (K) { if (this.options.disabled) { return false } var J = false; for (var H in this.options.handles) { if (A(this.options.handles[H])[0] == K.target) { J = true } } if (!J) { return false } var C = this.options, B = this.element.position(), D = this.element, I = function (O) { return parseInt(O, 10) || 0 }, G = A.browser.msie && A.browser.version < 7; C.resizing = true; C.documentScroll = { top: A(document).scrollTop(), left: A(document).scrollLeft() }; if (D.is(".ui-draggable") || (/absolute/).test(D.css("position"))) { var M = A.browser.msie && !C.containment && (/absolute/).test(D.css("position")) && !(/relative/).test(D.parent().css("position")); var L = M ? C.documentScroll.top : 0, F = M ? C.documentScroll.left : 0; D.css({ position: "absolute", top: (B.top + L), left: (B.left + F) }) } if (A.browser.opera && /relative/.test(D.css("position"))) { D.css({ position: "relative", top: "auto", left: "auto" }) } this._renderProxy(); var N = I(this.helper.css("left")), E = I(this.helper.css("top")); if (C.containment) { N += A(C.containment).scrollLeft() || 0; E += A(C.containment).scrollTop() || 0 } this.offset = this.helper.offset(); this.position = { left: N, top: E }; this.size = C.helper || G ? { width: D.outerWidth(), height: D.outerHeight()} : { width: D.width(), height: D.height() }; this.originalSize = C.helper || G ? { width: D.outerWidth(), height: D.outerHeight()} : { width: D.width(), height: D.height() }; this.originalPosition = { left: N, top: E }; this.sizeDiff = { width: D.outerWidth() - D.width(), height: D.outerHeight() - D.height() }; this.originalMousePosition = { left: K.pageX, top: K.pageY }; C.aspectRatio = (typeof C.aspectRatio == "number") ? C.aspectRatio : ((this.originalSize.height / this.originalSize.width) || 1); if (C.preserveCursor) { A("body").css("cursor", this.axis + "-resize") } this.propagate("start", K); return true }, mouseDrag: function (I) { var D = this.helper, C = this.options, J = {}, M = this, F = this.originalMousePosition, K = this.axis; var N = (I.pageX - F.left) || 0, L = (I.pageY - F.top) || 0; var E = this._change[K]; if (!E) { return false } var H = E.apply(this, [I, N, L]), G = A.browser.msie && A.browser.version < 7, B = this.sizeDiff; if (C._aspectRatio || I.shiftKey) { H = this._updateRatio(H, I) } H = this._respectSize(H, I); this.propagate("resize", I); D.css({ top: this.position.top + "px", left: this.position.left + "px", width: this.size.width + "px", height: this.size.height + "px" }); if (!C.helper && C.proportionallyResize) { this._proportionallyResize() } this._updateCache(H); this.element.triggerHandler("resize", [I, this.ui()], this.options["resize"]); return false }, mouseStop: function (I) { this.options.resizing = false; var E = this.options, H = function (M) { return parseInt(M, 10) || 0 }, K = this; if (E.helper) { var D = E.proportionallyResize, B = D && (/textarea/i).test(D.get(0).nodeName), C = B && A.ui.hasScroll(D.get(0), "left") ? 0 : K.sizeDiff.height, G = B ? 0 : K.sizeDiff.width; var L = { width: (K.size.width - G), height: (K.size.height - C) }, F = (parseInt(K.element.css("left"), 10) + (K.position.left - K.originalPosition.left)) || null, J = (parseInt(K.element.css("top"), 10) + (K.position.top - K.originalPosition.top)) || null; if (!E.animate) { this.element.css(A.extend(L, { top: J, left: F })) } if (E.helper && !E.animate) { this._proportionallyResize() } } if (E.preserveCursor) { A("body").css("cursor", "auto") } this.propagate("stop", I); if (E.helper) { this.helper.remove() } return false }, _updateCache: function (B) { var C = this.options; this.offset = this.helper.offset(); if (B.left) { this.position.left = B.left } if (B.top) { this.position.top = B.top } if (B.height) { this.size.height = B.height } if (B.width) { this.size.width = B.width } }, _updateRatio: function (D, E) { var F = this.options, G = this.position, C = this.size, B = this.axis; if (D.height) { D.width = (C.height / F.aspectRatio) } else { if (D.width) { D.height = (C.width * F.aspectRatio) } } if (B == "sw") { D.left = G.left + (C.width - D.width); D.top = null } if (B == "nw") { D.top = G.top + (C.height - D.height); D.left = G.left + (C.width - D.width) } return D }, _respectSize: function (H, I) { var F = this.helper, E = this.options, N = E._aspectRatio || I.shiftKey, M = this.axis, P = H.width && E.maxWidth && E.maxWidth < H.width, J = H.height && E.maxHeight && E.maxHeight < H.height, D = H.width && E.minWidth && E.minWidth > H.width, O = H.height && E.minHeight && E.minHeight > H.height; if (D) { H.width = E.minWidth } if (O) { H.height = E.minHeight } if (P) { H.width = E.maxWidth } if (J) { H.height = E.maxHeight } var C = this.originalPosition.left + this.originalSize.width, L = this.position.top + this.size.height; var G = /sw|nw|w/.test(M), B = /nw|ne|n/.test(M); if (D && G) { H.left = C - E.minWidth } if (P && G) { H.left = C - E.maxWidth } if (O && B) { H.top = L - E.minHeight } if (J && B) { H.top = L - E.maxHeight } var K = !H.width && !H.height; if (K && !H.left && H.top) { H.top = null } else { if (K && !H.top && H.left) { H.left = null } } return H }, _proportionallyResize: function () { var F = this.options; if (!F.proportionallyResize) { return } var D = F.proportionallyResize, C = this.helper || this.element; if (!F.borderDif) { var B = [D.css("borderTopWidth"), D.css("borderRightWidth"), D.css("borderBottomWidth"), D.css("borderLeftWidth")], E = [D.css("paddingTop"), D.css("paddingRight"), D.css("paddingBottom"), D.css("paddingLeft")]; F.borderDif = A.map(B, function (G, I) { var H = parseInt(G, 10) || 0, J = parseInt(E[I], 10) || 0; return H + J }) } D.css({ height: (C.height() - F.borderDif[0] - F.borderDif[2]) + "px", width: (C.width() - F.borderDif[1] - F.borderDif[3]) + "px" }) }, _renderProxy: function () { var C = this.element, F = this.options; this.elementOffset = C.offset(); if (F.helper) { this.helper = this.helper || A('<div style="overflow:hidden;"></div>'); var B = A.browser.msie && A.browser.version < 7, D = (B ? 1 : 0), E = (B ? 2 : -1); this.helper.addClass(F.helper).css({ width: C.outerWidth() + E, height: C.outerHeight() + E, position: "absolute", left: this.elementOffset.left - D + "px", top: this.elementOffset.top - D + "px", zIndex: ++F.zIndex }); this.helper.appendTo("body"); if (F.disableSelection) { A.ui.disableSelection(this.helper.get(0)) } } else { this.helper = C } }, _change: { e: function (D, C, B) { return { width: this.originalSize.width + C} }, w: function (F, C, B) { var G = this.options, D = this.originalSize, E = this.originalPosition; return { left: E.left + C, width: D.width - C} }, n: function (F, C, B) { var G = this.options, D = this.originalSize, E = this.originalPosition; return { top: E.top + B, height: D.height - B} }, s: function (D, C, B) { return { height: this.originalSize.height + B} }, se: function (D, C, B) { return A.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [D, C, B])) }, sw: function (D, C, B) { return A.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [D, C, B])) }, ne: function (D, C, B) { return A.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [D, C, B])) }, nw: function (D, C, B) { return A.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [D, C, B])) } } })); A.extend(A.ui.resizable, { defaults: { cancel: ":input", distance: 1, delay: 0, preventDefault: true, transparent: false, minWidth: 10, minHeight: 10, aspectRatio: false, disableSelection: true, preserveCursor: true, autoHide: false, knobHandles: false} }); A.ui.plugin.add("resizable", "containment", { start: function (I, K) { var E = K.options, M = A(this).data("resizable"), G = M.element; var C = E.containment, F = (C instanceof A) ? C.get(0) : (/parent/.test(C)) ? G.parent().get(0) : C; if (!F) { return } M.containerElement = A(F); if (/document/.test(C) || C == document) { M.containerOffset = { left: 0, top: 0 }; M.containerPosition = { left: 0, top: 0 }; M.parentData = { element: A(document), left: 0, top: 0, width: A(document).width(), height: A(document).height() || document.body.parentNode.scrollHeight} } else { M.containerOffset = A(F).offset(); M.containerPosition = A(F).position(); M.containerSize = { height: A(F).innerHeight(), width: A(F).innerWidth() }; var J = M.containerOffset, B = M.containerSize.height, H = M.containerSize.width, D = (A.ui.hasScroll(F, "left") ? F.scrollWidth : H), L = (A.ui.hasScroll(F) ? F.scrollHeight : B); M.parentData = { element: F, left: J.left, top: J.top, width: D, height: L} } }, resize: function (H, K) { var E = K.options, N = A(this).data("resizable"), C = N.containerSize, J = N.containerOffset, G = N.size, I = N.position, L = E._aspectRatio || H.shiftKey, B = { top: 0, left: 0 }, D = N.containerElement; if (D[0] != document && /static/.test(D.css("position"))) { B = N.containerPosition } if (I.left < (E.helper ? J.left : B.left)) { N.size.width = N.size.width + (E.helper ? (N.position.left - J.left) : (N.position.left - B.left)); if (L) { N.size.height = N.size.width * E.aspectRatio } N.position.left = E.helper ? J.left : B.left } if (I.top < (E.helper ? J.top : 0)) { N.size.height = N.size.height + (E.helper ? (N.position.top - J.top) : N.position.top); if (L) { N.size.width = N.size.height / E.aspectRatio } N.position.top = E.helper ? J.top : 0 } var F = (E.helper ? N.offset.left - J.left : (N.position.left - B.left)) + N.sizeDiff.width, M = (E.helper ? N.offset.top - J.top : N.position.top) + N.sizeDiff.height; if (F + N.size.width >= N.parentData.width) { N.size.width = N.parentData.width - F; if (L) { N.size.height = N.size.width * E.aspectRatio } } if (M + N.size.height >= N.parentData.height) { N.size.height = N.parentData.height - M; if (L) { N.size.width = N.size.height / E.aspectRatio } } }, stop: function (G, J) { var C = J.options, L = A(this).data("resizable"), H = L.position, I = L.containerOffset, B = L.containerPosition, D = L.containerElement; var E = A(L.helper), M = E.offset(), K = E.innerWidth(), F = E.innerHeight(); if (C.helper && !C.animate && /relative/.test(D.css("position"))) { A(this).css({ left: (M.left - I.left), top: (M.top - I.top), width: K, height: F }) } if (C.helper && !C.animate && /static/.test(D.css("position"))) { A(this).css({ left: B.left + (M.left - I.left), top: B.top + (M.top - I.top), width: K, height: F }) } } }); A.ui.plugin.add("resizable", "grid", { resize: function (H, J) { var D = J.options, L = A(this).data("resizable"), G = L.size, E = L.originalSize, F = L.originalPosition, K = L.axis, I = D._aspectRatio || H.shiftKey; D.grid = typeof D.grid == "number" ? [D.grid, D.grid] : D.grid; var C = Math.round((G.width - E.width) / (D.grid[0] || 1)) * (D.grid[0] || 1), B = Math.round((G.height - E.height) / (D.grid[1] || 1)) * (D.grid[1] || 1); if (/^(se|s|e)$/.test(K)) { L.size.width = E.width + C; L.size.height = E.height + B } else { if (/^(ne)$/.test(K)) { L.size.width = E.width + C; L.size.height = E.height + B; L.position.top = F.top - B } else { if (/^(sw)$/.test(K)) { L.size.width = E.width + C; L.size.height = E.height + B; L.position.left = F.left - C } else { L.size.width = E.width + C; L.size.height = E.height + B; L.position.top = F.top - B; L.position.left = F.left - C } } } } }); A.ui.plugin.add("resizable", "animate", { stop: function (I, K) { var F = K.options, L = A(this).data("resizable"); var E = F.proportionallyResize, B = E && (/textarea/i).test(E.get(0).nodeName), C = B && A.ui.hasScroll(E.get(0), "left") ? 0 : L.sizeDiff.height, H = B ? 0 : L.sizeDiff.width; var D = { width: (L.size.width - H), height: (L.size.height - C) }, G = (parseInt(L.element.css("left"), 10) + (L.position.left - L.originalPosition.left)) || null, J = (parseInt(L.element.css("top"), 10) + (L.position.top - L.originalPosition.top)) || null; L.element.animate(A.extend(D, J && G ? { top: J, left: G} : {}), { duration: F.animateDuration || "slow", easing: F.animateEasing || "swing", step: function () { var M = { width: parseInt(L.element.css("width"), 10), height: parseInt(L.element.css("height"), 10), top: parseInt(L.element.css("top"), 10), left: parseInt(L.element.css("left"), 10) }; if (E) { E.css({ width: M.width, height: M.height }) } L._updateCache(M); L.propagate("animate", I) } }) } }); A.ui.plugin.add("resizable", "ghost", { start: function (E, D) { var F = D.options, B = A(this).data("resizable"), G = F.proportionallyResize, C = B.size; if (!G) { B.ghost = B.element.clone() } else { B.ghost = G.clone() } B.ghost.css({ opacity: 0.25, display: "block", position: "relative", height: C.height, width: C.width, margin: 0, left: 0, top: 0 }).addClass("ui-resizable-ghost").addClass(typeof F.ghost == "string" ? F.ghost : ""); B.ghost.appendTo(B.helper) }, resize: function (D, C) { var E = C.options, B = A(this).data("resizable"), F = E.proportionallyResize; if (B.ghost) { B.ghost.css({ position: "relative", height: B.size.height, width: B.size.width }) } }, stop: function (D, C) { var E = C.options, B = A(this).data("resizable"), F = E.proportionallyResize; if (B.ghost && B.helper) { B.helper.get(0).removeChild(B.ghost.get(0)) } } }); A.ui.plugin.add("resizable", "alsoResize", { start: function (E, C) { var F = C.options, B = A(this).data("resizable"), D = function (G) { A(G).each(function () { A(this).data("resizable-alsoresize", { width: parseInt(A(this).width(), 10), height: parseInt(A(this).height(), 10), left: parseInt(A(this).css("left"), 10), top: parseInt(A(this).css("top"), 10) }) }) }; if (typeof (F.alsoResize) == "object") { if (F.alsoResize.length) { F.alsoResize = F.alsoResize[0]; D(F.alsoResize) } else { A.each(F.alsoResize, function (G, H) { D(G) }) } } else { D(F.alsoResize) } }, resize: function (F, E) { var G = E.options, C = A(this).data("resizable"), D = C.originalSize, I = C.originalPosition; var H = { height: (C.size.height - D.height) || 0, width: (C.size.width - D.width) || 0, top: (C.position.top - I.top) || 0, left: (C.position.left - I.left) || 0 }, B = function (J, K) { A(J).each(function () { var N = A(this).data("resizable-alsoresize"), M = {}, L = K && K.length ? K : ["width", "height", "top", "left"]; A.each(L || ["width", "height", "top", "left"], function (O, Q) { var P = (N[Q] || 0) + (H[Q] || 0); if (P && P >= 0) { M[Q] = P || null } }); A(this).css(M) }) }; if (typeof (G.alsoResize) == "object") { A.each(G.alsoResize, function (J, K) { B(J, K) }) } else { B(G.alsoResize) } }, stop: function (C, B) { A(this).removeData("resizable-alsoresize-start") } }) })(jQuery); (function (B) { var A = { dragStart: "start.draggable", drag: "drag.draggable", dragStop: "stop.draggable", maxHeight: "maxHeight.resizable", minHeight: "minHeight.resizable", maxWidth: "maxWidth.resizable", minWidth: "minWidth.resizable", resizeStart: "start.resizable", resize: "drag.resizable", resizeStop: "stop.resizable" }; B.widget("ui.dialog", { init: function () { var J = this, K = this.options, D = typeof K.resizable == "string" ? K.resizable : "n,e,s,w,se,sw,ne,nw", E = this.element.addClass("ui-dialog-content").wrap("<div/>").wrap("<div/>"), G = (this.uiDialogContainer = E.parent().addClass("ui-dialog-container").css({ position: "relative", width: "100%", height: "100%" })), H = K.title || E.attr("title") || "", C = (this.uiDialogTitlebar = B('<div class="ui-dialog-titlebar"/>')).append('<span class="ui-dialog-title">' + H + "</span>").append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>').prependTo(G), I = (this.uiDialog = G.parent()).appendTo(document.body).hide().addClass("ui-dialog").addClass(K.dialogClass).addClass(E.attr("className")).removeClass("ui-dialog-content").css({ position: "absolute", width: K.width, height: K.height, overflow: "hidden", zIndex: K.zIndex }).attr("tabIndex", -1).css("outline", 0).keydown(function (L) { if (K.closeOnEscape) { var M = 27; (L.keyCode && L.keyCode == M && J.close()); $.cookie('dialogOpen', null, { path: '/', expires: 1000 }); } }).mousedown(function () { J.moveToTop() }), F = (this.uiDialogButtonPane = B("<div/>")).addClass("ui-dialog-buttonpane").css({ position: "absolute", bottom: 0 }).appendTo(I); this.uiDialogTitlebarClose = B(".ui-dialog-titlebar-close", C).hover(function () { B(this).addClass("ui-dialog-titlebar-close-hover") }, function () { B(this).removeClass("ui-dialog-titlebar-close-hover") }).mousedown(function (L) { L.stopPropagation() }).click(function () { J.close(); $.cookie('dialogOpen', null, { path: '/', expires: 1000 }); return false }); this.uiDialogTitlebar.find("*").add(this.uiDialogTitlebar).each(function () { B.ui.disableSelection(this) }); if (B.fn.draggable) { I.draggable({ cancel: ".ui-dialog-content", helper: K.dragHelper, handle: ".ui-dialog-titlebar", start: function (M, L) { J.moveToTop(); (K.dragStart && K.dragStart.apply(J.element[0], arguments)) }, drag: function (M, L) { (K.drag && K.drag.apply(J.element[0], arguments)) }, stop: function (M, L) { (K.dragStop && K.dragStop.apply(J.element[0], arguments)); B.ui.dialog.overlay.resize() } }); (K.draggable || I.draggable("disable")) } if (B.fn.resizable) { I.resizable({ cancel: ".ui-dialog-content", helper: K.resizeHelper, maxWidth: K.maxWidth, maxHeight: K.maxHeight, minWidth: K.minWidth, minHeight: K.minHeight, start: function () { (K.resizeStart && K.resizeStart.apply(J.element[0], arguments)) }, resize: function (M, L) { (K.autoResize && J.size.apply(J)); (K.resize && K.resize.apply(J.element[0], arguments)) }, handles: D, stop: function (M, L) { (K.autoResize && J.size.apply(J)); (K.resizeStop && K.resizeStop.apply(J.element[0], arguments)); B.ui.dialog.overlay.resize() } }); (K.resizable || I.resizable("disable")) } this.createButtons(K.buttons); this.isOpen = false; (K.bgiframe && B.fn.bgiframe && I.bgiframe()); (K.autoOpen && this.open()) }, setData: function (C, D) { (A[C] && this.uiDialog.data(A[C], D)); switch (C) { case "buttons": this.createButtons(D); break; case "draggable": this.uiDialog.draggable(D ? "enable" : "disable"); break; case "height": this.uiDialog.height(D); break; case "position": this.position(D); break; case "resizable": (typeof D == "string" && this.uiDialog.data("handles.resizable", D)); this.uiDialog.resizable(D ? "enable" : "disable"); break; case "title": B(".ui-dialog-title", this.uiDialogTitlebar).text(D); break; case "width": this.uiDialog.width(D); break } B.widget.prototype.setData.apply(this, arguments) }, position: function (H) { var D = B(window), E = B(document), F = E.scrollTop(), C = E.scrollLeft(), G = F; if (B.inArray(H, ["center", "top", "right", "bottom", "left"]) >= 0) { H = [H == "right" || H == "left" ? H : "center", H == "top" || H == "bottom" ? H : "middle"] } if (H.constructor != Array) { H = ["center", "middle"] } if (H[0].constructor == Number) { C += H[0] } else { switch (H[0]) { case "left": C += 0; break; case "right": C += D.width() - this.uiDialog.width(); break; default: case "center": C += (D.width() - this.uiDialog.width()) / 2 } } if (H[1].constructor == Number) { F += H[1] } else { switch (H[1]) { case "top": F += 0; break; case "bottom": F += D.height() - this.uiDialog.height(); break; default: case "middle": F += (D.height() - this.uiDialog.height()) / 2 } } F = Math.max(F, G); this.uiDialog.css({ top: F, left: C }) }, size: function () { var D = this.uiDialogContainer, G = this.uiDialogTitlebar, E = this.element, F = parseInt(E.css("margin-top"), 10) + parseInt(E.css("margin-bottom"), 10), C = parseInt(E.css("margin-left"), 10) + parseInt(E.css("margin-right"), 10); E.height(D.height() - G.outerHeight() - F); E.width(D.width() - C) }, open: function () { if (this.isOpen) { return } this.overlay = this.options.modal ? new B.ui.dialog.overlay(this) : null; (this.uiDialog.next().length > 0) && this.uiDialog.appendTo("body"); this.position(this.options.position); this.uiDialog.show(this.options.show); this.options.autoResize && this.size(); this.moveToTop(true); var C = null; var D = { options: this.options }; this.uiDialogTitlebarClose.focus(); this.element.triggerHandler("dialogopen", [C, D], this.options.open); this.isOpen = true }, moveToTop: function (E) { if ((this.options.modal && !E) || (!this.options.stack && !this.options.modal)) { return this.element.triggerHandler("dialogfocus", [null, { options: this.options}], this.options.focus) } var D = this.options.zIndex, C = this.options; B(".ui-dialog:visible").each(function () { D = Math.max(D, parseInt(B(this).css("z-index"), 10) || C.zIndex) }); (this.overlay && this.overlay.$el.css("z-index", ++D)); this.uiDialog.css("z-index", ++D); this.element.triggerHandler("dialogfocus", [null, { options: this.options}], this.options.focus) }, close: function () { (this.overlay && this.overlay.destroy()); this.uiDialog.hide(this.options.hide); var D = null; var C = { options: this.options }; this.element.triggerHandler("dialogclose", [D, C], this.options.close); B.ui.dialog.overlay.resize(); this.isOpen = false }, destroy: function () { (this.overlay && this.overlay.destroy()); this.uiDialog.hide(); this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content").hide().appendTo("body"); this.uiDialog.remove() }, createButtons: function (F) { var E = this, C = false, D = this.uiDialogButtonPane; D.empty().hide(); B.each(F, function () { return !(C = true) }); if (C) { D.show(); B.each(F, function (G, H) { B("<button/>").text(G).click(function () { H.apply(E.element[0], arguments) }).appendTo(D) }) } } }); B.extend(B.ui.dialog, { defaults: { autoOpen: true, autoResize: true, bgiframe: false, buttons: {}, closeOnEscape: true, draggable: true, height: 200, minHeight: 100, minWidth: 150, modal: false, overlay: {}, position: "center", resizable: true, stack: true, width: 300, zIndex: 1000 }, overlay: function (C) { this.$el = B.ui.dialog.overlay.create(C) } }); B.extend(B.ui.dialog.overlay, { instances: [], 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 () { B("a, :input").bind(B.ui.dialog.overlay.events, function () { var F = false; var H = B(this).parents(".ui-dialog"); if (H.length) { var E = B(".ui-dialog-overlay"); if (E.length) { var G = parseInt(E.css("z-index"), 10); E.each(function () { G = Math.max(G, parseInt(B(this).css("z-index"), 10)) }); F = parseInt(H.css("z-index"), 10) > G } else { F = true } } return F }) }, 1); B(document).bind("keydown.dialog-overlay", function (E) { var F = 27; (E.keyCode && E.keyCode == F && D.close()) }); B(window).bind("resize.dialog-overlay", B.ui.dialog.overlay.resize) } var C = B("<div/>").appendTo(document.body).addClass("ui-dialog-overlay").css(B.extend({ borderWidth: 0, margin: 0, padding: 0, position: "absolute", top: 0, left: 0, width: this.width(), height: this.height() }, D.options.overlay)); (D.options.bgiframe && B.fn.bgiframe && C.bgiframe()); this.instances.push(C); return C }, destroy: function (C) { this.instances.splice(B.inArray(this.instances, C), 1); if (this.instances.length === 0) { B("a, :input").add([document, window]).unbind(".dialog-overlay") } C.remove() }, height: function () { if (B.browser.msie && B.browser.version < 7) { var D = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); var 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 () { if (B.browser.msie && B.browser.version < 7) { var C = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth); var 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); (function (A) { A.widget("ui.tabs", { init: function () { this.options.event += ".tabs"; this.tabify(true) }, setData: function (B, C) { if ((/^selected/).test(B)) { this.select(C) } else { this.options[B] = C; this.tabify() } }, length: function () { return this.$tabs.length }, tabId: function (B) { return B.title && B.title.replace(/\s/g, "_").replace(/[^A-Za-z0-9\-_:\.]/g, "") || this.options.idPrefix + A.data(B) }, ui: function (C, B) { return { options: this.options, tab: C, panel: B, index: this.$tabs.index(C)} }, tabify: function (O) { this.$lis = A("li:has(a[href])", this.element); this.$tabs = this.$lis.map(function () { return A("a", this)[0] }); this.$panels = A([]); var P = this, D = this.options; this.$tabs.each(function (R, Q) { if (Q.hash && Q.hash.replace("#", "")) { P.$panels = P.$panels.add(Q.hash) } else { if (A(Q).attr("href") != "#") { A.data(Q, "href.tabs", Q.href); A.data(Q, "load.tabs", Q.href); var T = P.tabId(Q); Q.href = "#" + T; var S = A("#" + T); if (!S.length) { S = A(D.panelTemplate).attr("id", T).addClass(D.panelClass).insertAfter(P.$panels[R - 1] || P.element); S.data("destroy.tabs", true) } P.$panels = P.$panels.add(S) } else { D.disabled.push(R + 1) } } }); if (O) { this.element.addClass(D.navClass); this.$panels.each(function () { var Q = A(this); Q.addClass(D.panelClass) }); if (D.selected === undefined) { if (location.hash) { this.$tabs.each(function (S, Q) { if (Q.hash == location.hash) { D.selected = S; if (A.browser.msie || A.browser.opera) { var R = A(location.hash), T = R.attr("id"); R.attr("id", ""); setTimeout(function () { R.attr("id", T) }, 500) } scrollTo(0, 0); return false } }) } else { if (D.cookie) { var J = parseInt(A.cookie("ui-tabs" + A.data(P.element)), 10); if (J && P.$tabs[J]) { D.selected = J } } else { if (P.$lis.filter("." + D.selectedClass).length) { D.selected = P.$lis.index(P.$lis.filter("." + D.selectedClass)[0]) } } } } D.selected = D.selected === null || D.selected !== undefined ? D.selected : 0; D.disabled = A.unique(D.disabled.concat(A.map(this.$lis.filter("." + D.disabledClass), function (R, Q) { return P.$lis.index(R) }))).sort(); if (A.inArray(D.selected, D.disabled) != -1) { D.disabled.splice(A.inArray(D.selected, D.disabled), 1) } this.$panels.addClass(D.hideClass); this.$lis.removeClass(D.selectedClass); if (D.selected !== null) { this.$panels.eq(D.selected).show().removeClass(D.hideClass); this.$lis.eq(D.selected).addClass(D.selectedClass); var K = function () { A(P.element).triggerHandler("tabsshow", [P.fakeEvent("tabsshow"), P.ui(P.$tabs[D.selected], P.$panels[D.selected])], D.show) }; if (A.data(this.$tabs[D.selected], "load.tabs")) { this.load(D.selected, K) } else { K() } } A(window).bind("unload", function () { P.$tabs.unbind(".tabs"); P.$lis = P.$tabs = P.$panels = null }) } for (var G = 0, N; N = this.$lis[G]; G++) { A(N)[A.inArray(G, D.disabled) != -1 && !A(N).hasClass(D.selectedClass) ? "addClass" : "removeClass"](D.disabledClass) } if (D.cache === false) { this.$tabs.removeData("cache.tabs") } var C, I, B = { "min-width": 0, duration: 1 }, E = "normal"; if (D.fx && D.fx.constructor == Array) { C = D.fx[0] || B, I = D.fx[1] || B } else { C = I = D.fx || B } var H = { display: "", overflow: "", height: "" }; if (!A.browser.msie) { H.opacity = "" } function M(R, Q, S) { Q.animate(C, C.duration || E, function () { Q.addClass(D.hideClass).css(H); if (A.browser.msie && C.opacity) { Q[0].style.filter = "" } if (S) { L(R, S, Q) } }) } function L(R, S, Q) { if (I === B) { S.css("display", "block") } S.animate(I, I.duration || E, function () { S.removeClass(D.hideClass).css(H); if (A.browser.msie && I.opacity) { S[0].style.filter = "" } A(P.element).triggerHandler("tabsshow", [P.fakeEvent("tabsshow"), P.ui(R, S[0])], D.show) }) } function F(R, T, Q, S) { T.addClass(D.selectedClass).siblings().removeClass(D.selectedClass); M(R, Q, S) } this.$tabs.unbind(".tabs").bind(D.event, function () { var T = A(this).parents("li:eq(0)"), Q = P.$panels.filter(":visible"), S = A(this.hash); if ((T.hasClass(D.selectedClass) && !D.unselect) || T.hasClass(D.disabledClass) || A(this).hasClass(D.loadingClass) || A(P.element).triggerHandler("tabsselect", [P.fakeEvent("tabsselect"), P.ui(this, S[0])], D.select) === false) { this.blur(); return false } P.options.selected = P.$tabs.index(this); if (D.unselect) { if (T.hasClass(D.selectedClass)) { P.options.selected = null; T.removeClass(D.selectedClass); P.$panels.stop(); M(this, Q); this.blur(); return false } else { if (!Q.length) { P.$panels.stop(); var R = this; P.load(P.$tabs.index(this), function () { T.addClass(D.selectedClass).addClass(D.unselectClass); L(R, S) }); this.blur(); return false } } } if (D.cookie) { A.cookie("ui-tabs" + A.data(P.element), P.options.selected, D.cookie) } P.$panels.stop(); if (S.length) { var R = this; P.load(P.$tabs.index(this), Q.length ? function () { F(R, T, Q, S) } : function () { T.addClass(D.selectedClass); L(R, S) }) } else { throw "jQuery UI Tabs: Mismatching fragment identifier." } if (A.browser.msie) { this.blur() } return false }); if (!(/^click/).test(D.event)) { this.$tabs.bind("click.tabs", function () { return false }) } }, add: function (E, D, C) { if (C == undefined) { C = this.$tabs.length } var G = this.options; var I = A(G.tabTemplate.replace(/#\{href\}/g, E).replace(/#\{label\}/g, D)); I.data("destroy.tabs", true); var H = E.indexOf("#") == 0 ? E.replace("#", "") : this.tabId(A("a:first-child", I)[0]); var F = A("#" + H); if (!F.length) { F = A(G.panelTemplate).attr("id", H).addClass(G.hideClass).data("destroy.tabs", true) } F.addClass(G.panelClass); if (C >= this.$lis.length) { I.appendTo(this.element); F.appendTo(this.element[0].parentNode) } else { I.insertBefore(this.$lis[C]); F.insertBefore(this.$panels[C]) } G.disabled = A.map(G.disabled, function (K, J) { return K >= C ? ++K : K }); this.tabify(); if (this.$tabs.length == 1) { I.addClass(G.selectedClass); F.removeClass(G.hideClass); var B = A.data(this.$tabs[0], "load.tabs"); if (B) { this.load(C, B) } } this.element.triggerHandler("tabsadd", [this.fakeEvent("tabsadd"), this.ui(this.$tabs[C], this.$panels[C])], G.add) }, remove: function (B) { var D = this.options, E = this.$lis.eq(B).remove(), C = this.$panels.eq(B).remove(); if (E.hasClass(D.selectedClass) && this.$tabs.length > 1) { this.select(B + (B + 1 < this.$tabs.length ? 1 : -1)) } D.disabled = A.map(A.grep(D.disabled, function (G, F) { return G != B }), function (G, F) { return G >= B ? --G : G }); this.tabify(); this.element.triggerHandler("tabsremove", [this.fakeEvent("tabsremove"), this.ui(E.find("a")[0], C[0])], D.remove) }, enable: function (B) { var C = this.options; if (A.inArray(B, C.disabled) == -1) { return } var D = this.$lis.eq(B).removeClass(C.disabledClass); if (A.browser.safari) { D.css("display", "inline-block"); setTimeout(function () { D.css("display", "block") }, 0) } C.disabled = A.grep(C.disabled, function (F, E) { return F != B }); this.element.triggerHandler("tabsenable", [this.fakeEvent("tabsenable"), this.ui(this.$tabs[B], this.$panels[B])], C.enable) }, disable: function (C) { var B = this, D = this.options; if (C != D.selected) { this.$lis.eq(C).addClass(D.disabledClass); D.disabled.push(C); D.disabled.sort(); this.element.triggerHandler("tabsdisable", [this.fakeEvent("tabsdisable"), this.ui(this.$tabs[C], this.$panels[C])], D.disable) } }, select: function (B) { if (typeof B == "string") { B = this.$tabs.index(this.$tabs.filter("[href$=" + B + "]")[0]) } this.$tabs.eq(B).trigger(this.options.event) }, load: function (G, K) { var L = this, D = this.options, E = this.$tabs.eq(G), J = E[0], H = K == undefined || K === false, B = E.data("load.tabs"); K = K || function () { }; if (!B || !H && A.data(J, "cache.tabs")) { K(); return } var M = function (N) { var O = A(N), P = O.find("*:last"); return P.length && P.is(":not(img)") && P || O }; var C = function () { L.$tabs.filter("." + D.loadingClass).removeClass(D.loadingClass).each(function () { if (D.spinner) { M(this).parent().html(M(this).data("label.tabs")) } }); L.xhr = null }; if (D.spinner) { var I = M(J).html(); M(J).wrapInner("<em></em>").find("em").data("label.tabs", I).html(D.spinner) } var F = A.extend({}, D.ajaxOptions, { url: B, success: function (O, N) { A(J.hash).html(O); C(); if (D.cache) { A.data(J, "cache.tabs", true) } A(L.element).triggerHandler("tabsload", [L.fakeEvent("tabsload"), L.ui(L.$tabs[G], L.$panels[G])], D.load); D.ajaxOptions.success && D.ajaxOptions.success(O, N); K() } }); if (this.xhr) { this.xhr.abort(); C() } E.addClass(D.loadingClass); setTimeout(function () { L.xhr = A.ajax(F) }, 0) }, url: function (C, B) { this.$tabs.eq(C).removeData("cache.tabs").data("load.tabs", B) }, destroy: function () { var B = this.options; this.element.unbind(".tabs").removeClass(B.navClass).removeData("tabs"); this.$tabs.each(function () { var C = A.data(this, "href.tabs"); if (C) { this.href = C } var D = A(this).unbind(".tabs"); A.each(["href", "load", "cache"], function (E, F) { D.removeData(F + ".tabs") }) }); this.$lis.add(this.$panels).each(function () { if (A.data(this, "destroy.tabs")) { A(this).remove() } else { A(this).removeClass([B.selectedClass, B.unselectClass, B.disabledClass, B.panelClass, B.hideClass].join(" ")) } }) }, fakeEvent: function (B) { return A.event.fix({ type: B, target: this.element[0] }) } }); A.ui.tabs.defaults = { unselect: false, event: "click", disabled: [], cookie: null, spinner: "Loading&#8230;", cache: false, idPrefix: "ui-tabs-", ajaxOptions: {}, fx: null, tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>', panelTemplate: "<div></div>", navClass: "ui-tabs-nav", selectedClass: "ui-tabs-selected", unselectClass: "ui-tabs-unselect", disabledClass: "ui-tabs-disabled", panelClass: "ui-tabs-panel", hideClass: "ui-tabs-hide", loadingClass: "ui-tabs-loading" }; A.ui.tabs.getter = "length"; A.extend(A.ui.tabs.prototype, { rotation: null, rotate: function (C, F) { F = F || false; var B = this, E = this.options.selected; function G() { B.rotation = setInterval(function () { E = ++E < B.$tabs.length ? E : 0; B.select(E) }, C) } function D(H) { if (!H || H.clientX) { clearInterval(B.rotation) } } if (C) { G(); if (!F) { this.$tabs.bind(this.options.event, D) } else { this.$tabs.bind(this.options.event, function () { D(); E = B.options.selected; G() }) } } else { D(); this.$tabs.unbind(this.options.event, D) } } }) })(jQuery);


/**
* jCarousel - Riding carousels with jQuery
*   http://sorgalla.com/jcarousel/
*
* Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* Built on top of the jQuery library
*   http://jquery.com
*
* Inspired by the "Carousel Component" by Bill Scott
*   http://billwscott.com/carousel/
*
* chg by chia --to prevent the alert box always poo-up, changed the script from 'loop|infinite|an|cause|will|This|items|set|No|jCarousel|alert|' to 'loop|infinite|an|cause|will|This|items|set|No|jCarousel|isNaN|' 
*/

eval(function (p, a, c, k, e, r) { e = function (c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function (e) { return r[e] } ]; e = function () { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('(9($){$.1v.C=9(o){z 4.1b(9(){3p r(4,o)})};8 q={Z:F,25:1,21:1,u:7,1c:3,15:7,1K:\'2X\',2c:\'2Q\',1q:0,B:7,1j:7,1G:7,2F:7,2B:7,2z:7,2x:7,2v:7,2s:7,2p:7,1S:\'<P></P>\',1Q:\'<P></P>\',2m:\'2l\',2k:\'2l\',1O:7,1L:7};$.C=9(e,o){4.5=$.16({},q,o||{});4.Q=F;4.D=7;4.H=7;4.t=7;4.U=7;4.R=7;4.N=!4.5.Z?\'1H\':\'26\';4.E=!4.5.Z?\'24\':\'23\';8 a=\'\',1e=e.K.1e(\' \');1r(8 i=0;i<1e.I;i++){6(1e[i].2y(\'C-2w\')!=-1){$(e).1E(1e[i]);8 a=1e[i];1p}}6(e.2t==\'3o\'||e.2t==\'3n\'){4.t=$(e);4.D=4.t.19();6(4.D.1o(\'C-H\')){6(!4.D.19().1o(\'C-D\'))4.D=4.D.B(\'<P></P>\');4.D=4.D.19()}10 6(!4.D.1o(\'C-D\'))4.D=4.t.B(\'<P></P>\').19()}10{4.D=$(e);4.t=$(e).3h(\'>2o,>2n,P>2o,P>2n\')}6(a!=\'\'&&4.D.19()[0].K.2y(\'C-2w\')==-1)4.D.B(\'<P 3g=" \'+a+\'"></P>\');4.H=4.t.19();6(!4.H.I||!4.H.1o(\'C-H\'))4.H=4.t.B(\'<P></P>\').19();4.R=$(\'.C-11\',4.D);6(4.R.u()==0&&4.5.1Q!=7)4.R=4.H.1z(4.5.1Q).11();4.R.V(4.K(\'C-11\'));4.U=$(\'.C-17\',4.D);6(4.U.u()==0&&4.5.1S!=7)4.U=4.H.1z(4.5.1S).11();4.U.V(4.K(\'C-17\'));4.H.V(4.K(\'C-H\'));4.t.V(4.K(\'C-t\'));4.D.V(4.K(\'C-D\'));8 b=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 c=4.t.32(\'1F\');8 d=4;6(c.u()>0){8 f=0,i=4.5.21;c.1b(9(){d.1I(4,i++);f+=d.S(4,b)});4.t.y(4.N,f+\'T\');6(!o||o.u===J)4.5.u=c.u()}4.D.y(\'1y\',\'1A\');4.U.y(\'1y\',\'1A\');4.R.y(\'1y\',\'1A\');4.2G=9(){d.17()};4.2b=9(){d.11()};4.1U=9(){d.2q()};6(4.5.1j!=7)4.5.1j(4,\'2a\');6($.2A.28){4.1f(F,F);$(27).1u(\'2I\',9(){d.1t()})}10 4.1t()};8 r=$.C;r.1v=r.2H={C:\'0.2.3\'};r.1v.16=r.16=$.16;r.1v.16({1t:9(){4.A=7;4.G=7;4.X=7;4.13=7;4.14=F;4.1d=7;4.O=7;4.W=F;6(4.Q)z;4.t.y(4.E,4.1s(4.5.21)+\'T\');8 p=4.1s(4.5.25);4.X=4.13=7;4.1i(p,F);$(27).22(\'2E\',4.1U).1u(\'2E\',4.1U)},2D:9(){4.t.2C();4.t.y(4.E,\'3u\');4.t.y(4.N,\'3t\');6(4.5.1j!=7)4.5.1j(4,\'2D\');4.1t()},2q:9(){6(4.O!=7&&4.W)4.t.y(4.E,r.M(4.t.y(4.E))+4.O);4.O=7;4.W=F;6(4.5.1G!=7)4.5.1G(4);6(4.5.15!=7){8 a=4;8 b=1k.1P(4.1m()/4.5.15),N=0,E=0;$(\'1F\',4.t).1b(9(i){N+=a.S(4,b);6(i+1<a.A)E=N});4.t.y(4.N,N+\'T\');4.t.y(4.E,-E+\'T\')}4.1c(4.A,F)},3s:9(){4.Q=1h;4.1f()},3r:9(){4.Q=F;4.1f()},u:9(s){6(s!=J){4.5.u=s;6(!4.Q)4.1f()}z 4.5.u},3q:9(i,a){6(a==J||!a)a=i;6(4.5.u!==7&&a>4.5.u)a=4.5.u;1r(8 j=i;j<=a;j++){8 e=4.L(j);6(!e.I||e.1o(\'C-1a-1D\'))z F}z 1h},L:9(i){z $(\'.C-1a-\'+i,4.t)},2u:9(i,s){8 e=4.L(i),20=0,2u=0;6(e.I==0){8 c,e=4.1B(i),j=r.M(i);1n(c=4.L(--j)){6(j<=0||c.I){j<=0?4.t.2r(e):c.1X(e);1p}}}10 20=4.S(e);e.1E(4.K(\'C-1a-1D\'));1R s==\'3l\'?e.3k(s):e.2C().3j(s);8 a=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 b=4.S(e,a)-20;6(i>0&&i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))-b+\'T\');4.t.y(4.N,r.M(4.t.y(4.N))+b+\'T\');z e},1V:9(i){8 e=4.L(i);6(!e.I||(i>=4.A&&i<=4.G))z;8 d=4.S(e);6(i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))+d+\'T\');e.1V();4.t.y(4.N,r.M(4.t.y(4.N))-d+\'T\')},17:9(){4.1C();6(4.O!=7&&!4.W)4.1T(F);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'G\')&&4.5.u!=7&&4.G==4.5.u)?1:4.A+4.5.1c)},11:9(){4.1C();6(4.O!=7&&4.W)4.1T(1h);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'A\')&&4.5.u!=7&&4.A==1)?4.5.u:4.A-4.5.1c)},1T:9(b){6(4.Q||4.14||!4.O)z;8 a=r.M(4.t.y(4.E));!b?a-=4.O:a+=4.O;4.W=!b;4.X=4.A;4.13=4.G;4.1i(a)},1c:9(i,a){6(4.Q||4.14)z;4.1i(4.1s(i),a)},1s:9(i){6(4.Q||4.14)z;6(4.5.B!=\'18\')i=i<1?1:(4.5.u&&i>4.5.u?4.5.u:i);8 a=4.A>i;8 b=r.M(4.t.y(4.E));8 f=4.5.B!=\'18\'&&4.A<=1?1:4.A;8 c=a?4.L(f):4.L(4.G);8 j=a?f:f-1;8 e=7,l=0,p=F,d=0;1n(a?--j>=i:++j<i){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c[a?\'1z\':\'1X\'](e)}c=e;d=4.S(e);6(p)l+=d;6(4.A!=7&&(4.5.B==\'18\'||(j>=1&&(4.5.u==7||j<=4.5.u))))b=a?b+d:b-d}8 g=4.1m();8 h=[];8 k=0,j=i,v=0;8 c=4.L(i-1);1n(++k){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c.I==0?4.t.2r(e):c[a?\'1z\':\'1X\'](e)}c=e;8 d=4.S(e);6(d==0){3f(\'3e: 3d 1H/26 3c 1r 3b. 3a 39 38 37 36 35. 34...\');z 0}6(4.5.B!=\'18\'&&4.5.u!==7&&j>4.5.u)h.33(e);10 6(p)l+=d;v+=d;6(v>=g)1p;j++}1r(8 x=0;x<h.I;x++)h[x].1V();6(l>0){4.t.y(4.N,4.S(4.t)+l+\'T\');6(a){b-=l;4.t.y(4.E,r.M(4.t.y(4.E))-l+\'T\')}}8 n=i+k-1;6(4.5.B!=\'18\'&&4.5.u&&n>4.5.u)n=4.5.u;6(j>n){k=0,j=n,v=0;1n(++k){8 e=4.L(j--);6(!e.I)1p;v+=4.S(e);6(v>=g)1p}}8 o=n-k+1;6(4.5.B!=\'18\'&&o<1)o=1;6(4.W&&a){b+=4.O;4.W=F}4.O=7;6(4.5.B!=\'18\'&&n==4.5.u&&(n-k+1)>=1){8 m=r.Y(4.L(n),!4.5.Z?\'1l\':\'1N\');6((v-m)>g)4.O=v-g-m}1n(i-->o)b+=4.S(4.L(i));4.X=4.A;4.13=4.G;4.A=o;4.G=n;z b},1i:9(p,a){6(4.Q||4.14)z;4.14=1h;8 b=4;8 c=9(){b.14=F;6(p==0)b.t.y(b.E,0);6(b.5.B==\'1Z\'||b.5.B==\'G\'||b.5.u==7||b.G<b.5.u)b.2j();b.1f();b.1M(\'2i\')};4.1M(\'31\');6(!4.5.1K||a==F){4.t.y(4.E,p+\'T\');c()}10{8 o=!4.5.Z?{\'24\':p}:{\'23\':p};4.t.1i(o,4.5.1K,4.5.2c,c)}},2j:9(s){6(s!=J)4.5.1q=s;6(4.5.1q==0)z 4.1C();6(4.1d!=7)z;8 a=4;4.1d=30(9(){a.17()},4.5.1q*2Z)},1C:9(){6(4.1d==7)z;2Y(4.1d);4.1d=7},1f:9(n,p){6(n==J||n==7){8 n=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'A\')||4.5.u==7||4.G<4.5.u);6(!4.Q&&(!4.5.B||4.5.B==\'A\')&&4.5.u!=7&&4.G>=4.5.u)n=4.O!=7&&!4.W}6(p==J||p==7){8 p=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'G\')||4.A>1);6(!4.Q&&(!4.5.B||4.5.B==\'G\')&&4.5.u!=7&&4.A==1)p=4.O!=7&&4.W}8 a=4;4.U[n?\'1u\':\'22\'](4.5.2m,4.2G)[n?\'1E\':\'V\'](4.K(\'C-17-1w\')).1J(\'1w\',n?F:1h);4.R[p?\'1u\':\'22\'](4.5.2k,4.2b)[p?\'1E\':\'V\'](4.K(\'C-11-1w\')).1J(\'1w\',p?F:1h);6(4.U.I>0&&(4.U[0].1g==J||4.U[0].1g!=n)&&4.5.1O!=7){4.U.1b(9(){a.5.1O(a,4,n)});4.U[0].1g=n}6(4.R.I>0&&(4.R[0].1g==J||4.R[0].1g!=p)&&4.5.1L!=7){4.R.1b(9(){a.5.1L(a,4,p)});4.R[0].1g=p}},1M:9(a){8 b=4.X==7?\'2a\':(4.X<4.A?\'17\':\'11\');4.12(\'2F\',a,b);6(4.X!==4.A){4.12(\'2B\',a,b,4.A);4.12(\'2z\',a,b,4.X)}6(4.13!==4.G){4.12(\'2x\',a,b,4.G);4.12(\'2v\',a,b,4.13)}4.12(\'2s\',a,b,4.A,4.G,4.X,4.13);4.12(\'2p\',a,b,4.X,4.13,4.A,4.G)},12:9(a,b,c,d,e,f,g){6(4.5[a]==J||(1R 4.5[a]!=\'2h\'&&b!=\'2i\'))z;8 h=1R 4.5[a]==\'2h\'?4.5[a][b]:4.5[a];6(!$.2W(h))z;8 j=4;6(d===J)h(j,c,b);10 6(e===J)4.L(d).1b(9(){h(j,4,d,c,b)});10{1r(8 i=d;i<=e;i++)6(i!==7&&!(i>=f&&i<=g))4.L(i).1b(9(){h(j,4,i,c,b)})}},1B:9(i){z 4.1I(\'<1F></1F>\',i)},1I:9(e,i){8 a=$(e).V(4.K(\'C-1a\')).V(4.K(\'C-1a-\'+i));a.1J(\'2V\',i);z a},K:9(c){z c+\' \'+c+(!4.5.Z?\'-2U\':\'-Z\')},S:9(e,d){8 a=e.2g!=J?e[0]:e;8 b=!4.5.Z?a.1x+r.Y(a,\'2f\')+r.Y(a,\'1l\'):a.2e+r.Y(a,\'2d\')+r.Y(a,\'1N\');6(d==J||b==d)z b;8 w=!4.5.Z?d-r.Y(a,\'2f\')-r.Y(a,\'1l\'):d-r.Y(a,\'2d\')-r.Y(a,\'1N\');$(a).y(4.N,w+\'T\');z 4.S(a)},1m:9(){z!4.5.Z?4.H[0].1x-r.M(4.H.y(\'2T\'))-r.M(4.H.y(\'2S\')):4.H[0].2e-r.M(4.H.y(\'2R\'))-r.M(4.H.y(\'3i\'))},2P:9(i,s){6(s==J)s=4.5.u;z 1k.2O((((i-1)/s)-1k.2N((i-1)/s))*s)+1}});r.16({3m:9(d){z $.16(q,d||{})},Y:9(e,p){6(!e)z 0;8 a=e.2g!=J?e[0]:e;6(p==\'1l\'&&$.2A.28){8 b={\'1y\':\'1A\',\'2M\':\'2L\',\'1H\':\'1q\'},1Y,1W;$.29(a,b,9(){1Y=a.1x});b[\'1l\']=0;$.29(a,b,9(){1W=a.1x});z 1W-1Y}z r.M($.y(a,p))},M:9(v){v=2K(v);z 2J(v)?0:v}})})(3v);', 62, 218, '||||this|options|if|null|var|function||||||||||||||||||||list|size||||css|return|first|wrap|jcarousel|container|lt|false|last|clip|length|undefined|className|get|intval|wh|tail|div|locked|buttonPrev|dimension|px|buttonNext|addClass|inTail|prevFirst|margin|vertical|else|prev|callback|prevLast|animating|visible|extend|next|circular|parent|item|each|scroll|timer|split|buttons|jcarouselstate|true|animate|initCallback|Math|marginRight|clipping|while|hasClass|break|auto|for|pos|setup|bind|fn|disabled|offsetWidth|display|before|block|create|stopAuto|placeholder|removeClass|li|reloadCallback|width|format|attr|animation|buttonPrevCallback|notify|marginBottom|buttonNextCallback|ceil|buttonPrevHTML|typeof|buttonNextHTML|scrollTail|funcResize|remove|oWidth2|after|oWidth|both|old|offset|unbind|top|left|start|height|window|safari|swap|init|funcPrev|easing|marginTop|offsetHeight|marginLeft|jquery|object|onAfterAnimation|startAuto|buttonPrevEvent|click|buttonNextEvent|ol|ul|itemVisibleOutCallback|reload|prepend|itemVisibleInCallback|nodeName|add|itemLastOutCallback|skin|itemLastInCallback|indexOf|itemFirstOutCallback|browser|itemFirstInCallback|empty|reset|resize|itemLoadCallback|funcNext|prototype|load|isNaN|parseInt|none|float|floor|round|index|swing|borderTopWidth|borderRightWidth|borderLeftWidth|horizontal|jcarouselindex|isFunction|normal|clearTimeout|1000|setTimeout|onBeforeAnimation|children|push|Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|isNaN|class|find|borderBottomWidth|append|html|string|defaults|OL|UL|new|has|unlock|lock|10px|0px|jQuery'.split('|'), 0, {}))

/* Start Image loader for icondo*/
$.fn.loadImage = function (src, desc, image, option) {
    var obj = this;
    var img = new Image();
    img.width = option.width;
    img.height = option.height;
    img.alt = desc;
    $(img).load(function () {
        $(this).hide();
        $(obj).html(img);
        $(this).fadeIn();
    }).error(function () {
    }).attr('src', src + image.filename).attr('width', option.width).attr('height', option.height);
};
/* End Image loader for icondo*/

jQuery.cookie = function (name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

/* jCarouselList */
(function ($) { $.fn.jCarouselLite = function (o) { o = $.extend({ btnPrev: null, btnNext: null, btnGo: null, mouseWheel: false, auto: null, speed: 200, easing: null, vertical: false, circular: true, visible: 3, start: 0, scroll: 1, beforeStart: null, afterEnd: null }, o || {}); return this.each(function () { var aniT; var b = false, animCss = o.vertical ? "top" : "left", sizeCss = o.vertical ? "height" : "width"; var c = $(this), ul = $("ul", c), tLi = $("li", ul), tl = tLi.size(), v = o.visible; if (o.circular) { ul.prepend(tLi.slice(tl - v - 1 + 1).clone()).append(tLi.slice(0, v).clone()); o.start += v } var f = $("li", ul), itemLength = f.size(), curr = o.start; c.css("visibility", "visible"); f.css({ overflow: "hidden", float: o.vertical ? "none" : "left" }); ul.css({ margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1" }); c.css({ overflow: "hidden", position: "relative", "z-index": "2", left: "0px" }); var g = o.vertical ? height(f) : width(f); var h = g * itemLength; var j = g * v; f.css({ width: f.width(), height: f.height() }); ul.css(sizeCss, h + "px").css(animCss, -(curr * g)); c.css(sizeCss, j + "px"); if (o.btnPrev) $(o.btnPrev).click(function () { clearInterval(aniT); return go(curr - o.scroll) }); if (o.btnNext) $(o.btnNext).click(function () { clearInterval(aniT); return go(curr + o.scroll) }); if (o.btnGo) $.each(o.btnGo, function (i, a) { $(a).click(function () { return go(o.circular ? o.visible + i : i) }) }); if (o.mouseWheel && c.mousewheel) c.mousewheel(function (e, d) { return d > 0 ? go(curr - o.scroll) : go(curr + o.scroll) }); if (o.auto) aniT = setInterval(function () { go(curr + o.scroll) }, o.auto + o.speed); function vis() { return f.slice(curr).slice(0, v) }; function go(a) { if (!b) { if (o.beforeStart) o.beforeStart.call(this, vis()); if (o.circular) { if (a <= o.start - v - 1) { ul.css(animCss, -((itemLength - (v * 2)) * g) + "px"); curr = a == o.start - v - 1 ? itemLength - (v * 2) - 1 : itemLength - (v * 2) - o.scroll } else if (a >= itemLength - v + 1) { ul.css(animCss, -((v) * g) + "px"); curr = a == itemLength - v + 1 ? v + 1 : v + o.scroll } else curr = a } else { if (a < 0 || a > itemLength - v) return; else curr = a } b = true; ul.animate(animCss == "left" ? { left: -(curr * g)} : { top: -(curr * g) }, o.speed, o.easing, function () { if (o.afterEnd) o.afterEnd.call(this, vis()); b = false }); if (!o.circular) { $(o.btnPrev + "," + o.btnNext).removeClass("disabled"); $((curr - o.scroll < 0 && o.btnPrev) || (curr + o.scroll > itemLength - v && o.btnNext) || []).addClass("disabled") } } return false } }) }; function css(a, b) { return parseInt($.css(a[0], b)) || 0 }; function width(a) { return a[0].offsetWidth + css(a, 'marginLeft') + css(a, 'marginRight') }; function height(a) { return a[0].offsetHeight + css(a, 'marginTop') + css(a, 'marginBottom') } })(jQuery);
