(function ($) { var $scrollTo = $.scrollTo = function (target, duration, settings) { $(window).scrollTo(target, duration, settings) }; $scrollTo.defaults = { axis: "xy", duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1 }; $scrollTo.window = function (scope) { return $(window)._scrollable() }; $.fn._scrollable = function () { return this.map(function () { var elem = this, isWin = !elem.nodeName || $.inArray(elem.nodeName.toLowerCase(), ["iframe", "#document", "html", "body"]) != -1; if (!isWin) return elem; var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem; return $.browser.safari || doc.compatMode == "BackCompat" ? doc.body : doc.documentElement }) }; $.fn.scrollTo = function (target, duration, settings) { if (typeof duration == "object") { settings = duration; duration = 0 } if (typeof settings == "function") settings = { onAfter: settings }; if (target == "max") target = 9E9; settings = $.extend({}, $scrollTo.defaults, settings); duration = duration || settings.speed || settings.duration; settings.queue = settings.queue && settings.axis.length > 1; if (settings.queue) duration /= 2; settings.offset = both(settings.offset); settings.over = both(settings.over); return this._scrollable().each(function () { var elem = this, $elem = $(elem), targ = target, toff, attr = {}, win = $elem.is("html,body"); switch (typeof targ) { case "number": case "string": if (/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)) { targ = both(targ); break } targ = $(targ, this); case "object": if (targ.is || targ.style) toff = (targ = $(targ)).offset() } $.each(settings.axis.split(""), function (i, axis) { var Pos = axis == "x" ? "Left" : "Top", pos = Pos.toLowerCase(), key = "scroll" + Pos, old = elem[key], max = $scrollTo.max(elem, axis); if (toff) { attr[key] = toff[pos] + (win ? 0 : old - $elem.offset()[pos]); if (settings.margin) { attr[key] -= parseInt(targ.css("margin" + Pos)) || 0; attr[key] -= parseInt(targ.css("border" + Pos + "Width")) || 0 } attr[key] += settings.offset[pos] || 0; if (settings.over[pos]) attr[key] += targ[axis == "x" ? "width" : "height"]() * settings.over[pos] } else { var val = targ[pos]; if (val) attr[key] = val.slice && val.slice(-1) == "%" ? parseFloat(val) / 100 * max : val } if (/^\d+$/.test(attr[key])) attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max); if (!i && settings.queue) { if (old != attr[key]) animate(settings.onAfterFirst); delete attr[key] } }); animate(settings.onAfter); function animate(callback) { $elem.animate(attr, duration, settings.easing, callback && function () { callback.call(this, target, settings) }) } }).end() }; $scrollTo.max = function (elem, axis) { var Dim = axis == "x" ? "Width" : "Height", scroll = "scroll" + Dim; if (!$(elem).is("html,body")) return elem[scroll] - $(elem)[Dim.toLowerCase()](); var size = "client" + Dim, html = elem.ownerDocument.documentElement, body = elem.ownerDocument.body; return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]) }; function both(val) { return typeof val == "object" ? val : { top: val, left: val } } })(jQuery); /* * SimpleModal 1.4.5 - jQuery Plugin * http://simplemodal.com/ * Copyright (c) 2014 Eric Martin * Licensed under MIT and GPL * Date: Tue, Mar 10 2015 09:04:31 +1300 */ (function (b) { "function" === typeof define && define.amd ? define(["jquery"], b) : b(jQuery) })(function (b) { var g = [], m = b(document), j = navigator.userAgent.toLowerCase(), k = b(window), d = [], n = null, o = /msie/.test(j) && !/opera/.test(j), p = /opera/.test(j), l, q, r; l = o && /msie 6./.test(j) && "object" !== typeof window.XMLHttpRequest; q = o && /msie 7.0/.test(j); r = "CSS1Compat" === document.compatMode; b.smodal = function (a, h) { return b.smodal.impl.init(a, h) }; b.smodal.close = function () { b.smodal.impl.close() }; b.smodal.focus = function (a) { b.smodal.impl.focus(a) }; b.smodal.setContainerDimensions = function () { b.smodal.impl.setContainerDimensions() }; b.smodal.setPosition = function () { b.smodal.impl.setPosition() }; b.smodal.update = function (a, h) { b.smodal.impl.update(a, h) }; b.fn.smodal = function (a) { return b.smodal.impl.init(this, a) }; b.smodal.defaults = { appendTo: "body", focus: !0, opacity: 50, overlayId: "simplemodal-overlay", overlayCss: {}, containerId: "simplemodal-container", containerCss: {}, dataId: "simplemodal-data", dataCss: {}, minHeight: null, minWidth: null, maxHeight: null, maxWidth: null, autoResize: !1, autoPosition: !0, zIndex: 1E3, close: !0, closeHTML: '', closeClass: "simplemodal-close", escClose: !0, overlayClose: !1, fixed: !0, position: null, persist: !1, modal: !0, onOpen: null, onShow: null, onClose: null }; b.smodal.impl = { d: {}, init: function (a, h) { if (this.d.data) return !1; n = o && !r; this.o = b.extend({}, b.smodal.defaults, h); this.zIndex = this.o.zIndex; this.occb = !1; if ("object" === typeof a) { if (a = a instanceof b ? a : b(a), this.d.placeholder = !1, 0 < a.parent().parent().size() && (a.before(b("").attr("id", "simplemodal-placeholder").css({ display: "none" })), this.d.placeholder = !0, this.display = a.css("display"), !this.o.persist)) this.d.orig = a.clone(!0) } else if ("string" === typeof a || "number" === typeof a) a = b("
").html(a); else return alert("SimpleModal Error: Unsupported data type: " + typeof a), this; this.create(a); this.open(); b.isFunction(this.o.onShow) && this.o.onShow.apply(this, [this.d]); return this }, create: function (a) { this.getDimensions(); if (this.o.modal && l) this.d.iframe = b('').css(b.extend(this.o.iframeCss, { display: "none", opacity: 0, position: "fixed", height: d[0], width: d[1], zIndex: this.o.zIndex, top: 0, left: 0 })).appendTo(this.o.appendTo); this.d.overlay = b("
").attr("id", this.o.overlayId).addClass("simplemodal-overlay").css(b.extend(this.o.overlayCss, { display: "none", opacity: this.o.opacity / 100, height: this.o.modal ? g[0] : 0, width: this.o.modal ? g[1] : 0, position: "fixed", left: 0, top: 0, zIndex: this.o.zIndex + 1 })).appendTo(this.o.appendTo); this.d.container = b("
").attr("id", this.o.containerId).addClass("simplemodal-container").css(b.extend({ position: this.o.fixed ? "fixed" : "absolute" }, this.o.containerCss, { display: "none", zIndex: this.o.zIndex + 2 })).append(this.o.close && this.o.closeHTML ? b(this.o.closeHTML).addClass(this.o.closeClass) : "").appendTo(this.o.appendTo); this.d.wrap = b("
").attr("tabIndex", -1).addClass("simplemodal-wrap").css({ height: "100%", outline: 0, width: "100%" }).appendTo(this.d.container); this.d.data = a.attr("id", a.attr("id") || this.o.dataId).addClass("simplemodal-data").css(b.extend(this.o.dataCss, { display: "none" })).appendTo("body"); this.setContainerDimensions(); this.d.data.appendTo(this.d.wrap); (l || n) && this.fixIE() }, bindEvents: function () { var a = this; b("." + a.o.closeClass).bind("click.simplemodal", function (b) { b.preventDefault(); a.close() }); a.o.modal && a.o.close && a.o.overlayClose && a.d.overlay.bind("click.simplemodal", function (b) { b.preventDefault(); a.close() }); m.bind("keydown.simplemodal", function (b) { a.o.modal && 9 === b.keyCode ? a.watchTab(b) : a.o.close && a.o.escClose && 27 === b.keyCode && (b.preventDefault(), a.close()) }); k.bind("resize.simplemodal orientationchange.simplemodal", function () { a.getDimensions(); a.o.autoResize ? a.setContainerDimensions() : a.o.autoPosition && a.setPosition(); l || n ? a.fixIE() : a.o.modal && (a.d.iframe && a.d.iframe.css({ height: d[0], width: d[1] }), a.d.overlay.css({ height: g[0], width: g[1] })) }) }, unbindEvents: function () { b("." + this.o.closeClass).unbind("click.simplemodal"); m.unbind("keydown.simplemodal"); k.unbind(".simplemodal"); this.d.overlay.unbind("click.simplemodal") }, fixIE: function () { var a = this.o.position; b.each([this.d.iframe || null, !this.o.modal ? null : this.d.overlay, "fixed" === this.d.container.css("position") ? this.d.container : null], function (h, f) { if (f) { var d = f[0].style; d.position = "absolute"; if (2 > h) { var c = eval("document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight") + "px", e = eval("document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth") + "px"; b(d).height(c); b(d).width(e) } else a && a.constructor === Array ? (c = a[0] ? "number" === typeof a[0] ? a[0].toString() : a[0].replace(/px/, "") : f.css("top").replace(/px/, ""), c = -1 === c.indexOf("%") ? c + ' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"' : parseInt(c.replace(/%/, "")) + ' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"', a[1] && (e = "number" === typeof a[1] ? a[1].toString() : a[1].replace(/px/, ""), e = -1 === e.indexOf("%") ? e + ' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"' : parseInt(e.replace(/%/, "")) + ' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')) : (c = '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"', e = '(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'), b(d).css("top", eval(c)), b(d).css("left", eval(e)) } }) }, focus: function (a) { var h = this, a = a && -1 !== b.inArray(a, ["first", "last"]) ? a : "first", d = b(":input:enabled:visible:" + a, h.d.wrap); setTimeout(function () { 0 < d.length ? d.focus() : h.d.wrap.focus() }, 10) }, getDimensions: function () { var a = "undefined" === typeof window.innerHeight ? k.height() : window.innerHeight; g = [m.height(), m.width()]; d = [a, k.width()] }, getVal: function (a, b) { return a ? "number" === typeof a ? a : "auto" === a ? 0 : 0 < a.indexOf("%") ? parseInt(a.replace(/%/, "")) / 100 * ("h" === b ? d[0] : d[1]) : parseInt(a.replace(/px/, "")) : null }, update: function (a, b) { if (!this.d.data) return !1; this.d.origHeight = this.getVal(a, "h"); this.d.origWidth = this.getVal(b, "w"); this.d.data.hide(); a && this.d.container.css("height", a); b && this.d.container.css("width", b); this.setContainerDimensions(); this.d.data.show(); this.o.focus && this.focus(); this.unbindEvents(); this.bindEvents() }, setContainerDimensions: function () { var a = l || q, b = this.d.origHeight ? this.d.origHeight : p ? this.d.container.height() : this.getVal(a ? this.d.container[0].currentStyle.height : this.d.container.css("height"), "h"), a = this.d.origWidth ? this.d.origWidth : p ? this.d.container.width() : this.getVal(a ? this.d.container[0].currentStyle.width : this.d.container.css("width"), "w"), f = this.d.data.outerHeight(!0), g = this.d.data.outerWidth(!0); this.d.origHeight = this.d.origHeight || b; this.d.origWidth = this.d.origWidth || a; var c = this.o.maxHeight ? this.getVal(this.o.maxHeight, "h") : null, e = this.o.maxWidth ? this.getVal(this.o.maxWidth, "w") : null, c = c && c < d[0] ? c : d[0], e = e && e < d[1] ? e : d[1], i = this.o.minHeight ? this.getVal(this.o.minHeight, "h") : "auto", b = b ? this.o.autoResize && b > c ? c : b < i ? i : b : f ? f > c ? c : this.o.minHeight && "auto" !== i && f < i ? i : f : i, c = this.o.minWidth ? this.getVal(this.o.minWidth, "w") : "auto", a = a ? this.o.autoResize && a > e ? e : a < c ? c : a : g ? g > e ? e : this.o.minWidth && "auto" !== c && g < c ? c : g : c; this.d.container.css({ height: b, width: a }); this.d.wrap.css({ overflow: f > b || g > a ? "auto" : "visible" }); this.o.autoPosition && this.setPosition() }, setPosition: function () { var a, b; a = d[0] / 2 - this.d.container.outerHeight(!0) / 2; b = d[1] / 2 - this.d.container.outerWidth(!0) / 2; var f = "fixed" !== this.d.container.css("position") ? k.scrollTop() : 0; this.o.position && "[object Array]" === Object.prototype.toString.call(this.o.position) ? (a = parseFloat(f) + parseFloat(this.o.position[0] || a), b = this.o.position[1] || b) : a = f + a; this.d.container.css({ left: b, top: a }) }, watchTab: function (a) { if (0 < b(a.target).parents(".simplemodal-container").length) { if (this.inputs = b(":input:enabled:visible:first, :input:enabled:visible:last", this.d.data[0]), !a.shiftKey && a.target === this.inputs[this.inputs.length - 1] || a.shiftKey && a.target === this.inputs[0] || 0 === this.inputs.length) a.preventDefault(), this.focus(a.shiftKey ? "last" : "first") } else a.preventDefault(), this.focus() }, open: function () { this.d.iframe && this.d.iframe.show(); b.isFunction(this.o.onOpen) ? this.o.onOpen.apply(this, [this.d]) : (this.d.overlay.show(), this.d.container.show(), this.d.data.show()); this.o.focus && this.focus(); this.bindEvents() }, close: function () { if (!this.d.data) return !1; this.unbindEvents(); if (b.isFunction(this.o.onClose) && !this.occb) this.occb = !0, this.o.onClose.apply(this, [this.d]); else { if (this.d.placeholder) { var a = b("#simplemodal-placeholder"); this.o.persist ? a.replaceWith(this.d.data.removeClass("simplemodal-data").css("display", this.display)) : (this.d.data.hide().remove(), a.replaceWith(this.d.orig)) } else this.d.data.hide().remove(); this.d.container.hide().remove(); this.d.overlay.hide(); this.d.iframe && this.d.iframe.hide().remove(); this.d.overlay.remove(); this.d = {} } } } }); /*! * jScrollPane - v2.0.0beta12 - 2012-09-27 * http://jscrollpane.kelvinluck.com/ * * Copyright (c) 2010 Kelvin Luck * Dual licensed under the MIT or GPL licenses. */ // Script: jScrollPane - cross browser customisable scrollbars // // *Version: 2.0.0beta12, Last updated: 2012-09-27* // // Project Home - http://jscrollpane.kelvinluck.com/ // GitHub - http://github.com/vitch/jScrollPane // Source - http://github.com/vitch/jScrollPane/raw/master/script/jquery.jscrollpane.js // (Minified) - http://github.com/vitch/jScrollPane/raw/master/script/jquery.jscrollpane.min.js // // About: License // // Copyright (c) 2012 Kelvin Luck // Dual licensed under the MIT or GPL Version 2 licenses. // http://jscrollpane.kelvinluck.com/MIT-LICENSE.txt // http://jscrollpane.kelvinluck.com/GPL-LICENSE.txt // // About: Examples // // All examples and demos are available through the jScrollPane example site at: // http://jscrollpane.kelvinluck.com/ // // About: Support and Testing // // This plugin is tested on the browsers below and has been found to work reliably on them. If you run // into a problem on one of the supported browsers then please visit the support section on the jScrollPane // website (http://jscrollpane.kelvinluck.com/) for more information on getting support. You are also // welcome to fork the project on GitHub if you can contribute a fix for a given issue. // // jQuery Versions - tested in 1.4.2+ - reported to work in 1.3.x // Browsers Tested - Firefox 3.6.8, Safari 5, Opera 10.6, Chrome 5.0, IE 6, 7, 8 // // About: Release History // // 2.0.0beta12 - (2012-09-27) fix for jQuery 1.8+ // 2.0.0beta11 - (2012-05-14) // 2.0.0beta10 - (2011-04-17) cleaner required size calculation, improved keyboard support, stickToBottom/Left, other small fixes // 2.0.0beta9 - (2011-01-31) new API methods, bug fixes and correct keyboard support for FF/OSX // 2.0.0beta8 - (2011-01-29) touchscreen support, improved keyboard support // 2.0.0beta7 - (2011-01-23) scroll speed consistent (thanks Aivo Paas) // 2.0.0beta6 - (2010-12-07) scrollToElement horizontal support // 2.0.0beta5 - (2010-10-18) jQuery 1.4.3 support, various bug fixes // 2.0.0beta4 - (2010-09-17) clickOnTrack support, bug fixes // 2.0.0beta3 - (2010-08-27) Horizontal mousewheel, mwheelIntent, keyboard support, bug fixes // 2.0.0beta2 - (2010-08-21) Bug fixes // 2.0.0beta1 - (2010-08-17) Rewrite to follow modern best practices and enable horizontal scrolling, initially hidden // elements and dynamically sized elements. // 1.x - (2006-12-31 - 2010-07-31) Initial version, hosted at googlecode, deprecated (function ($, window, undefined) { $.fn.jScrollPane = function (settings) { // JScrollPane "class" - public methods are available through $('selector').data('jsp') function JScrollPane(elem, s) { var settings, jsp = this, pane, paneWidth, paneHeight, container, contentWidth, contentHeight, percentInViewH, percentInViewV, isScrollableV, isScrollableH, verticalDrag, dragMaxY, verticalDragPosition, horizontalDrag, dragMaxX, horizontalDragPosition, verticalBar, verticalTrack, scrollbarWidth, verticalTrackHeight, verticalDragHeight, arrowUp, arrowDown, horizontalBar, horizontalTrack, horizontalTrackWidth, horizontalDragWidth, arrowLeft, arrowRight, reinitialiseInterval, originalPadding, originalPaddingTotalWidth, previousContentWidth, wasAtTop = true, wasAtLeft = true, wasAtBottom = false, wasAtRight = false, originalElement = elem.clone(false, false).empty(), mwEvent = $.fn.mwheelIntent ? 'mwheelIntent.jsp' : 'mousewheel.jsp'; originalPadding = elem.css('paddingTop') + ' ' + elem.css('paddingRight') + ' ' + elem.css('paddingBottom') + ' ' + elem.css('paddingLeft'); originalPaddingTotalWidth = (parseInt(elem.css('paddingLeft'), 10) || 0) + (parseInt(elem.css('paddingRight'), 10) || 0); function initialise(s) { var /*firstChild, lastChild, */isMaintainingPositon, lastContentX, lastContentY, hasContainingSpaceChanged, originalScrollTop, originalScrollLeft, maintainAtBottom = false, maintainAtRight = false; settings = s; if (pane === undefined) { originalScrollTop = elem.scrollTop(); originalScrollLeft = elem.scrollLeft(); elem.css( { overflow: 'hidden', padding: 0 } ); // TODO: Deal with where width/ height is 0 as it probably means the element is hidden and we should // come back to it later and check once it is unhidden... paneWidth = elem.innerWidth() + originalPaddingTotalWidth; paneHeight = elem.innerHeight(); elem.width(paneWidth); pane = $('
').css('padding', originalPadding).append(elem.children()); container = $('
') .css({ 'width': paneWidth + 'px', 'height': paneHeight + 'px' } ).append(pane).appendTo(elem); /* // Move any margins from the first and last children up to the container so they can still // collapse with neighbouring elements as they would before jScrollPane firstChild = pane.find(':first-child'); lastChild = pane.find(':last-child'); elem.css( { 'margin-top': firstChild.css('margin-top'), 'margin-bottom': lastChild.css('margin-bottom') } ); firstChild.css('margin-top', 0); lastChild.css('margin-bottom', 0); */ } else { elem.css('width', ''); maintainAtBottom = settings.stickToBottom && isCloseToBottom(); maintainAtRight = settings.stickToRight && isCloseToRight(); hasContainingSpaceChanged = elem.innerWidth() + originalPaddingTotalWidth != paneWidth || elem.outerHeight() != paneHeight; if (hasContainingSpaceChanged) { paneWidth = elem.innerWidth() + originalPaddingTotalWidth; paneHeight = elem.innerHeight(); container.css({ width: paneWidth + 'px', height: paneHeight + 'px' }); } // If nothing changed since last check... if (!hasContainingSpaceChanged && previousContentWidth == contentWidth && pane.outerHeight() == contentHeight) { elem.width(paneWidth); return; } previousContentWidth = contentWidth; pane.css('width', ''); elem.width(paneWidth); container.find('>.jspVerticalBar,>.jspHorizontalBar').remove().end(); } pane.css('overflow', 'auto'); if (s.contentWidth) { contentWidth = s.contentWidth; } else { contentWidth = pane[0].scrollWidth; } contentHeight = pane[0].scrollHeight; pane.css('overflow', ''); percentInViewH = contentWidth / paneWidth; percentInViewV = contentHeight / paneHeight; isScrollableV = percentInViewV > 1; isScrollableH = percentInViewH > 1; //console.log(paneWidth, paneHeight, contentWidth, contentHeight, percentInViewH, percentInViewV, isScrollableH, isScrollableV); if (!(isScrollableH || isScrollableV)) { elem.removeClass('jspScrollable'); pane.css({ top: 0, width: container.width() - originalPaddingTotalWidth }); removeMousewheel(); removeFocusHandler(); removeKeyboardNav(); removeClickOnTrack(); } else { elem.addClass('jspScrollable'); isMaintainingPositon = settings.maintainPosition && (verticalDragPosition || horizontalDragPosition); if (isMaintainingPositon) { lastContentX = contentPositionX(); lastContentY = contentPositionY(); } initialiseVerticalScroll(); initialiseHorizontalScroll(); resizeScrollbars(); if (isMaintainingPositon) { scrollToX(maintainAtRight ? (contentWidth - paneWidth) : lastContentX, false); scrollToY(maintainAtBottom ? (contentHeight - paneHeight) : lastContentY, false); } initFocusHandler(); initMousewheel(); initTouch(); if (settings.enableKeyboardNavigation) { initKeyboardNav(); } if (settings.clickOnTrack) { initClickOnTrack(); } observeHash(); if (settings.hijackInternalLinks) { hijackInternalLinks(); } } if (settings.autoReinitialise && !reinitialiseInterval) { reinitialiseInterval = setInterval( function () { initialise(settings); }, settings.autoReinitialiseDelay ); } else if (!settings.autoReinitialise && reinitialiseInterval) { clearInterval(reinitialiseInterval); } originalScrollTop && elem.scrollTop(0) && scrollToY(originalScrollTop, false); originalScrollLeft && elem.scrollLeft(0) && scrollToX(originalScrollLeft, false); elem.trigger('jsp-initialised', [isScrollableH || isScrollableV]); } function initialiseVerticalScroll() { if (isScrollableV) { container.append( $('
').append( $('
'), $('
').append( $('
').append( $('
'), $('
') ) ), $('
') ) ); verticalBar = container.find('>.jspVerticalBar'); verticalTrack = verticalBar.find('>.jspTrack'); verticalDrag = verticalTrack.find('>.jspDrag'); if (settings.showArrows) { arrowUp = $('').bind( 'mousedown.jsp', getArrowScroll(0, -1) ).bind('click.jsp', nil); arrowDown = $('').bind( 'mousedown.jsp', getArrowScroll(0, 1) ).bind('click.jsp', nil); if (settings.arrowScrollOnHover) { arrowUp.bind('mouseover.jsp', getArrowScroll(0, -1, arrowUp)); arrowDown.bind('mouseover.jsp', getArrowScroll(0, 1, arrowDown)); } appendArrows(verticalTrack, settings.verticalArrowPositions, arrowUp, arrowDown); } verticalTrackHeight = paneHeight; container.find('>.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow').each( function () { verticalTrackHeight -= $(this).outerHeight(); } ); verticalDrag.hover( function () { verticalDrag.addClass('jspHover'); }, function () { verticalDrag.removeClass('jspHover'); } ).bind( 'mousedown.jsp', function (e) { // Stop IE from allowing text selection $('html').bind('dragstart.jsp selectstart.jsp', nil); verticalDrag.addClass('jspActive'); var startY = e.pageY - verticalDrag.position().top; $('html').bind( 'mousemove.jsp', function (e) { positionDragY(e.pageY - startY, false); } ).bind('mouseup.jsp mouseleave.jsp', cancelDrag); return false; } ); sizeVerticalScrollbar(); } } function sizeVerticalScrollbar() { verticalTrack.height(verticalTrackHeight + 'px'); verticalDragPosition = 0; scrollbarWidth = settings.verticalGutter + verticalTrack.outerWidth(); // Make the pane thinner to allow for the vertical scrollbar pane.width(paneWidth - scrollbarWidth - originalPaddingTotalWidth); // Add margin to the left of the pane if scrollbars are on that side (to position // the scrollbar on the left or right set it's left or right property in CSS) try { if (verticalBar.position().left === 0) { pane.css('margin-left', scrollbarWidth + 'px'); } } catch (err) { } } function initialiseHorizontalScroll() { if (isScrollableH) { container.append( $('
').append( $('
'), $('
').append( $('
').append( $('
'), $('
') ) ), $('
') ) ); horizontalBar = container.find('>.jspHorizontalBar'); horizontalTrack = horizontalBar.find('>.jspTrack'); horizontalDrag = horizontalTrack.find('>.jspDrag'); if (settings.showArrows) { arrowLeft = $('').bind( 'mousedown.jsp', getArrowScroll(-1, 0) ).bind('click.jsp', nil); arrowRight = $('').bind( 'mousedown.jsp', getArrowScroll(1, 0) ).bind('click.jsp', nil); if (settings.arrowScrollOnHover) { arrowLeft.bind('mouseover.jsp', getArrowScroll(-1, 0, arrowLeft)); arrowRight.bind('mouseover.jsp', getArrowScroll(1, 0, arrowRight)); } appendArrows(horizontalTrack, settings.horizontalArrowPositions, arrowLeft, arrowRight); } horizontalDrag.hover( function () { horizontalDrag.addClass('jspHover'); }, function () { horizontalDrag.removeClass('jspHover'); } ).bind( 'mousedown.jsp', function (e) { // Stop IE from allowing text selection $('html').bind('dragstart.jsp selectstart.jsp', nil); horizontalDrag.addClass('jspActive'); var startX = e.pageX - horizontalDrag.position().left; $('html').bind( 'mousemove.jsp', function (e) { positionDragX(e.pageX - startX, false); } ).bind('mouseup.jsp mouseleave.jsp', cancelDrag); return false; } ); horizontalTrackWidth = container.innerWidth(); sizeHorizontalScrollbar(); } } function sizeHorizontalScrollbar() { container.find('>.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow').each( function () { horizontalTrackWidth -= $(this).outerWidth(); } ); horizontalTrack.width(horizontalTrackWidth + 'px'); horizontalDragPosition = 0; } function resizeScrollbars() { if (isScrollableH && isScrollableV) { var horizontalTrackHeight = horizontalTrack.outerHeight(), verticalTrackWidth = verticalTrack.outerWidth(); verticalTrackHeight -= horizontalTrackHeight; $(horizontalBar).find('>.jspCap:visible,>.jspArrow').each( function () { horizontalTrackWidth += $(this).outerWidth(); } ); horizontalTrackWidth -= verticalTrackWidth; paneHeight -= verticalTrackWidth; paneWidth -= horizontalTrackHeight; horizontalTrack.parent().append( $('
').css('width', horizontalTrackHeight + 'px') ); sizeVerticalScrollbar(); sizeHorizontalScrollbar(); } // reflow content if (isScrollableH) { pane.width((container.outerWidth() - originalPaddingTotalWidth) + 'px'); } contentHeight = pane.outerHeight(); percentInViewV = contentHeight / paneHeight; if (isScrollableH) { horizontalDragWidth = Math.ceil(1 / percentInViewH * horizontalTrackWidth); if (horizontalDragWidth > settings.horizontalDragMaxWidth) { horizontalDragWidth = settings.horizontalDragMaxWidth; } else if (horizontalDragWidth < settings.horizontalDragMinWidth) { horizontalDragWidth = settings.horizontalDragMinWidth; } horizontalDrag.width(horizontalDragWidth + 'px'); dragMaxX = horizontalTrackWidth - horizontalDragWidth; _positionDragX(horizontalDragPosition); // To update the state for the arrow buttons } if (isScrollableV) { verticalDragHeight = Math.ceil(1 / percentInViewV * verticalTrackHeight); if (verticalDragHeight > settings.verticalDragMaxHeight) { verticalDragHeight = settings.verticalDragMaxHeight; } else if (verticalDragHeight < settings.verticalDragMinHeight) { verticalDragHeight = settings.verticalDragMinHeight; } verticalDrag.height(verticalDragHeight + 'px'); dragMaxY = verticalTrackHeight - verticalDragHeight; _positionDragY(verticalDragPosition); // To update the state for the arrow buttons } } function appendArrows(ele, p, a1, a2) { var p1 = "before", p2 = "after", aTemp; // Sniff for mac... Is there a better way to determine whether the arrows would naturally appear // at the top or the bottom of the bar? if (p == "os") { p = /Mac/.test(navigator.platform) ? "after" : "split"; } if (p == p1) { p2 = p; } else if (p == p2) { p1 = p; aTemp = a1; a1 = a2; a2 = aTemp; } ele[p1](a1)[p2](a2); } function getArrowScroll(dirX, dirY, ele) { return function () { arrowScroll(dirX, dirY, this, ele); this.blur(); return false; }; } function arrowScroll(dirX, dirY, arrow, ele) { arrow = $(arrow).addClass('jspActive'); var eve, scrollTimeout, isFirst = true, doScroll = function () { if (dirX !== 0) { jsp.scrollByX(dirX * settings.arrowButtonSpeed); } if (dirY !== 0) { jsp.scrollByY(dirY * settings.arrowButtonSpeed); } scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.arrowRepeatFreq); isFirst = false; }; doScroll(); eve = ele ? 'mouseout.jsp' : 'mouseup.jsp'; ele = ele || $('html'); ele.bind( eve, function () { arrow.removeClass('jspActive'); scrollTimeout && clearTimeout(scrollTimeout); scrollTimeout = null; ele.unbind(eve); } ); } function initClickOnTrack() { removeClickOnTrack(); if (isScrollableV) { verticalTrack.bind( 'mousedown.jsp', function (e) { if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) { var clickedTrack = $(this), offset = clickedTrack.offset(), direction = e.pageY - offset.top - verticalDragPosition, scrollTimeout, isFirst = true, doScroll = function () { var offset = clickedTrack.offset(), pos = e.pageY - offset.top - verticalDragHeight / 2, contentDragY = paneHeight * settings.scrollPagePercent, dragY = dragMaxY * contentDragY / (contentHeight - paneHeight); if (direction < 0) { if (verticalDragPosition - dragY > pos) { jsp.scrollByY(-contentDragY); } else { positionDragY(pos); } } else if (direction > 0) { if (verticalDragPosition + dragY < pos) { jsp.scrollByY(contentDragY); } else { positionDragY(pos); } } else { cancelClick(); return; } scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq); isFirst = false; }, cancelClick = function () { scrollTimeout && clearTimeout(scrollTimeout); scrollTimeout = null; $(document).unbind('mouseup.jsp', cancelClick); }; doScroll(); $(document).bind('mouseup.jsp', cancelClick); return false; } } ); } if (isScrollableH) { horizontalTrack.bind( 'mousedown.jsp', function (e) { if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) { var clickedTrack = $(this), offset = clickedTrack.offset(), direction = e.pageX - offset.left - horizontalDragPosition, scrollTimeout, isFirst = true, doScroll = function () { var offset = clickedTrack.offset(), pos = e.pageX - offset.left - horizontalDragWidth / 2, contentDragX = paneWidth * settings.scrollPagePercent, dragX = dragMaxX * contentDragX / (contentWidth - paneWidth); if (direction < 0) { if (horizontalDragPosition - dragX > pos) { jsp.scrollByX(-contentDragX); } else { positionDragX(pos); } } else if (direction > 0) { if (horizontalDragPosition + dragX < pos) { jsp.scrollByX(contentDragX); } else { positionDragX(pos); } } else { cancelClick(); return; } scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq); isFirst = false; }, cancelClick = function () { scrollTimeout && clearTimeout(scrollTimeout); scrollTimeout = null; $(document).unbind('mouseup.jsp', cancelClick); }; doScroll(); $(document).bind('mouseup.jsp', cancelClick); return false; } } ); } } function removeClickOnTrack() { if (horizontalTrack) { horizontalTrack.unbind('mousedown.jsp'); } if (verticalTrack) { verticalTrack.unbind('mousedown.jsp'); } } function cancelDrag() { $('html').unbind('dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp'); if (verticalDrag) { verticalDrag.removeClass('jspActive'); } if (horizontalDrag) { horizontalDrag.removeClass('jspActive'); } } function positionDragY(destY, animate) { if (!isScrollableV) { return; } if (destY < 0) { destY = 0; } else if (destY > dragMaxY) { destY = dragMaxY; } // can't just check if(animate) because false is a valid value that could be passed in... if (animate === undefined) { animate = settings.animateScroll; } if (animate) { jsp.animate(verticalDrag, 'top', destY, _positionDragY); } else { verticalDrag.css('top', destY); _positionDragY(destY); } } function _positionDragY(destY) { if (destY === undefined) { destY = verticalDrag.position().top; } container.scrollTop(0); verticalDragPosition = destY; var isAtTop = verticalDragPosition === 0, isAtBottom = verticalDragPosition == dragMaxY, percentScrolled = destY / dragMaxY, destTop = -percentScrolled * (contentHeight - paneHeight); if (wasAtTop != isAtTop || wasAtBottom != isAtBottom) { wasAtTop = isAtTop; wasAtBottom = isAtBottom; elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]); } updateVerticalArrows(isAtTop, isAtBottom); pane.css('top', destTop); elem.trigger('jsp-scroll-y', [-destTop, isAtTop, isAtBottom]).trigger('scroll'); } function positionDragX(destX, animate) { if (!isScrollableH) { return; } if (destX < 0) { destX = 0; } else if (destX > dragMaxX) { destX = dragMaxX; } if (animate === undefined) { animate = settings.animateScroll; } if (animate) { jsp.animate(horizontalDrag, 'left', destX, _positionDragX); } else { horizontalDrag.css('left', destX); _positionDragX(destX); } } function _positionDragX(destX) { if (destX === undefined) { destX = horizontalDrag.position().left; } container.scrollTop(0); horizontalDragPosition = destX; var isAtLeft = horizontalDragPosition === 0, isAtRight = horizontalDragPosition == dragMaxX, percentScrolled = destX / dragMaxX, destLeft = -percentScrolled * (contentWidth - paneWidth); if (wasAtLeft != isAtLeft || wasAtRight != isAtRight) { wasAtLeft = isAtLeft; wasAtRight = isAtRight; elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]); } updateHorizontalArrows(isAtLeft, isAtRight); pane.css('left', destLeft); elem.trigger('jsp-scroll-x', [-destLeft, isAtLeft, isAtRight]).trigger('scroll'); } function updateVerticalArrows(isAtTop, isAtBottom) { if (settings.showArrows) { arrowUp[isAtTop ? 'addClass' : 'removeClass']('jspDisabled'); arrowDown[isAtBottom ? 'addClass' : 'removeClass']('jspDisabled'); } } function updateHorizontalArrows(isAtLeft, isAtRight) { if (settings.showArrows) { arrowLeft[isAtLeft ? 'addClass' : 'removeClass']('jspDisabled'); arrowRight[isAtRight ? 'addClass' : 'removeClass']('jspDisabled'); } } function scrollToY(destY, animate) { var percentScrolled = destY / (contentHeight - paneHeight); positionDragY(percentScrolled * dragMaxY, animate); } function scrollToX(destX, animate) { var percentScrolled = destX / (contentWidth - paneWidth); positionDragX(percentScrolled * dragMaxX, animate); } function enable() { settings.enabled = true; } function disable() { settings.enabled = false; } function scrollToElement(ele, stickToTop, animate) { var e, eleHeight, eleWidth, eleTop = 0, eleLeft = 0, viewportTop, viewportLeft, maxVisibleEleTop, maxVisibleEleLeft, destY, destX; // Legal hash values aren't necessarily legal jQuery selectors so we need to catch any // errors from the lookup... try { e = $(ele); } catch (err) { return; } eleHeight = e.outerHeight(); eleWidth = e.outerWidth(); container.scrollTop(0); container.scrollLeft(0); // loop through parents adding the offset top of any elements that are relatively positioned between // the focused element and the jspPane so we can get the true distance from the top // of the focused element to the top of the scrollpane... while (!e.is('.jspPane')) { eleTop += e.position().top; eleLeft += e.position().left; e = e.offsetParent(); if (/^body|html$/i.test(e[0].nodeName)) { // we ended up too high in the document structure. Quit! return; } } viewportTop = contentPositionY(); maxVisibleEleTop = viewportTop + paneHeight; if (eleTop < viewportTop || stickToTop) { // element is above viewport destY = eleTop - settings.verticalGutter + 50; } else if (eleTop + eleHeight > maxVisibleEleTop) { // element is below viewport destY = eleTop - paneHeight + eleHeight + settings.verticalGutter; } if (destY) { scrollToY(destY, animate); } viewportLeft = contentPositionX(); maxVisibleEleLeft = viewportLeft + paneWidth; if (eleLeft < viewportLeft || stickToTop) { // element is to the left of viewport destX = eleLeft - settings.horizontalGutter; } else if (eleLeft + eleWidth > maxVisibleEleLeft) { // element is to the right viewport destX = eleLeft - paneWidth + eleWidth + settings.horizontalGutter; } if (destX) { scrollToX(destX, animate); } } function contentPositionX() { return -pane.position().left; } function contentPositionY() { return -pane.position().top; } function isCloseToBottom() { var scrollableHeight = contentHeight - paneHeight; return (scrollableHeight > 20) && (scrollableHeight - contentPositionY() < 10); } function isCloseToRight() { var scrollableWidth = contentWidth - paneWidth; return (scrollableWidth > 20) && (scrollableWidth - contentPositionX() < 10); } function initMousewheel() { container.unbind(mwEvent).bind( mwEvent, function (event, delta, deltaX, deltaY) { var dX = horizontalDragPosition, dY = verticalDragPosition; jsp.scrollBy(deltaX * settings.mouseWheelSpeed, -deltaY * settings.mouseWheelSpeed, false); // return true if there was no movement so rest of screen can scroll return dX == horizontalDragPosition && dY == verticalDragPosition; } ); } function removeMousewheel() { container.unbind(mwEvent); } function nil() { return false; } function initFocusHandler() { pane.find(':input,a').unbind('focus.jsp').bind( 'focus.jsp', function (e) { scrollToElement(e.target, false); } ); } function removeFocusHandler() { pane.find(':input,a').unbind('focus.jsp'); } function initKeyboardNav() { var keyDown, elementHasScrolled, validParents = []; isScrollableH && validParents.push(horizontalBar[0]); isScrollableV && validParents.push(verticalBar[0]); // IE also focuses elements that don't have tabindex set. pane.focus( function () { elem.focus(); } ); elem.attr('tabindex', 0) .unbind('keydown.jsp keypress.jsp') .bind( 'keydown.jsp', function (e) { if (e.target !== this && !(validParents.length && $(e.target).closest(validParents).length)) { return; } var dX = horizontalDragPosition, dY = verticalDragPosition; switch (e.keyCode) { case 40: // down case 38: // up case 34: // page down case 32: // space case 33: // page up case 39: // right case 37: // left keyDown = e.keyCode; keyDownHandler(); break; case 35: // end scrollToY(contentHeight - paneHeight); keyDown = null; break; case 36: // home scrollToY(0); keyDown = null; break; } elementHasScrolled = e.keyCode == keyDown && dX != horizontalDragPosition || dY != verticalDragPosition; return !elementHasScrolled; } ).bind( 'keypress.jsp', // For FF/ OSX so that we can cancel the repeat key presses if the JSP scrolls... function (e) { if (e.keyCode == keyDown) { keyDownHandler(); } return !elementHasScrolled; } ); if (settings.hideFocus) { elem.css('outline', 'none'); if ('hideFocus' in container[0]) { elem.attr('hideFocus', true); } } else { elem.css('outline', ''); if ('hideFocus' in container[0]) { elem.attr('hideFocus', false); } } function keyDownHandler() { var dX = horizontalDragPosition, dY = verticalDragPosition; switch (keyDown) { case 40: // down jsp.scrollByY(settings.keyboardSpeed, false); break; case 38: // up jsp.scrollByY(-settings.keyboardSpeed, false); break; case 34: // page down case 32: // space jsp.scrollByY(paneHeight * settings.scrollPagePercent, false); break; case 33: // page up jsp.scrollByY(-paneHeight * settings.scrollPagePercent, false); break; case 39: // right jsp.scrollByX(settings.keyboardSpeed, false); break; case 37: // left jsp.scrollByX(-settings.keyboardSpeed, false); break; } elementHasScrolled = dX != horizontalDragPosition || dY != verticalDragPosition; return elementHasScrolled; } } function removeKeyboardNav() { elem.attr('tabindex', '-1') .removeAttr('tabindex') .unbind('keydown.jsp keypress.jsp'); } function observeHash() { if (location.hash && location.hash.length > 1) { var e, retryInt, hash = escape(location.hash.substr(1)) // hash must be escaped to prevent XSS ; try { e = $('#' + hash + ', a[name="' + hash + '"]'); } catch (err) { return; } if (e.length && pane.find(hash)) { // nasty workaround but it appears to take a little while before the hash has done its thing // to the rendered page so we just wait until the container's scrollTop has been messed up. if (container.scrollTop() === 0) { retryInt = setInterval( function () { if (container.scrollTop() > 0) { scrollToElement(e, true); $(document).scrollTop(container.position().top); clearInterval(retryInt); } }, 50 ); } else { scrollToElement(e, true); $(document).scrollTop(container.position().top); } } } } function hijackInternalLinks() { // only register the link handler once if ($(document.body).data('jspHijack')) { return; } // remember that the handler was bound $(document.body).data('jspHijack', true); // use live handler to also capture newly created links $(document.body).delegate('a[href*=#]', 'click', function (event) { // does the link point to the same page? // this also takes care of cases with a -Tag or Links not starting with the hash # // e.g. when the current url already is index.html var href = this.href.substr(0, this.href.indexOf('#')), locationHref = location.href, hash, element, container, jsp, scrollTop, elementTop; if (location.href.indexOf('#') !== -1) { locationHref = location.href.substr(0, location.href.indexOf('#')); } if (href !== locationHref) { // the link points to another page return; } // check if jScrollPane should handle this click event hash = escape(this.href.substr(this.href.indexOf('#') + 1)); // find the element on the page element; try { element = $('#' + hash + ', a[name="' + hash + '"]'); } catch (e) { // hash is not a valid jQuery identifier return; } if (!element.length) { // this link does not point to an element on this page return; } container = element.closest('.jspScrollable'); jsp = container.data('jsp'); // jsp might be another jsp instance than the one, that bound this event // remember: this event is only bound once for all instances. jsp.scrollToElement(element, true); if (container[0].scrollIntoView) { // also scroll to the top of the container (if it is not visible) scrollTop = $(window).scrollTop(); elementTop = element.offset().top; if (elementTop < scrollTop || elementTop > scrollTop + $(window).height()) { container[0].scrollIntoView(); } } // jsp handled this event, prevent the browser default (scrolling :P) event.preventDefault(); }); } // Init touch on iPad, iPhone, iPod, Android function initTouch() { var startX, startY, touchStartX, touchStartY, moved, moving = false; container.unbind('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').bind( 'touchstart.jsp', function (e) { var touch = e.originalEvent.touches[0]; startX = contentPositionX(); startY = contentPositionY(); touchStartX = touch.pageX; touchStartY = touch.pageY; moved = false; moving = true; } ).bind( 'touchmove.jsp', function (ev) { if (!settings.enabled) { ev.preventDefault(); return true; } if (!moving) { return; } var touchPos = ev.originalEvent.touches[0], dX = horizontalDragPosition, dY = verticalDragPosition; jsp.scrollTo(startX + touchStartX - touchPos.pageX, startY + touchStartY - touchPos.pageY); moved = moved || Math.abs(touchStartX - touchPos.pageX) > 5 || Math.abs(touchStartY - touchPos.pageY) > 5; // return true if there was no movement so rest of screen can scroll return dX == horizontalDragPosition && dY == verticalDragPosition; } ).bind( 'touchend.jsp', function (e) { moving = false; /*if(moved) { return false; }*/ } ).bind( 'click.jsp-touchclick', function (e) { if (moved) { moved = false; return false; } } ); } function destroy() { var currentY = contentPositionY(), currentX = contentPositionX(); elem.removeClass('jspScrollable').unbind('.jsp'); elem.replaceWith(originalElement.append(pane.children())); originalElement.scrollTop(currentY); originalElement.scrollLeft(currentX); // clear reinitialize timer if active if (reinitialiseInterval) { clearInterval(reinitialiseInterval); } } // Public API $.extend( jsp, { // Reinitialises the scroll pane (if it's internal dimensions have changed since the last time it // was initialised). The settings object which is passed in will override any settings from the // previous time it was initialised - if you don't pass any settings then the ones from the previous // initialisation will be used. reinitialise: function (s) { s = $.extend({}, settings, s); initialise(s); }, // Scrolls the specified element (a jQuery object, DOM node or jQuery selector string) into view so // that it can be seen within the viewport. If stickToTop is true then the element will appear at // the top of the viewport, if it is false then the viewport will scroll as little as possible to // show the element. You can also specify if you want animation to occur. If you don't provide this // argument then the animateScroll value from the settings object is used instead. scrollToElement: function (ele, stickToTop, animate) { scrollToElement(ele, stickToTop, animate); }, // Scrolls the pane so that the specified co-ordinates within the content are at the top left // of the viewport. animate is optional and if not passed then the value of animateScroll from // the settings object this jScrollPane was initialised with is used. scrollTo: function (destX, destY, animate) { scrollToX(destX, animate); scrollToY(destY, animate); }, // Scrolls the pane so that the specified co-ordinate within the content is at the left of the // viewport. animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. scrollToX: function (destX, animate) { scrollToX(destX, animate); }, // Scrolls the pane so that the specified co-ordinate within the content is at the top of the // viewport. animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. scrollToY: function (destY, animate) { scrollToY(destY, animate); }, // Scrolls the pane to the specified percentage of its maximum horizontal scroll position. animate // is optional and if not passed then the value of animateScroll from the settings object this // jScrollPane was initialised with is used. scrollToPercentX: function (destPercentX, animate) { scrollToX(destPercentX * (contentWidth - paneWidth), animate); }, // Scrolls the pane to the specified percentage of its maximum vertical scroll position. animate // is optional and if not passed then the value of animateScroll from the settings object this // jScrollPane was initialised with is used. scrollToPercentY: function (destPercentY, animate) { scrollToY(destPercentY * (contentHeight - paneHeight), animate); }, // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then // the value of animateScroll from the settings object this jScrollPane was initialised with is used. scrollBy: function (deltaX, deltaY, animate) { jsp.scrollByX(deltaX, animate); jsp.scrollByY(deltaY, animate); }, // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then // the value of animateScroll from the settings object this jScrollPane was initialised with is used. scrollByX: function (deltaX, animate) { var destX = contentPositionX() + Math[deltaX < 0 ? 'floor' : 'ceil'](deltaX), percentScrolled = destX / (contentWidth - paneWidth); positionDragX(percentScrolled * dragMaxX, animate); }, // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then // the value of animateScroll from the settings object this jScrollPane was initialised with is used. scrollByY: function (deltaY, animate) { var destY = contentPositionY() + Math[deltaY < 0 ? 'floor' : 'ceil'](deltaY), percentScrolled = destY / (contentHeight - paneHeight); positionDragY(percentScrolled * dragMaxY, animate); }, // Positions the horizontal drag at the specified x position (and updates the viewport to reflect // this). animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. positionDragX: function (x, animate) { positionDragX(x, animate); }, // Positions the vertical drag at the specified y position (and updates the viewport to reflect // this). animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. positionDragY: function (y, animate) { positionDragY(y, animate); }, // This method is called when jScrollPane is trying to animate to a new position. You can override // it if you want to provide advanced animation functionality. It is passed the following arguments: // * ele - the element whose position is being animated // * prop - the property that is being animated // * value - the value it's being animated to // * stepCallback - a function that you must execute each time you update the value of the property // You can use the default implementation (below) as a starting point for your own implementation. animate: function (ele, prop, value, stepCallback) { var params = {}; params[prop] = value; ele.animate( params, { 'duration': settings.animateDuration, 'easing': settings.animateEase, 'queue': false, 'step': stepCallback } ); }, // Returns the current x position of the viewport with regards to the content pane. getContentPositionX: function () { return contentPositionX(); }, // Returns the current y position of the viewport with regards to the content pane. getContentPositionY: function () { return contentPositionY(); }, // Returns the width of the content within the scroll pane. getContentWidth: function () { return contentWidth; }, // Returns the height of the content within the scroll pane. getContentHeight: function () { return contentHeight; }, // Returns the horizontal position of the viewport within the pane content. getPercentScrolledX: function () { return contentPositionX() / (contentWidth - paneWidth); }, // Returns the vertical position of the viewport within the pane content. getPercentScrolledY: function () { return contentPositionY() / (contentHeight - paneHeight); }, // Returns whether or not this scrollpane has a horizontal scrollbar. getIsScrollableH: function () { return isScrollableH; }, // Returns whether or not this scrollpane has a vertical scrollbar. getIsScrollableV: function () { return isScrollableV; }, // Gets a reference to the content pane. It is important that you use this method if you want to // edit the content of your jScrollPane as if you access the element directly then you may have some // problems (as your original element has had additional elements for the scrollbars etc added into // it). getContentPane: function () { return pane; }, // Scrolls this jScrollPane down as far as it can currently scroll. If animate isn't passed then the // animateScroll value from settings is used instead. scrollToBottom: function (animate) { positionDragY(dragMaxY, animate); }, // Hijacks the links on the page which link to content inside the scrollpane. If you have changed // the content of your page (e.g. via AJAX) and want to make sure any new anchor links to the // contents of your scroll pane will work then call this function. hijackInternalLinks: $.noop, // Removes the jScrollPane and returns the page to the state it was in before jScrollPane was // initialised. destroy: function () { destroy(); }, disable: function () { disable(); }, enable: function () { enable(); } } ); initialise(s); } // Pluginifying code... settings = $.extend({}, $.fn.jScrollPane.defaults, settings); // Apply default speed $.each(['mouseWheelSpeed', 'arrowButtonSpeed', 'trackClickSpeed', 'keyboardSpeed'], function () { settings[this] = settings[this] || settings.speed; }); return this.each( function () { var elem = $(this), jspApi = elem.data('jsp'); if (jspApi) { jspApi.reinitialise(settings); } else { $("script", elem).filter('[type="text/javascript"],:not([type])').remove(); jspApi = new JScrollPane(elem, settings); elem.data('jsp', jspApi); } } ); }; $.fn.jScrollPane.defaults = { showArrows: false, maintainPosition: true, stickToBottom: false, stickToRight: false, clickOnTrack: true, autoReinitialise: false, autoReinitialiseDelay: 500, verticalDragMinHeight: 0, verticalDragMaxHeight: 99999, horizontalDragMinWidth: 0, horizontalDragMaxWidth: 99999, contentWidth: undefined, animateScroll: false, animateDuration: 300, animateEase: 'linear', hijackInternalLinks: false, verticalGutter: 4, horizontalGutter: 4, mouseWheelSpeed: 0, arrowButtonSpeed: 0, arrowRepeatFreq: 50, arrowScrollOnHover: false, trackClickSpeed: 0, trackClickRepeatFreq: 70, verticalArrowPositions: 'split', horizontalArrowPositions: 'split', enableKeyboardNavigation: true, hideFocus: false, keyboardSpeed: 0, initialDelay: 300, // Delay before starting repeating speed: 30, // Default speed when others falsey scrollPagePercent: .8, // Percent of visible area scrolled when pageUp/Down or track area pressed enabled: true }; })(jQuery, this); (function ($) { var isTouchDevice = function () { try { return "ontouchstart" in document.documentElement } catch (e) { return false } }(); $.fn.doubletap = function (onDoubleTapCallback, onTapCallback, delay) { var eventName, action; delay = delay == null ? 500 : delay; eventName = isTouchDevice == true ? "touchend" : "click"; $(this).bind(eventName, function (event) { event.preventDefault(); var now = (new Date).getTime(); var lastTouch = $(this).data("lastTouch") || now + 1; var delta = now - lastTouch; clearTimeout(action); if (delta < delay && delta > 0) { if (onDoubleTapCallback != null && typeof onDoubleTapCallback == "function") onDoubleTapCallback(event) } else { $(this).data("lastTouch", now); action = setTimeout(function (evt) { if (onTapCallback != null && typeof onTapCallback == "function") onTapCallback(evt); clearTimeout(action) }, delay, [event]) } $(this).data("lastTouch", now) }) } })(jQuery); (function ($) { $.fn.touchwipe = function (settings) { var config = { min_move_x: 20, min_move_y: 20, wipeLeft: function () { }, wipeRight: function () { }, wipeUp: function () { }, wipeDown: function () { }, preventDefaultEvents: true }; if (settings) $.extend(config, settings); var _this = this; this.config = config; this.each(function () { var startX; var startY; var isMoving = false; function cancelTouch() { this.removeEventListener("touchmove", onTouchMove); startX = null; isMoving = false } function onTouchMove(e) { if (e.touches.length > 1) isMoving = false; if (_this.config.preventDefaultEvents && isMoving) if (!(jQuery(e.target).hasClass("flowpaper_note_textarea") || jQuery(e.target).hasClass("flowpaper_textarea_data"))) e.preventDefault(); if (isMoving && (jQuery(_this).data("pageMv") == null || jQuery(_this).data("pageMv") && jQuery(_this).data("pageMv").length == 0)) { var x = e.touches[0].pageX; var y = e.touches[0].pageY; var dx = startX - x; var dy = startY - y; if (Math.abs(dx) >= config.min_move_x) { cancelTouch(); if (dx > 0) config.wipeLeft(); else config.wipeRight() } else if (Math.abs(dy) >= config.min_move_y) { cancelTouch(); if (dy > 0) config.wipeDown(); else config.wipeUp() } } } function onTouchStart(e) { if (e.touches.length == 1) { startX = e.touches[0].pageX; startY = e.touches[0].pageY; isMoving = true; this.addEventListener("touchmove", onTouchMove, false) } } if ("ontouchstart" in document.documentElement) this.addEventListener("touchstart", onTouchStart, false) }); return this } })(jQuery); var __slice = Array.prototype.slice; (function ($) { var Sketch; $.fn.sketch = function () { var args, key, sketch; key = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; if (this.length > 1) { $.error('Sketch.js can only be called on one element at a time.'); } sketch = this.data('sketch'); if (typeof key === 'string' && sketch) { if (sketch[key]) { if (typeof sketch[key] === 'function') { return sketch[key].apply(sketch, args); } else if (args.length === 0) { return sketch[key]; } else if (args.length === 1) { return sketch[key] = args[0]; } } else { return $.error('Sketch.js did not recognize the given command.'); } } else if (sketch) { return sketch; } else { this.data('sketch', new Sketch(this.get(0), key)); return this; } }; Sketch = (function () { function Sketch(el, opts) { this.el = el; this.canvas = $(el); this.context = el.getContext('2d'); this.options = $.extend({ toolLinks: true, defaultTool: 'marker', defaultColor: '#000000', defaultSize: 1 }, opts); this.painting = false; this.enabled = true; this.color = this.options.defaultColor; this.size = this.options.defaultSize; this.tool = this.options.defaultTool; this.actions = []; this.action = []; this.bindcanvas = (eb.browser.msie && eb.browser.version < 9) ? this.canvas.parent().parent() : this.canvas; this.bindcanvas.bind('click mousedown mouseup mousemove mouseleave mouseout touchstart touchmove touchend touchcancel', this.onEvent); if (this.options.toolLinks) { $('body').delegate("a[href=\"#" + (this.canvas.attr('id')) + "\"]", 'click', function (e) { var $canvas, $this, key, sketch, _i, _len, _ref; $this = $(this); $canvas = $($this.attr('href')); sketch = $canvas.data('sketch'); _ref = ['color', 'size', 'tool']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { key = _ref[_i]; if ($this.attr("data-" + key)) { sketch.set(key, $(this).attr("data-" + key)); } } if ($(this).attr('data-download')) { sketch.download($(this).attr('data-download')); } return false; }); } } Sketch.prototype.download = function (format) { var mime; format || (format = "png"); if (format === "jpg") { format = "jpeg"; } mime = "image/" + format; return window.open(this.el.toDataURL(mime)); }; Sketch.prototype.set = function (key, value) { this[key] = value; return this.canvas.trigger("sketch.change" + key, value); }; Sketch.prototype.startPainting = function () { this.painting = true; return this.action = { tool: this.tool, drawingShape: this.drawingTool, color: this.color, size: parseFloat(this.size), events: [] }; }; Sketch.prototype.stopPainting = function () { if (this.action) { this.actions.push(this.action); } if (this.painting && this.action && this.action.events && this.action.events.length > 0) $(this.el).trigger("onDrawingStopped", this); this.painting = false; this.action = null; return this.redraw(); }; Sketch.prototype.onEvent = function (e) { var target = (eb.browser.msie && eb.browser.version < 9) ? $($($(this).children().get(0)).children(0).get(0)) : $(this); if (target.data('sketch').enabled) { if (e.originalEvent && e.originalEvent.targetTouches && e.originalEvent.targetTouches.length > 0) { e.pageX = e.originalEvent.targetTouches[0].pageX; e.pageY = e.originalEvent.targetTouches[0].pageY; } $.sketch.tools[target.data('sketch').tool].onEvent.call(target.data('sketch'), e); e.preventDefault(); return false; } else { return true; } }; Sketch.prototype.redraw = function () { var sketch; //this.el.width = this.canvas.width(); // not nessecary in flowpaper this.context = this.el.getContext('2d'); sketch = this; $.each(this.actions, function () { if (this.tool) { return $.sketch.tools[this.tool].draw.call(sketch, this); } }); if (this.painting && this.action) { return $.sketch.tools[this.action.tool].draw.call(sketch, this.action); } }; return Sketch; })(); $.sketch = { tools: {} }; $.sketch.tools.marker = { onEvent: function (e) { if (!this.enabled) { return true; } switch (e.type) { case 'mousedown': case 'touchstart': this.startPainting(); break; case 'mouseup': case 'mouseout': case 'mouseleave': case 'touchend': case 'touchcancel': this.stopPainting(); } if (this.painting) { this.action.events.push({ x: e.pageX - this.canvas.offset().left, y: e.pageY - this.canvas.offset().top, event: e.type }); return this.redraw(); } }, draw: function (action) { var event, previous, _i, _len, _ref; this.context.lineJoin = "round"; this.context.lineCap = "round"; if (action.drawingShape == "Rectangle") { if (this.rect_start_x != action.events[0].x) { this.rect_start_x = action.events[0].x; this.rect_el = document.createElement("canvas"); this.rect_el.width = this.el.width; this.rect_el.height = this.el.height; this.rect_el.getContext('2d').drawImage(this.el, 0, 0); } else { this.el.width = this.el.width; this.context.drawImage(this.rect_el, 0, 0); } this.context.moveTo(action.events[0].x, action.events[0].y); this.context.lineTo(action.events[action.events.length - 1].x, action.events[0].y); this.context.lineTo(action.events[action.events.length - 1].x, action.events[action.events.length - 1].y); this.context.lineTo(action.events[0].x, action.events[action.events.length - 1].y); this.context.lineTo(action.events[0].x, action.events[0].y); this.context.strokeStyle = action.color; this.context.lineWidth = 1; this.context.closePath(); return this.context.stroke(); } else if (action.drawingShape == "DashRectangle") { if (this.rect_start_x != action.events[0].x) { this.rect_start_x = action.events[0].x; this.rect_el = document.createElement("canvas"); this.rect_el.width = this.el.width; this.rect_el.height = this.el.height; this.rect_el.getContext('2d').drawImage(this.el, 0, 0); } else { this.el.width = this.el.width; this.context.drawImage(this.rect_el, 0, 0); } this.context.strokeStyle = "#DD0000"; //this.context.fillStyle = "rgba(200, 0, 0, 0.35)"; this.context.beginPath(); if (CanvasRenderingContext2D.prototype.dashedLine) { this.context.dashedLine(action.events[0].x, action.events[0].y, action.events[action.events.length - 1].x, action.events[0].y, 3); this.context.dashedLine(action.events[action.events.length - 1].x, action.events[0].y, action.events[action.events.length - 1].x, action.events[action.events.length - 1].y, 3); this.context.dashedLine(action.events[action.events.length - 1].x, action.events[action.events.length - 1].y, action.events[0].x, action.events[action.events.length - 1].y, 3); this.context.dashedLine(action.events[0].x, action.events[action.events.length - 1].y, action.events[0].x, action.events[0].y, 3); this.context.lineWidth = 1; } else { this.context.moveTo(action.events[0].x, action.events[0].y); this.context.lineTo(action.events[action.events.length - 1].x, action.events[0].y); this.context.lineTo(action.events[action.events.length - 1].x, action.events[action.events.length - 1].y); this.context.lineTo(action.events[0].x, action.events[action.events.length - 1].y); this.context.lineTo(action.events[0].x, action.events[0].y); this.context.lineWidth = 1; } this.context.closePath(); return this.context.stroke(); } else { this.context.beginPath(); this.context.moveTo(action.events[0].x, action.events[0].y); _ref = action.events; for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; this.context.lineTo(event.x, event.y); previous = event; } this.context.strokeStyle = action.color; this.context.lineWidth = action.size; return this.context.stroke(); } } }; return $.sketch.tools.eraser = { onEvent: function (e) { return $.sketch.tools.marker.onEvent.call(this, e); }, draw: function (action) { var oldcomposite; oldcomposite = this.context.globalCompositeOperation; this.context.globalCompositeOperation = "copy"; action.color = "rgba(0,0,0,0)"; $.sketch.tools.marker.draw.call(this, action); return this.context.globalCompositeOperation = oldcomposite; } }; })(jQuery); /*! jQuery UI - v1.10.0 - 2013-01-30 * http://jqueryui.com * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.resizable.js * Copyright (c) 2013 jQuery Foundation and other contributors Licensed MIT */ (function (e, t) { function i(t, n) { var r, i, o, u = t.nodeName.toLowerCase(); return "area" === u ? (r = t.parentNode, i = r.name, !t.href || !i || r.nodeName.toLowerCase() !== "map" ? !1 : (o = e("img[usemap=#" + i + "]")[0], !!o && s(o))) : (/input|select|textarea|button|object/.test(u) ? !t.disabled : "a" === u ? t.href || n : n) && s(t) } function s(t) { return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function () { return e.css(this, "visibility") === "hidden" }).length } var n = 0, r = /^ui-id-\d+$/; e.ui = e.ui || {}; if (e.ui.version) return; e.extend(e.ui, { version: "1.10.0", keyCode: { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, 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, SPACE: 32, TAB: 9, UP: 38 } }), e.fn.extend({ _focus: e.fn.focus, focus: function (t, n) { return typeof t == "number" ? this.each(function () { var r = this; setTimeout(function () { e(r).focus(), n && n.call(r) }, t) }) : this._focus.apply(this, arguments) }, scrollParent: function () { var t; return e.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? t = this.parents().filter(function () { return /(relative|absolute|fixed)/.test(e.css(this, "position")) && /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x")) }).eq(0) : t = this.parents().filter(function () { return /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x")) }).eq(0), /fixed/.test(this.css("position")) || !t.length ? e(document) : t }, zIndex: function (n) { if (n !== t) return this.css("zIndex", n); if (this.length) { var r = e(this[0]), i, s; while (r.length && r[0] !== document) { i = r.css("position"); if (i === "absolute" || i === "relative" || i === "fixed") { s = parseInt(r.css("zIndex"), 10); if (!isNaN(s) && s !== 0) return s } r = r.parent() } } return 0 }, uniqueId: function () { return this.each(function () { this.id || (this.id = "ui-id-" + ++n) }) }, removeUniqueId: function () { return this.each(function () { r.test(this.id) && e(this).removeAttr("id") }) } }), e.extend(e.expr[":"], { data: e.expr.createPseudo ? e.expr.createPseudo(function (t) { return function (n) { return !!e.data(n, t) } }) : function (t, n, r) { return !!e.data(t, r[3]) }, focusable: function (t) { return i(t, !isNaN(e.attr(t, "tabindex"))) }, tabbable: function (t) { var n = e.attr(t, "tabindex"), r = isNaN(n); return (r || n >= 0) && i(t, !r) } }), e("").outerWidth(1).jquery || e.each(["Width", "Height"], function (n, r) { function u(t, n, r, s) { return e.each(i, function () { n -= parseFloat(e.css(t, "padding" + this)) || 0, r && (n -= parseFloat(e.css(t, "border" + this + "Width")) || 0), s && (n -= parseFloat(e.css(t, "margin" + this)) || 0) }), n } var i = r === "Width" ? ["Left", "Right"] : ["Top", "Bottom"], s = r.toLowerCase(), o = { innerWidth: e.fn.innerWidth, innerHeight: e.fn.innerHeight, outerWidth: e.fn.outerWidth, outerHeight: e.fn.outerHeight }; e.fn["inner" + r] = function (n) { return n === t ? o["inner" + r].call(this) : this.each(function () { e(this).css(s, u(this, n) + "px") }) }, e.fn["outer" + r] = function (t, n) { return typeof t != "number" ? o["outer" + r].call(this, t) : this.each(function () { e(this).css(s, u(this, t, !0, n) + "px") }) } }), e.fn.addBack || (e.fn.addBack = function (e) { return this.add(e == null ? this.prevObject : this.prevObject.filter(e)) }), e("").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function (t) { return function (n) { return arguments.length ? t.call(this, e.camelCase(n)) : t.call(this) } }(e.fn.removeData)), e.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), e.support.selectstart = "onselectstart" in document.createElement("div"), e.fn.extend({ disableSelection: function () { return this.bind((e.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function (e) { e.preventDefault() }) }, enableSelection: function () { return this.unbind(".ui-disableSelection") } }), e.extend(e.ui, { plugin: { add: function (t, n, r) { var i, s = e.ui[t].prototype; for (i in r) s.plugins[i] = s.plugins[i] || [], s.plugins[i].push([n, r[i]]) }, call: function (e, t, n) { var r, i = e.plugins[t]; if (!i || !e.element[0].parentNode || e.element[0].parentNode.nodeType === 11) return; for (r = 0; r < i.length; r++) e.options[i[r][0]] && i[r][1].apply(e.element, n) } }, hasScroll: function (t, n) { if (e(t).css("overflow") === "hidden") return !1; var r = n && n === "left" ? "scrollLeft" : "scrollTop", i = !1; return t[r] > 0 ? !0 : (t[r] = 1, i = t[r] > 0, t[r] = 0, i) } }) })(jQuery); (function (e, t) { var n = 0, r = Array.prototype.slice, i = e.cleanData; e.cleanData = function (t) { for (var n = 0, r; (r = t[n]) != null; n++) try { e(r).triggerHandler("remove") } catch (s) { } i(t) }, e.widget = function (t, n, r) { var i, s, o, u, a = {}, f = t.split(".")[0]; t = t.split(".")[1], i = f + "-" + t, r || (r = n, n = e.Widget), e.expr[":"][i.toLowerCase()] = function (t) { return !!e.data(t, i) }, e[f] = e[f] || {}, s = e[f][t], o = e[f][t] = function (e, t) { if (!this._createWidget) return new o(e, t); arguments.length && this._createWidget(e, t) }, e.extend(o, s, { version: r.version, _proto: e.extend({}, r), _childConstructors: [] }), u = new n, u.options = e.widget.extend({}, u.options), e.each(r, function (t, r) { if (!e.isFunction(r)) { a[t] = r; return } a[t] = function () { var e = function () { return n.prototype[t].apply(this, arguments) }, i = function (e) { return n.prototype[t].apply(this, e) }; return function () { var t = this._super, n = this._superApply, s; return this._super = e, this._superApply = i, s = r.apply(this, arguments), this._super = t, this._superApply = n, s } }() }), o.prototype = e.widget.extend(u, { widgetEventPrefix: s ? u.widgetEventPrefix : t }, a, { constructor: o, namespace: f, widgetName: t, widgetFullName: i }), s ? (e.each(s._childConstructors, function (t, n) { var r = n.prototype; e.widget(r.namespace + "." + r.widgetName, o, n._proto) }), delete s._childConstructors) : n._childConstructors.push(o), e.widget.bridge(t, o) }, e.widget.extend = function (n) { var i = r.call(arguments, 1), s = 0, o = i.length, u, a; for (; s < o; s++) for (u in i[s]) a = i[s][u], i[s].hasOwnProperty(u) && a !== t && (e.isPlainObject(a) ? n[u] = e.isPlainObject(n[u]) ? e.widget.extend({}, n[u], a) : e.widget.extend({}, a) : n[u] = a); return n }, e.widget.bridge = function (n, i) { var s = i.prototype.widgetFullName || n; e.fn[n] = function (o) { var u = typeof o == "string", a = r.call(arguments, 1), f = this; return o = !u && a.length ? e.widget.extend.apply(null, [o].concat(a)) : o, u ? this.each(function () { var r, i = e.data(this, s); if (!i) return e.error("cannot call methods on " + n + " prior to initialization; " + "attempted to call method '" + o + "'"); if (!e.isFunction(i[o]) || o.charAt(0) === "_") return e.error("no such method '" + o + "' for " + n + " widget instance"); r = i[o].apply(i, a); if (r !== i && r !== t) return f = r && r.jquery ? f.pushStack(r.get()) : r, !1 }) : this.each(function () { var t = e.data(this, s); t ? t.option(o || {})._init() : e.data(this, s, new i(o, this)) }), f } }, e.Widget = function () { }, e.Widget._childConstructors = [], e.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "
", options: { disabled: !1, create: null }, _createWidget: function (t, r) { r = e(r || this.defaultElement || this)[0], this.element = e(r), this.uuid = n++, this.eventNamespace = "." + this.widgetName + this.uuid, this.options = e.widget.extend({}, this.options, this._getCreateOptions(), t), this.bindings = e(), this.hoverable = e(), this.focusable = e(), r !== this && (e.data(r, this.widgetFullName, this), this._on(!0, this.element, { remove: function (e) { e.target === r && this.destroy() } }), this.document = e(r.style ? r.ownerDocument : r.document || r), this.window = e(this.document[0].defaultView || this.document[0].parentWindow)), this._create(), this._trigger("create", null, this._getCreateEventData()), this._init() }, _getCreateOptions: e.noop, _getCreateEventData: e.noop, _create: e.noop, _init: e.noop, destroy: function () { this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled"), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus") }, _destroy: e.noop, widget: function () { return this.element }, option: function (n, r) { var i = n, s, o, u; if (arguments.length === 0) return e.widget.extend({}, this.options); if (typeof n == "string") { i = {}, s = n.split("."), n = s.shift(); if (s.length) { o = i[n] = e.widget.extend({}, this.options[n]); for (u = 0; u < s.length - 1; u++) o[s[u]] = o[s[u]] || {}, o = o[s[u]]; n = s.pop(); if (r === t) return o[n] === t ? null : o[n]; o[n] = r } else { if (r === t) return this.options[n] === t ? null : this.options[n]; i[n] = r } } return this._setOptions(i), this }, _setOptions: function (e) { var t; for (t in e) this._setOption(t, e[t]); return this }, _setOption: function (e, t) { return this.options[e] = t, e === "disabled" && (this.widget().toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !!t).attr("aria-disabled", t), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")), this }, enable: function () { return this._setOption("disabled", !1) }, disable: function () { return this._setOption("disabled", !0) }, _on: function (t, n, r) { var i, s = this; typeof t != "boolean" && (r = n, n = t, t = !1), r ? (n = i = e(n), this.bindings = this.bindings.add(n)) : (r = n, n = this.element, i = this.widget()), e.each(r, function (r, o) { function u() { if (!t && (s.options.disabled === !0 || e(this).hasClass("ui-state-disabled"))) return; return (typeof o == "string" ? s[o] : o).apply(s, arguments) } typeof o != "string" && (u.guid = o.guid = o.guid || u.guid || e.guid++); var a = r.match(/^(\w+)\s*(.*)$/), f = a[1] + s.eventNamespace, l = a[2]; l ? i.delegate(l, f, u) : n.bind(f, u) }) }, _off: function (e, t) { t = (t || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, e.unbind(t).undelegate(t) }, _delay: function (e, t) { function n() { return (typeof e == "string" ? r[e] : e).apply(r, arguments) } var r = this; return setTimeout(n, t || 0) }, _hoverable: function (t) { this.hoverable = this.hoverable.add(t), this._on(t, { mouseenter: function (t) { e(t.currentTarget).addClass("ui-state-hover") }, mouseleave: function (t) { e(t.currentTarget).removeClass("ui-state-hover") } }) }, _focusable: function (t) { this.focusable = this.focusable.add(t), this._on(t, { focusin: function (t) { e(t.currentTarget).addClass("ui-state-focus") }, focusout: function (t) { e(t.currentTarget).removeClass("ui-state-focus") } }) }, _trigger: function (t, n, r) { var i, s, o = this.options[t]; r = r || {}, n = e.Event(n), n.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(), n.target = this.element[0], s = n.originalEvent; if (s) for (i in s) i in n || (n[i] = s[i]); return this.element.trigger(n, r), !(e.isFunction(o) && o.apply(this.element[0], [n].concat(r)) === !1 || n.isDefaultPrevented()) } }, e.each({ show: "fadeIn", hide: "fadeOut" }, function (t, n) { e.Widget.prototype["_" + t] = function (r, i, s) { typeof i == "string" && (i = { effect: i }); var o, u = i ? i === !0 || typeof i == "number" ? n : i.effect || n : t; i = i || {}, typeof i == "number" && (i = { duration: i }), o = !e.isEmptyObject(i), i.complete = s, i.delay && r.delay(i.delay), o && e.effects && e.effects.effect[u] ? r[t](i) : u !== t && r[u] ? r[u](i.duration, i.easing, s) : r.queue(function (n) { e(this)[t](), s && s.call(r[0]), n() }) } }) })(jQuery); (function (e, t) { var n = !1; e(document).mouseup(function () { n = !1 }), e.widget("ui.mouse", { version: "1.10.0", options: { cancel: "input,textarea,button,select,option", distance: 1, delay: 0 }, _mouseInit: function () { var t = this; this.element.bind("mousedown." + this.widgetName, function (e) { return t._mouseDown(e) }).bind("click." + this.widgetName, function (n) { if (!0 === e.data(n.target, t.widgetName + ".preventClickEvent")) return e.removeData(n.target, t.widgetName + ".preventClickEvent"), n.stopImmediatePropagation(), !1 }), this.started = !1 }, _mouseDestroy: function () { this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate) }, _mouseDown: function (t) { if (n) return; this._mouseStarted && this._mouseUp(t), this._mouseDownEvent = t; var r = this, i = t.which === 1, s = typeof this.options.cancel == "string" && t.target.nodeName ? e(t.target).closest(this.options.cancel).length : !1; if (!i || s || !this._mouseCapture(t)) return !0; this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () { r.mouseDelayMet = !0 }, this.options.delay)); if (this._mouseDistanceMet(t) && this._mouseDelayMet(t)) { this._mouseStarted = this._mouseStart(t) !== !1; if (!this._mouseStarted) return t.preventDefault(), !0 } return !0 === e.data(t.target, this.widgetName + ".preventClickEvent") && e.removeData(t.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function (e) { return r._mouseMove(e) }, this._mouseUpDelegate = function (e) { return r._mouseUp(e) }, e(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), t.preventDefault(), n = !0, !0 }, _mouseMove: function (t) { return e.ui.ie && (!document.documentMode || document.documentMode < 9) && !t.button ? this._mouseUp(t) : this._mouseStarted ? (this._mouseDrag(t), t.preventDefault()) : (this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== !1, this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t)), !this._mouseStarted) }, _mouseUp: function (t) { return e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, t.target === this._mouseDownEvent.target && e.data(t.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(t)), !1 }, _mouseDistanceMet: function (e) { return Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX), Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance }, _mouseDelayMet: function () { return this.mouseDelayMet }, _mouseStart: function () { }, _mouseDrag: function () { }, _mouseStop: function () { }, _mouseCapture: function () { return !0 } }) })(jQuery); (function (e, t) { e.widget("ui.draggable", e.ui.mouse, { version: "1.10.0", widgetEventPrefix: "drag", options: { addClasses: !0, appendTo: "parent", axis: !1, connectToSortable: !1, containment: !1, cursor: "auto", cursorAt: !1, grid: !1, handle: !1, helper: "original", iframeFix: !1, opacity: !1, refreshPositions: !1, revert: !1, revertDuration: 500, scope: "default", scroll: !0, scrollSensitivity: 20, scrollSpeed: 20, snap: !1, snapMode: "both", snapTolerance: 20, stack: !1, zIndex: !1, drag: null, start: null, stop: null }, _create: function () { this.options.helper === "original" && !/^(?:r|a|f)/.test(this.element.css("position")) && (this.element[0].style.position = "relative"), this.options.addClasses && this.element.addClass("ui-draggable"), this.options.disabled && this.element.addClass("ui-draggable-disabled"), this._mouseInit() }, _destroy: function () { this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"), this._mouseDestroy() }, _mouseCapture: function (t) { var n = this.options; return this.helper || n.disabled || e(t.target).closest(".ui-resizable-handle").length > 0 ? !1 : (this.handle = this._getHandle(t), this.handle ? (e(n.iframeFix === !0 ? "iframe" : n.iframeFix).each(function () { e("
").css({ width: this.offsetWidth + "px", height: this.offsetHeight + "px", position: "absolute", opacity: "0.001", zIndex: 1e3 }).css(e(this).offset()).appendTo("body") }), !0) : !1) }, _mouseStart: function (t) { var n = this.options; return this.helper = this._createHelper(t), this.helper.addClass("ui-draggable-dragging"), this._cacheHelperProportions(), e.ui.ddmanager && (e.ui.ddmanager.current = this), this._cacheMargins(), this.cssPosition = this.helper.css("position"), this.scrollParent = this.helper.scrollParent(), this.offset = this.positionAbs = this.element.offset(), this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }, e.extend(this.offset, { click: { left: t.pageX - this.offset.left, top: t.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }), this.originalPosition = this.position = this._generatePosition(t), this.originalPageX = t.pageX, this.originalPageY = t.pageY, n.cursorAt && this._adjustOffsetFromHelper(n.cursorAt), n.containment && this._setContainment(), this._trigger("start", t) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(), e.ui.ddmanager && !n.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t), this._mouseDrag(t, !0), e.ui.ddmanager && e.ui.ddmanager.dragStart(this, t), !0) }, _mouseDrag: function (t, n) { this.position = this._generatePosition(t), this.positionAbs = this._convertPositionTo("absolute"); if (!n) { var r = this._uiHash(); if (this._trigger("drag", t, r) === !1) return this._mouseUp({}), !1; this.position = r.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"; return e.ui.ddmanager && e.ui.ddmanager.drag(this, t), !1 }, _mouseStop: function (t) { var n, r = this, i = !1, s = !1; e.ui.ddmanager && !this.options.dropBehaviour && (s = e.ui.ddmanager.drop(this, t)), this.dropped && (s = this.dropped, this.dropped = !1), n = this.element[0]; while (n && (n = n.parentNode)) n === document && (i = !0); return !i && this.options.helper === "original" ? !1 : (this.options.revert === "invalid" && !s || this.options.revert === "valid" && s || this.options.revert === !0 || e.isFunction(this.options.revert) && this.options.revert.call(this.element, s) ? e(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () { r._trigger("stop", t) !== !1 && r._clear() }) : this._trigger("stop", t) !== !1 && this._clear(), !1) }, _mouseUp: function (t) { return e("div.ui-draggable-iframeFix").each(function () { this.parentNode.removeChild(this) }), e.ui.ddmanager && e.ui.ddmanager.dragStop(this, t), e.ui.mouse.prototype._mouseUp.call(this, t) }, cancel: function () { return this.helper.is(".ui-draggable-dragging") ? this._mouseUp({}) : this._clear(), this }, _getHandle: function (t) { var n = !this.options.handle || !e(this.options.handle, this.element).length ? !0 : !1; return e(this.options.handle, this.element).find("*").addBack().each(function () { this === t.target && (n = !0) }), n }, _createHelper: function (t) { var n = this.options, r = e.isFunction(n.helper) ? e(n.helper.apply(this.element[0], [t])) : n.helper === "clone" ? this.element.clone().removeAttr("id") : this.element; return r.parents("body").length || r.appendTo(n.appendTo === "parent" ? this.element[0].parentNode : n.appendTo), r[0] !== this.element[0] && !/(fixed|absolute)/.test(r.css("position")) && r.css("position", "absolute"), r }, _adjustOffsetFromHelper: function (t) { typeof t == "string" && (t = t.split(" ")), e.isArray(t) && (t = { left: +t[0], top: +t[1] || 0 }), "left" in t && (this.offset.click.left = t.left + this.margins.left), "right" in t && (this.offset.click.left = this.helperProportions.width - t.right + this.margins.left), "top" in t && (this.offset.click.top = t.top + this.margins.top), "bottom" in t && (this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top) }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var t = this.offsetParent.offset(); this.cssPosition === "absolute" && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) && (t.left += this.scrollParent.scrollLeft(), t.top += this.scrollParent.scrollTop()); if (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && e.ui.ie) t = { top: 0, left: 0 }; return { top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) } }, _getRelativeOffset: function () { if (this.cssPosition === "relative") { var e = this.element.position(); return { top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft() } } return { top: 0, left: 0 } }, _cacheMargins: function () { this.margins = { left: parseInt(this.element.css("marginLeft"), 10) || 0, top: parseInt(this.element.css("marginTop"), 10) || 0, right: parseInt(this.element.css("marginRight"), 10) || 0, bottom: parseInt(this.element.css("marginBottom"), 10) || 0 } }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() } }, _setContainment: function () { var t, n, r, i = this.options; i.containment === "parent" && (i.containment = this.helper[0].parentNode); if (i.containment === "document" || i.containment === "window") this.containment = [i.containment === "document" ? 0 : e(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, i.containment === "document" ? 0 : e(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, (i.containment === "document" ? 0 : e(window).scrollLeft()) + e(i.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (i.containment === "document" ? 0 : e(window).scrollTop()) + (e(i.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]; if (!/^(document|window|parent)$/.test(i.containment) && i.containment.constructor !== Array) { n = e(i.containment), r = n[0]; if (!r) return; t = e(r).css("overflow") !== "hidden", this.containment = [(parseInt(e(r).css("borderLeftWidth"), 10) || 0) + (parseInt(e(r).css("paddingLeft"), 10) || 0), (parseInt(e(r).css("borderTopWidth"), 10) || 0) + (parseInt(e(r).css("paddingTop"), 10) || 0), (t ? Math.max(r.scrollWidth, r.offsetWidth) : r.offsetWidth) - (parseInt(e(r).css("borderLeftWidth"), 10) || 0) - (parseInt(e(r).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (t ? Math.max(r.scrollHeight, r.offsetHeight) : r.offsetHeight) - (parseInt(e(r).css("borderTopWidth"), 10) || 0) - (parseInt(e(r).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom], this.relative_container = n } else i.containment.constructor === Array && (this.containment = i.containment) }, _convertPositionTo: function (t, n) { n || (n = this.position); var r = t === "absolute" ? 1 : -1, i = this.cssPosition !== "absolute" || this.scrollParent[0] !== document && !!e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, s = /(html|body)/i.test(i[0].tagName); return { top: n.top + this.offset.relative.top * r + this.offset.parent.top * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : s ? 0 : i.scrollTop()) * r, left: n.left + this.offset.relative.left * r + this.offset.parent.left * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : s ? 0 : i.scrollLeft()) * r } }, _generatePosition: function (t) { var n, r, i, s, o = this.options, u = this.cssPosition !== "absolute" || this.scrollParent[0] !== document && !!e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, a = /(html|body)/i.test(u[0].tagName), f = t.pageX, l = t.pageY; return this.originalPosition && (this.containment && (this.relative_container ? (r = this.relative_container.offset(), n = [this.containment[0] + r.left, this.containment[1] + r.top, this.containment[2] + r.left, this.containment[3] + r.top]) : n = this.containment, t.pageX - this.offset.click.left < n[0] && (f = n[0] + this.offset.click.left), t.pageY - this.offset.click.top < n[1] && (l = n[1] + this.offset.click.top), t.pageX - this.offset.click.left > n[2] && (f = n[2] + this.offset.click.left), t.pageY - this.offset.click.top > n[3] && (l = n[3] + this.offset.click.top)), o.grid && (i = o.grid[1] ? this.originalPageY + Math.round((l - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY, l = n ? i - this.offset.click.top >= n[1] || i - this.offset.click.top > n[3] ? i : i - this.offset.click.top >= n[1] ? i - o.grid[1] : i + o.grid[1] : i, s = o.grid[0] ? this.originalPageX + Math.round((f - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX, f = n ? s - this.offset.click.left >= n[0] || s - this.offset.click.left > n[2] ? s : s - this.offset.click.left >= n[0] ? s - o.grid[0] : s + o.grid[0] : s)), { top: l - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : a ? 0 : u.scrollTop()), left: f - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : a ? 0 : u.scrollLeft()) } }, _clear: function () { this.helper.removeClass("ui-draggable-dragging"), this.helper[0] !== this.element[0] && !this.cancelHelperRemoval && this.helper.remove(), this.helper = null, this.cancelHelperRemoval = !1 }, _trigger: function (t, n, r) { return r = r || this._uiHash(), e.ui.plugin.call(this, t, [n, r]), t === "drag" && (this.positionAbs = this._convertPositionTo("absolute")), e.Widget.prototype._trigger.call(this, t, n, r) }, plugins: {}, _uiHash: function () { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs } } }), e.ui.plugin.add("draggable", "connectToSortable", { start: function (t, n) { var r = e(this).data("ui-draggable"), i = r.options, s = e.extend({}, n, { item: r.element }); r.sortables = [], e(i.connectToSortable).each(function () { var n = e.data(this, "ui-sortable"); n && !n.options.disabled && (r.sortables.push({ instance: n, shouldRevert: n.options.revert }), n.refreshPositions(), n._trigger("activate", t, s)) }) }, stop: function (t, n) { var r = e(this).data("ui-draggable"), i = e.extend({}, n, { item: r.element }); e.each(r.sortables, function () { this.instance.isOver ? (this.instance.isOver = 0, r.cancelHelperRemoval = !0, this.instance.cancelHelperRemoval = !1, this.shouldRevert && (this.instance.options.revert = !0), this.instance._mouseStop(t), this.instance.options.helper = this.instance.options._helper, r.options.helper === "original" && this.instance.currentItem.css({ top: "auto", left: "auto" })) : (this.instance.cancelHelperRemoval = !1, this.instance._trigger("deactivate", t, i)) }) }, drag: function (t, n) { var r = e(this).data("ui-draggable"), i = this; e.each(r.sortables, function () { var s = !1, o = this; this.instance.positionAbs = r.positionAbs, this.instance.helperProportions = r.helperProportions, this.instance.offset.click = r.offset.click, this.instance._intersectsWith(this.instance.containerCache) && (s = !0, e.each(r.sortables, function () { return this.instance.positionAbs = r.positionAbs, this.instance.helperProportions = r.helperProportions, this.instance.offset.click = r.offset.click, this !== o && this.instance._intersectsWith(this.instance.containerCache) && e.ui.contains(o.instance.element[0], this.instance.element[0]) && (s = !1), s })), s ? (this.instance.isOver || (this.instance.isOver = 1, this.instance.currentItem = e(i).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", !0), this.instance.options._helper = this.instance.options.helper, this.instance.options.helper = function () { return n.helper[0] }, t.target = this.instance.currentItem[0], this.instance._mouseCapture(t, !0), this.instance._mouseStart(t, !0, !0), this.instance.offset.click.top = r.offset.click.top, this.instance.offset.click.left = r.offset.click.left, this.instance.offset.parent.left -= r.offset.parent.left - this.instance.offset.parent.left, this.instance.offset.parent.top -= r.offset.parent.top - this.instance.offset.parent.top, r._trigger("toSortable", t), r.dropped = this.instance.element, r.currentItem = r.element, this.instance.fromOutside = r), this.instance.currentItem && this.instance._mouseDrag(t)) : this.instance.isOver && (this.instance.isOver = 0, this.instance.cancelHelperRemoval = !0, this.instance.options.revert = !1, this.instance._trigger("out", t, this.instance._uiHash(this.instance)), this.instance._mouseStop(t, !0), this.instance.options.helper = this.instance.options._helper, this.instance.currentItem.remove(), this.instance.placeholder && this.instance.placeholder.remove(), r._trigger("fromSortable", t), r.dropped = !1) }) } }), e.ui.plugin.add("draggable", "cursor", { start: function () { var t = e("body"), n = e(this).data("ui-draggable").options; t.css("cursor") && (n._cursor = t.css("cursor")), t.css("cursor", n.cursor) }, stop: function () { var t = e(this).data("ui-draggable").options; t._cursor && e("body").css("cursor", t._cursor) } }), e.ui.plugin.add("draggable", "opacity", { start: function (t, n) { var r = e(n.helper), i = e(this).data("ui-draggable").options; r.css("opacity") && (i._opacity = r.css("opacity")), r.css("opacity", i.opacity) }, stop: function (t, n) { var r = e(this).data("ui-draggable").options; r._opacity && e(n.helper).css("opacity", r._opacity) } }), e.ui.plugin.add("draggable", "scroll", { start: function () { var t = e(this).data("ui-draggable"); t.scrollParent[0] !== document && t.scrollParent[0].tagName !== "HTML" && (t.overflowOffset = t.scrollParent.offset()) }, drag: function (t) { var n = e(this).data("ui-draggable"), r = n.options, i = !1; if (n.scrollParent[0] !== document && n.scrollParent[0].tagName !== "HTML") { if (!r.axis || r.axis !== "x") n.overflowOffset.top + n.scrollParent[0].offsetHeight - t.pageY < r.scrollSensitivity ? n.scrollParent[0].scrollTop = i = n.scrollParent[0].scrollTop + r.scrollSpeed : t.pageY - n.overflowOffset.top < r.scrollSensitivity && (n.scrollParent[0].scrollTop = i = n.scrollParent[0].scrollTop - r.scrollSpeed); if (!r.axis || r.axis !== "y") n.overflowOffset.left + n.scrollParent[0].offsetWidth - t.pageX < r.scrollSensitivity ? n.scrollParent[0].scrollLeft = i = n.scrollParent[0].scrollLeft + r.scrollSpeed : t.pageX - n.overflowOffset.left < r.scrollSensitivity && (n.scrollParent[0].scrollLeft = i = n.scrollParent[0].scrollLeft - r.scrollSpeed) } else { if (!r.axis || r.axis !== "x") t.pageY - e(document).scrollTop() < r.scrollSensitivity ? i = e(document).scrollTop(e(document).scrollTop() - r.scrollSpeed) : e(window).height() - (t.pageY - e(document).scrollTop()) < r.scrollSensitivity && (i = e(document).scrollTop(e(document).scrollTop() + r.scrollSpeed)); if (!r.axis || r.axis !== "y") t.pageX - e(document).scrollLeft() < r.scrollSensitivity ? i = e(document).scrollLeft(e(document).scrollLeft() - r.scrollSpeed) : e(window).width() - (t.pageX - e(document).scrollLeft()) < r.scrollSensitivity && (i = e(document).scrollLeft(e(document).scrollLeft() + r.scrollSpeed)) } i !== !1 && e.ui.ddmanager && !r.dropBehaviour && e.ui.ddmanager.prepareOffsets(n, t) } }), e.ui.plugin.add("draggable", "snap", { start: function () { var t = e(this).data("ui-draggable"), n = t.options; t.snapElements = [], e(n.snap.constructor !== String ? n.snap.items || ":data(ui-draggable)" : n.snap).each(function () { var n = e(this), r = n.offset(); this !== t.element[0] && t.snapElements.push({ item: this, width: n.outerWidth(), height: n.outerHeight(), top: r.top, left: r.left }) }) }, drag: function (t, n) { var r, i, s, o, u, a, f, l, c, h, p = e(this).data("ui-draggable"), d = p.options, v = d.snapTolerance, m = n.offset.left, g = m + p.helperProportions.width, y = n.offset.top, b = y + p.helperProportions.height; for (c = p.snapElements.length - 1; c >= 0; c--) { u = p.snapElements[c].left, a = u + p.snapElements[c].width, f = p.snapElements[c].top, l = f + p.snapElements[c].height; if (!(u - v < m && m < a + v && f - v < y && y < l + v || u - v < m && m < a + v && f - v < b && b < l + v || u - v < g && g < a + v && f - v < y && y < l + v || u - v < g && g < a + v && f - v < b && b < l + v)) { p.snapElements[c].snapping && p.options.snap.release && p.options.snap.release.call(p.element, t, e.extend(p._uiHash(), { snapItem: p.snapElements[c].item })), p.snapElements[c].snapping = !1; continue } d.snapMode !== "inner" && (r = Math.abs(f - b) <= v, i = Math.abs(l - y) <= v, s = Math.abs(u - g) <= v, o = Math.abs(a - m) <= v, r && (n.position.top = p._convertPositionTo("relative", { top: f - p.helperProportions.height, left: 0 }).top - p.margins.top), i && (n.position.top = p._convertPositionTo("relative", { top: l, left: 0 }).top - p.margins.top), s && (n.position.left = p._convertPositionTo("relative", { top: 0, left: u - p.helperProportions.width }).left - p.margins.left), o && (n.position.left = p._convertPositionTo("relative", { top: 0, left: a }).left - p.margins.left)), h = r || i || s || o, d.snapMode !== "outer" && (r = Math.abs(f - y) <= v, i = Math.abs(l - b) <= v, s = Math.abs(u - m) <= v, o = Math.abs(a - g) <= v, r && (n.position.top = p._convertPositionTo("relative", { top: f, left: 0 }).top - p.margins.top), i && (n.position.top = p._convertPositionTo("relative", { top: l - p.helperProportions.height, left: 0 }).top - p.margins.top), s && (n.position.left = p._convertPositionTo("relative", { top: 0, left: u }).left - p.margins.left), o && (n.position.left = p._convertPositionTo("relative", { top: 0, left: a - p.helperProportions.width }).left - p.margins.left)), !p.snapElements[c].snapping && (r || i || s || o || h) && p.options.snap.snap && p.options.snap.snap.call(p.element, t, e.extend(p._uiHash(), { snapItem: p.snapElements[c].item })), p.snapElements[c].snapping = r || i || s || o || h } } }), e.ui.plugin.add("draggable", "stack", { start: function () { var t, n = e(this).data("ui-draggable").options, r = e.makeArray(e(n.stack)).sort(function (t, n) { return (parseInt(e(t).css("zIndex"), 10) || 0) - (parseInt(e(n).css("zIndex"), 10) || 0) }); if (!r.length) return; t = parseInt(r[0].style.zIndex, 10) || 0, e(r).each(function (e) { this.style.zIndex = t + e }), this[0].style.zIndex = t + r.length } }), e.ui.plugin.add("draggable", "zIndex", { start: function (t, n) { var r = e(n.helper), i = e(this).data("ui-draggable").options; r.css("zIndex") && (i._zIndex = r.css("zIndex")), r.css("zIndex", i.zIndex) }, stop: function (t, n) { var r = e(this).data("ui-draggable").options; r._zIndex && e(n.helper).css("zIndex", r._zIndex) } }) })(jQuery); (function (e, t) { function n(e) { return parseInt(e, 10) || 0 } function r(e) { return !isNaN(parseInt(e, 10)) } e.widget("ui.resizable", e.ui.mouse, { version: "1.10.0", widgetEventPrefix: "resize", options: { alsoResize: !1, animate: !1, animateDuration: "slow", animateEasing: "swing", aspectRatio: !1, autoHide: !1, containment: !1, ghost: !1, grid: !1, handles: "e,s,se", helper: !1, maxHeight: null, maxWidth: null, minHeight: 10, minWidth: 10, zIndex: 90, resize: null, start: null, stop: null }, _create: function () { var t, n, r, i, s, o = this, u = this.options; this.element.addClass("ui-resizable"), e.extend(this, { _aspectRatio: !!u.aspectRatio, aspectRatio: u.aspectRatio, originalElement: this.element, _proportionallyResizeElements: [], _helper: u.helper || u.ghost || u.animate ? u.helper || "ui-resizable-helper" : null }), this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i) && (this.element.wrap(e("
").css({ position: this.element.css("position"), width: this.element.outerWidth(), height: this.element.outerHeight(), top: this.element.css("top"), left: this.element.css("left") })), this.element = this.element.parent().data("ui-resizable", this.element.data("ui-resizable")), this.elementIsWrapper = !0, this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }), this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0 }), this.originalResizeStyle = this.originalElement.css("resize"), this.originalElement.css("resize", "none"), this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" })), this.originalElement.css({ margin: this.originalElement.css("margin") }), this._proportionallyResize()), this.handles = u.handles || (e(".ui-resizable-handle", this.element).length ? { 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" } : "e,s,se"); if (this.handles.constructor === String) { this.handles === "all" && (this.handles = "n,e,s,w,se,sw,ne,nw"), t = this.handles.split(","), this.handles = {}; for (n = 0; n < t.length; n++) r = e.trim(t[n]), s = "ui-resizable-" + r, i = e("
"), i.css({ zIndex: u.zIndex }), "se" === r && i.addClass("ui-icon ui-icon-gripsmall-diagonal-se"), this.handles[r] = ".ui-resizable-" + r, this.element.append(i) } this._renderAxis = function (t) { var n, r, i, s; t = t || this.element; for (n in this.handles) { this.handles[n].constructor === String && (this.handles[n] = e(this.handles[n], this.element).show()), this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i) && (r = e(this.handles[n], this.element), s = /sw|ne|nw|se|n|s/.test(n) ? r.outerHeight() : r.outerWidth(), i = ["padding", /ne|nw|n/.test(n) ? "Top" : /se|sw|s/.test(n) ? "Bottom" : /^e$/.test(n) ? "Right" : "Left"].join(""), t.css(i, s), this._proportionallyResize()); if (!e(this.handles[n]).length) continue } }, this._renderAxis(this.element), this._handles = e(".ui-resizable-handle", this.element).disableSelection(), this._handles.mouseover(function () { o.resizing || (this.className && (i = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)), o.axis = i && i[1] ? i[1] : "se") }), u.autoHide && (this._handles.hide(), e(this.element).addClass("ui-resizable-autohide").mouseenter(function () { if (u.disabled) return; e(this).removeClass("ui-resizable-autohide"), o._handles.show() }).mouseleave(function () { if (u.disabled) return; o.resizing || (e(this).addClass("ui-resizable-autohide"), o._handles.hide()) })), this._mouseInit() }, _destroy: function () { this._mouseDestroy(); var t, n = function (t) { e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove() }; return this.elementIsWrapper && (n(this.element), t = this.element, this.originalElement.css({ position: t.css("position"), width: t.outerWidth(), height: t.outerHeight(), top: t.css("top"), left: t.css("left") }).insertAfter(t), t.remove()), this.originalElement.css("resize", this.originalResizeStyle), n(this.originalElement), this }, _mouseCapture: function (t) { var n, r, i = !1; for (n in this.handles) { r = e(this.handles[n])[0]; if (r === t.target || e.contains(r, t.target)) i = !0 } return !this.options.disabled && i }, _mouseStart: function (t) { var r, i, s, o = this.options, u = this.element.position(), a = this.element; return this.resizing = !0, /absolute/.test(a.css("position")) ? a.css({ position: "absolute", top: a.css("top"), left: a.css("left") }) : a.is(".ui-draggable") && a.css({ position: "absolute", top: u.top, left: u.left }), this._renderProxy(), r = n(this.helper.css("left")), i = n(this.helper.css("top")), o.containment && (r += e(o.containment).scrollLeft() || 0, i += e(o.containment).scrollTop() || 0), this.offset = this.helper.offset(), this.position = { left: r, top: i }, this.size = this._helper ? { width: a.outerWidth(), height: a.outerHeight() } : { width: a.width(), height: a.height() }, this.originalSize = this._helper ? { width: a.outerWidth(), height: a.outerHeight() } : { width: a.width(), height: a.height() }, this.originalPosition = { left: r, top: i }, this.sizeDiff = { width: a.outerWidth() - a.width(), height: a.outerHeight() - a.height() }, this.originalMousePosition = { left: t.pageX, top: t.pageY }, this.aspectRatio = typeof o.aspectRatio == "number" ? o.aspectRatio : this.originalSize.width / this.originalSize.height || 1, s = e(".ui-resizable-" + this.axis).css("cursor"), e("body").css("cursor", s === "auto" ? this.axis + "-resize" : s), a.addClass("ui-resizable-resizing"), this._propagate("start", t), !0 }, _mouseDrag: function (t) { var n, r = this.helper, i = {}, s = this.originalMousePosition, o = this.axis, u = this.position.top, a = this.position.left, f = this.size.width, l = this.size.height, c = t.pageX - s.left || 0, h = t.pageY - s.top || 0, p = this._change[o]; if (!p) return !1; n = p.apply(this, [t, c, h]), this._updateVirtualBoundaries(t.shiftKey); if (this._aspectRatio || t.shiftKey) n = this._updateRatio(n, t); return n = this._respectSize(n, t), this._updateCache(n), this._propagate("resize", t), this.position.top !== u && (i.top = this.position.top + "px"), this.position.left !== a && (i.left = this.position.left + "px"), this.size.width !== f && (i.width = this.size.width + "px"), this.size.height !== l && (i.height = this.size.height + "px"), r.css(i), !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(), e.isEmptyObject(i) || this._trigger("resize", t, this.ui()), !1 }, _mouseStop: function (t) { this.resizing = !1; var n, r, i, s, o, u, a, f = this.options, l = this; return this._helper && (n = this._proportionallyResizeElements, r = n.length && /textarea/i.test(n[0].nodeName), i = r && e.ui.hasScroll(n[0], "left") ? 0 : l.sizeDiff.height, s = r ? 0 : l.sizeDiff.width, o = { width: l.helper.width() - s, height: l.helper.height() - i }, u = parseInt(l.element.css("left"), 10) + (l.position.left - l.originalPosition.left) || null, a = parseInt(l.element.css("top"), 10) + (l.position.top - l.originalPosition.top) || null, f.animate || this.element.css(e.extend(o, { top: a, left: u })), l.helper.height(l.size.height), l.helper.width(l.size.width), this._helper && !f.animate && this._proportionallyResize()), e("body").css("cursor", "auto"), this.element.removeClass("ui-resizable-resizing"), this._propagate("stop", t), this._helper && this.helper.remove(), !1 }, _updateVirtualBoundaries: function (e) { var t, n, i, s, o, u = this.options; o = { minWidth: r(u.minWidth) ? u.minWidth : 0, maxWidth: r(u.maxWidth) ? u.maxWidth : Infinity, minHeight: r(u.minHeight) ? u.minHeight : 0, maxHeight: r(u.maxHeight) ? u.maxHeight : Infinity }; if (this._aspectRatio || e) t = o.minHeight * this.aspectRatio, i = o.minWidth / this.aspectRatio, n = o.maxHeight * this.aspectRatio, s = o.maxWidth / this.aspectRatio, t > o.minWidth && (o.minWidth = t), i > o.minHeight && (o.minHeight = i), n < o.maxWidth && (o.maxWidth = n), s < o.maxHeight && (o.maxHeight = s); this._vBoundaries = o }, _updateCache: function (e) { this.offset = this.helper.offset(), r(e.left) && (this.position.left = e.left), r(e.top) && (this.position.top = e.top), r(e.height) && (this.size.height = e.height), r(e.width) && (this.size.width = e.width) }, _updateRatio: function (e) { var t = this.position, n = this.size, i = this.axis; return r(e.height) ? e.width = e.height * this.aspectRatio : r(e.width) && (e.height = e.width / this.aspectRatio), i === "sw" && (e.left = t.left + (n.width - e.width), e.top = null), i === "nw" && (e.top = t.top + (n.height - e.height), e.left = t.left + (n.width - e.width)), e }, _respectSize: function (e) { var t = this._vBoundaries, n = this.axis, i = r(e.width) && t.maxWidth && t.maxWidth < e.width, s = r(e.height) && t.maxHeight && t.maxHeight < e.height, o = r(e.width) && t.minWidth && t.minWidth > e.width, u = r(e.height) && t.minHeight && t.minHeight > e.height, a = this.originalPosition.left + this.originalSize.width, f = this.position.top + this.size.height, l = /sw|nw|w/.test(n), c = /nw|ne|n/.test(n); return o && (e.width = t.minWidth), u && (e.height = t.minHeight), i && (e.width = t.maxWidth), s && (e.height = t.maxHeight), o && l && (e.left = a - t.minWidth), i && l && (e.left = a - t.maxWidth), u && c && (e.top = f - t.minHeight), s && c && (e.top = f - t.maxHeight), !e.width && !e.height && !e.left && e.top ? e.top = null : !e.width && !e.height && !e.top && e.left && (e.left = null), e }, _proportionallyResize: function () { if (!this._proportionallyResizeElements.length) return; var e, t, n, r, i, s = this.helper || this.element; for (e = 0; e < this._proportionallyResizeElements.length; e++) { i = this._proportionallyResizeElements[e]; if (!this.borderDif) { this.borderDif = [], n = [i.css("borderTopWidth"), i.css("borderRightWidth"), i.css("borderBottomWidth"), i.css("borderLeftWidth")], r = [i.css("paddingTop"), i.css("paddingRight"), i.css("paddingBottom"), i.css("paddingLeft")]; for (t = 0; t < n.length; t++) this.borderDif[t] = (parseInt(n[t], 10) || 0) + (parseInt(r[t], 10) || 0) } i.css({ height: s.height() - this.borderDif[0] - this.borderDif[2] || 0, width: s.width() - this.borderDif[1] - this.borderDif[3] || 0 }) } }, _renderProxy: function () { var t = this.element, n = this.options; this.elementOffset = t.offset(), this._helper ? (this.helper = this.helper || e("
"), this.helper.addClass(this._helper).css({ width: this.element.outerWidth() - 1, height: this.element.outerHeight() - 1, position: "absolute", left: this.elementOffset.left + "px", top: this.elementOffset.top + "px", zIndex: ++n.zIndex }), this.helper.appendTo("body").disableSelection()) : this.helper = this.element }, _change: { e: function (e, t) { return { width: this.originalSize.width + t } }, w: function (e, t) { var n = this.originalSize, r = this.originalPosition; return { left: r.left + t, width: n.width - t } }, n: function (e, t, n) { var r = this.originalSize, i = this.originalPosition; return { top: i.top + n, height: r.height - n } }, s: function (e, t, n) { return { height: this.originalSize.height + n } }, se: function (t, n, r) { return e.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [t, n, r])) }, sw: function (t, n, r) { return e.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [t, n, r])) }, ne: function (t, n, r) { return e.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [t, n, r])) }, nw: function (t, n, r) { return e.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [t, n, r])) } }, _propagate: function (t, n) { e.ui.plugin.call(this, t, [n, this.ui()]), t !== "resize" && this._trigger(t, n, this.ui()) }, plugins: {}, ui: function () { return { originalElement: this.originalElement, element: this.element, helper: this.helper, position: this.position, size: this.size, originalSize: this.originalSize, originalPosition: this.originalPosition } } }), e.ui.plugin.add("resizable", "animate", { stop: function (t) { var n = e(this).data("ui-resizable"), r = n.options, i = n._proportionallyResizeElements, s = i.length && /textarea/i.test(i[0].nodeName), o = s && e.ui.hasScroll(i[0], "left") ? 0 : n.sizeDiff.height, u = s ? 0 : n.sizeDiff.width, a = { width: n.size.width - u, height: n.size.height - o }, f = parseInt(n.element.css("left"), 10) + (n.position.left - n.originalPosition.left) || null, l = parseInt(n.element.css("top"), 10) + (n.position.top - n.originalPosition.top) || null; n.element.animate(e.extend(a, l && f ? { top: l, left: f } : {}), { duration: r.animateDuration, easing: r.animateEasing, step: function () { var r = { width: parseInt(n.element.css("width"), 10), height: parseInt(n.element.css("height"), 10), top: parseInt(n.element.css("top"), 10), left: parseInt(n.element.css("left"), 10) }; i && i.length && e(i[0]).css({ width: r.width, height: r.height }), n._updateCache(r), n._propagate("resize", t) } }) } }), e.ui.plugin.add("resizable", "containment", { start: function () { var t, r, i, s, o, u, a, f = e(this).data("ui-resizable"), l = f.options, c = f.element, h = l.containment, p = h instanceof e ? h.get(0) : /parent/.test(h) ? c.parent().get(0) : h; if (!p) return; f.containerElement = e(p), /document/.test(h) || h === document ? (f.containerOffset = { left: 0, top: 0 }, f.containerPosition = { left: 0, top: 0 }, f.parentData = { element: e(document), left: 0, top: 0, width: e(document).width(), height: e(document).height() || document.body.parentNode.scrollHeight }) : (t = e(p), r = [], e(["Top", "Right", "Left", "Bottom"]).each(function (e, i) { r[e] = n(t.css("padding" + i)) }), f.containerOffset = t.offset(), f.containerPosition = t.position(), f.containerSize = { height: t.innerHeight() - r[3], width: t.innerWidth() - r[1] }, i = f.containerOffset, s = f.containerSize.height, o = f.containerSize.width, u = e.ui.hasScroll(p, "left") ? p.scrollWidth : o, a = e.ui.hasScroll(p) ? p.scrollHeight : s, f.parentData = { element: p, left: i.left, top: i.top, width: u, height: a }) }, resize: function (t) { var n, r, i, s, o = e(this).data("ui-resizable"), u = o.options, a = o.containerOffset, f = o.position, l = o._aspectRatio || t.shiftKey, c = { top: 0, left: 0 }, h = o.containerElement; h[0] !== document && /static/.test(h.css("position")) && (c = a), f.left < (o._helper ? a.left : 0) && (o.size.width = o.size.width + (o._helper ? o.position.left - a.left : o.position.left - c.left), l && (o.size.height = o.size.width / o.aspectRatio), o.position.left = u.helper ? a.left : 0), f.top < (o._helper ? a.top : 0) && (o.size.height = o.size.height + (o._helper ? o.position.top - a.top : o.position.top), l && (o.size.width = o.size.height * o.aspectRatio), o.position.top = o._helper ? a.top : 0), o.offset.left = o.parentData.left + o.position.left, o.offset.top = o.parentData.top + o.position.top, n = Math.abs((o._helper ? o.offset.left - c.left : o.offset.left - c.left) + o.sizeDiff.width), r = Math.abs((o._helper ? o.offset.top - c.top : o.offset.top - a.top) + o.sizeDiff.height), i = o.containerElement.get(0) === o.element.parent().get(0), s = /relative|absolute/.test(o.containerElement.css("position")), i && s && (n -= o.parentData.left), n + o.size.width >= o.parentData.width && (o.size.width = o.parentData.width - n, l && (o.size.height = o.size.width / o.aspectRatio)), r + o.size.height >= o.parentData.height && (o.size.height = o.parentData.height - r, l && (o.size.width = o.size.height * o.aspectRatio)) }, stop: function () { var t = e(this).data("ui-resizable"), n = t.options, r = t.containerOffset, i = t.containerPosition, s = t.containerElement, o = e(t.helper), u = o.offset(), a = o.outerWidth() - t.sizeDiff.width, f = o.outerHeight() - t.sizeDiff.height; t._helper && !n.animate && /relative/.test(s.css("position")) && e(this).css({ left: u.left - i.left - r.left, width: a, height: f }), t._helper && !n.animate && /static/.test(s.css("position")) && e(this).css({ left: u.left - i.left - r.left, width: a, height: f }) } }), e.ui.plugin.add("resizable", "alsoResize", { start: function () { var t = e(this).data("ui-resizable"), n = t.options, r = function (t) { e(t).each(function () { var t = e(this); t.data("ui-resizable-alsoresize", { width: parseInt(t.width(), 10), height: parseInt(t.height(), 10), left: parseInt(t.css("left"), 10), top: parseInt(t.css("top"), 10) }) }) }; typeof n.alsoResize == "object" && !n.alsoResize.parentNode ? n.alsoResize.length ? (n.alsoResize = n.alsoResize[0], r(n.alsoResize)) : e.each(n.alsoResize, function (e) { r(e) }) : r(n.alsoResize) }, resize: function (t, n) { var r = e(this).data("ui-resizable"), i = r.options, s = r.originalSize, o = r.originalPosition, u = { height: r.size.height - s.height || 0, width: r.size.width - s.width || 0, top: r.position.top - o.top || 0, left: r.position.left - o.left || 0 }, a = function (t, r) { e(t).each(function () { var t = e(this), i = e(this).data("ui-resizable-alsoresize"), s = {}, o = r && r.length ? r : t.parents(n.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"]; e.each(o, function (e, t) { var n = (i[t] || 0) + (u[t] || 0); n && n >= 0 && (s[t] = n || null) }), t.css(s) }) }; typeof i.alsoResize == "object" && !i.alsoResize.nodeType ? e.each(i.alsoResize, function (e, t) { a(e, t) }) : a(i.alsoResize) }, stop: function () { e(this).removeData("resizable-alsoresize") } }), e.ui.plugin.add("resizable", "ghost", { start: function () { var t = e(this).data("ui-resizable"), n = t.options, r = t.size; t.ghost = t.originalElement.clone(), t.ghost.css({ opacity: .25, display: "block", position: "relative", height: r.height, width: r.width, margin: 0, left: 0, top: 0 }).addClass("ui-resizable-ghost").addClass(typeof n.ghost == "string" ? n.ghost : ""), t.ghost.appendTo(t.helper) }, resize: function () { var t = e(this).data("ui-resizable"); t.ghost && t.ghost.css({ position: "relative", height: t.size.height, width: t.size.width }) }, stop: function () { var t = e(this).data("ui-resizable"); t.ghost && t.helper && t.helper.get(0).removeChild(t.ghost.get(0)) } }), e.ui.plugin.add("resizable", "grid", { resize: function () { var t = e(this).data("ui-resizable"), n = t.options, r = t.size, i = t.originalSize, s = t.originalPosition, o = t.axis, u = typeof n.grid == "number" ? [n.grid, n.grid] : n.grid, a = u[0] || 1, f = u[1] || 1, l = Math.round((r.width - i.width) / a) * a, c = Math.round((r.height - i.height) / f) * f, h = i.width + l, p = i.height + c, d = n.maxWidth && n.maxWidth < h, v = n.maxHeight && n.maxHeight < p, m = n.minWidth && n.minWidth > h, g = n.minHeight && n.minHeight > p; n.grid = u, m && (h += a), g && (p += f), d && (h -= a), v && (p -= f), /^(se|s|e)$/.test(o) ? (t.size.width = h, t.size.height = p) : /^(ne)$/.test(o) ? (t.size.width = h, t.size.height = p, t.position.top = s.top - c) : /^(sw)$/.test(o) ? (t.size.width = h, t.size.height = p, t.position.left = s.left - l) : (t.size.width = h, t.size.height = p, t.position.top = s.top - c, t.position.left = s.left - l) } }) })(jQuery); /*! * jQuery corner plugin: simple corner rounding * Examples and documentation at: http://jquery.malsup.com/corner/ * version 2.13 (19-FEB-2013) * Requires jQuery v1.3.2 or later * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * Authors: Dave Methvin and Mike Alsup */ /** * corner() takes a single string argument: $('#myDiv').corner("effect corners width") * * effect: name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). * corners: one or more of: top, bottom, tr, tl, br, or bl. (default is all corners) * width: width of the effect; in the case of rounded corners this is the radius. * specify this value using the px suffix such as 10px (yes, it must be pixels). */ ; (function ($) { var msie = /MSIE/.test(navigator.userAgent); var style = document.createElement('div').style, moz = style['MozBorderRadius'] !== undefined, webkit = style['WebkitBorderRadius'] !== undefined, radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined, mode = document.documentMode || 0, noBottomFold = msie && (!mode || mode < 8), expr = msie && (function () { var div = document.createElement('div'); try { div.style.setExpression('width', '0+0'); div.style.removeExpression('width'); } catch (e) { return false; } return true; })(); $.support = $.support || {}; $.support.borderRadius = moz || webkit || radius; // so you can do: if (!$.support.borderRadius) $('#myDiv').corner(); function sz(el, p) { return parseInt($.css(el, p), 10) || 0; } function hex2(s) { s = parseInt(s, 10).toString(16); return (s.length < 2) ? '0' + s : s; } function gpc(node) { while (node) { var v = $.css(node, 'backgroundColor'), rgb; if (v && v != 'transparent' && v != 'rgba(0, 0, 0, 0)') { if (v.indexOf('rgb') >= 0) { rgb = v.match(/\d+/g); return '#' + hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]); } return v; } if (node.nodeName.toLowerCase() == 'html') break; node = node.parentNode; // keep walking if transparent } return '#ffffff'; } function getWidth(fx, i, width) { switch (fx) { case 'round': return Math.round(width * (1 - Math.cos(Math.asin(i / width)))); case 'cool': return Math.round(width * (1 + Math.cos(Math.asin(i / width)))); case 'sharp': return width - i; case 'bite': return Math.round(width * (Math.cos(Math.asin((width - i - 1) / width)))); case 'slide': return Math.round(width * (Math.atan2(i, width / i))); case 'jut': return Math.round(width * (Math.atan2(width, (width - i - 1)))); case 'curl': return Math.round(width * (Math.atan(i))); case 'tear': return Math.round(width * (Math.cos(i))); case 'wicked': return Math.round(width * (Math.tan(i))); case 'long': return Math.round(width * (Math.sqrt(i))); case 'sculpt': return Math.round(width * (Math.log((width - i - 1), width))); case 'dogfold': case 'dog': return (i & 1) ? (i + 1) : width; case 'dog2': return (i & 2) ? (i + 1) : width; case 'dog3': return (i & 3) ? (i + 1) : width; case 'fray': return (i % 2) * width; case 'notch': return width; case 'bevelfold': case 'bevel': return i + 1; case 'steep': return i / 2 + 1; case 'invsteep': return (width - i) / 2 + 1; } } $.fn.corner = function (options) { // in 1.3+ we can fix mistakes with the ready state if (this.length === 0) { if (!$.isReady && this.selector) { var s = this.selector, c = this.context; $(function () { $(s, c).corner(options); }); } return this; } return this.each(function (index) { var $this = $(this), // meta values override options o = [$this.attr($.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase(), keep = /keep/.test(o), // keep borders? cc = ((o.match(/cc:(#[0-9a-f]+)/) || [])[1]), // corner color sc = ((o.match(/sc:(#[0-9a-f]+)/) || [])[1]), // strip color width = parseInt((o.match(/(\d+)px/) || [])[1], 10) || 10, // corner width re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog|invsteep|steep/, fx = ((o.match(re) || ['round'])[0]), fold = /dogfold|bevelfold/.test(o), edges = { T: 0, B: 1 }, opts = { TL: /top|tl|left/.test(o), TR: /top|tr|right/.test(o), BL: /bottom|bl|left/.test(o), BR: /bottom|br|right/.test(o) }, // vars used in func later strip, pad, cssHeight, j, bot, d, ds, bw, i, w, e, c, common, $horz; if (!opts.TL && !opts.TR && !opts.BL && !opts.BR) opts = { TL: 1, TR: 1, BL: 1, BR: 1 }; // support native rounding if ($.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) { if (opts.TL) $this.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px'); if (opts.TR) $this.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px'); if (opts.BL) $this.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px'); if (opts.BR) $this.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px'); return; } strip = document.createElement('div'); $(strip).css({ overflow: 'hidden', height: '1px', minHeight: '1px', fontSize: '1px', backgroundColor: sc || 'transparent', borderStyle: 'solid' }); pad = { T: parseInt($.css(this, 'paddingTop'), 10) || 0, R: parseInt($.css(this, 'paddingRight'), 10) || 0, B: parseInt($.css(this, 'paddingBottom'), 10) || 0, L: parseInt($.css(this, 'paddingLeft'), 10) || 0 }; if (typeof this.style.zoom !== undefined) this.style.zoom = 1; // force 'hasLayout' in IE if (!keep) this.style.border = 'none'; strip.style.borderColor = cc || gpc(this.parentNode); cssHeight = $(this).outerHeight(); for (j in edges) { bot = edges[j]; // only add stips if needed if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) { strip.style.borderStyle = 'none ' + (opts[j + 'R'] ? 'solid' : 'none') + ' none ' + (opts[j + 'L'] ? 'solid' : 'none'); d = document.createElement('div'); $(d).addClass('jquery-corner'); ds = d.style; bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild); if (bot && cssHeight != 'auto') { if ($.css(this, 'position') == 'static') this.style.position = 'relative'; ds.position = 'absolute'; ds.bottom = ds.left = ds.padding = ds.margin = '0'; if (expr) ds.setExpression('width', 'this.parentNode.offsetWidth'); else ds.width = '100%'; } else if (!bot && msie) { if ($.css(this, 'position') == 'static') this.style.position = 'relative'; ds.position = 'absolute'; ds.top = ds.left = ds.right = ds.padding = ds.margin = '0'; // fix ie6 problem when blocked element has a border width if (expr) { bw = sz(this, 'borderLeftWidth') + sz(this, 'borderRightWidth'); ds.setExpression('width', 'this.parentNode.offsetWidth - ' + bw + '+ "px"'); } else ds.width = '100%'; } else { ds.position = 'relative'; ds.margin = !bot ? '-' + pad.T + 'px -' + pad.R + 'px ' + (pad.T - width) + 'px -' + pad.L + 'px' : (pad.B - width) + 'px -' + pad.R + 'px -' + pad.B + 'px -' + pad.L + 'px'; } for (i = 0; i < width; i++) { w = Math.max(0, getWidth(fx, i, width)); e = strip.cloneNode(false); e.style.borderWidth = '0 ' + (opts[j + 'R'] ? w : 0) + 'px 0 ' + (opts[j + 'L'] ? w : 0) + 'px'; bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild); } if (fold && $.support.boxModel) { if (bot && noBottomFold) continue; for (c in opts) { if (!opts[c]) continue; if (bot && (c == 'TL' || c == 'TR')) continue; if (!bot && (c == 'BL' || c == 'BR')) continue; common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor }; $horz = $('
').css(common).css({ width: width + 'px', height: '1px' }); switch (c) { case 'TL': $horz.css({ bottom: 0, left: 0 }); break; case 'TR': $horz.css({ bottom: 0, right: 0 }); break; case 'BL': $horz.css({ top: 0, left: 0 }); break; case 'BR': $horz.css({ top: 0, right: 0 }); break; } d.appendChild($horz[0]); var $vert = $('
').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' }); switch (c) { case 'TL': $vert.css({ left: width }); break; case 'TR': $vert.css({ right: width }); break; case 'BL': $vert.css({ left: width }); break; case 'BR': $vert.css({ right: width }); break; } d.appendChild($vert[0]); } } } } }); }; $.fn.uncorner = function () { if (radius || moz || webkit) this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0); $('div.jquery-corner', this).remove(); return this; }; // expose options $.fn.corner.defaults = { useNative: true, // true if plugin should attempt to use native browser support for border radius rounding metaAttr: 'data-corner' // name of meta attribute to use for options }; })(jQuery); /* * jQuery UI Touch Punch 0.2.2 * * Copyright 2011, Dave Furfero * Dual licensed under the MIT or GPL Version 2 licenses. * * Depends: * jquery.ui.widget.js * jquery.ui.mouse.js */ (function (b) { b.support.touch = "ontouchend" in document; if (!b.support.touch) { return; } var c = b.ui.mouse.prototype, e = c._mouseInit, a; function d(g, h) { if (g.originalEvent.touches.length > 1) { return; } g.preventDefault(); var i = g.originalEvent.changedTouches[0], f = document.createEvent("MouseEvents"); f.initMouseEvent(h, true, true, window, 1, i.screenX, i.screenY, i.clientX, i.clientY, false, false, false, false, 0, null); g.target.dispatchEvent(f); } c._touchStart = function (g) { var f = this; if (a || !f._mouseCapture(g.originalEvent.changedTouches[0])) { return; } a = true; f._touchMoved = false; d(g, "mouseover"); d(g, "mousemove"); d(g, "mousedown"); }; c._touchMove = function (f) { if (!a) { return; } this._touchMoved = true; d(f, "mousemove"); }; c._touchEnd = function (f) { if (!a) { return; } d(f, "mouseup"); d(f, "mouseout"); if (!this._touchMoved) { d(f, "click"); } a = false; }; c._mouseInit = function () { var f = this; f.element.bind("touchstart", b.proxy(f, "_touchStart")).bind("touchmove", b.proxy(f, "_touchMove")).bind("touchend", b.proxy(f, "_touchEnd")); e.call(f); }; })(jQuery); //fgnass.github.com/spin.js#v1.2.5 (function (a, b, c) { function g(a, c) { var d = b.createElement(a || "div"), e; for (e in c) d[e] = c[e]; return d } function h(a) { for (var b = 1, c = arguments.length; b < c; b++) a.appendChild(arguments[b]); return a } function j(a, b, c, d) { var g = ["opacity", b, ~~(a * 100), c, d].join("-"), h = .01 + c / d * 100, j = Math.max(1 - (1 - a) / b * (100 - h), a), k = f.substring(0, f.indexOf("Animation")).toLowerCase(), l = k && "-" + k + "-" || ""; return e[g] || (i.insertRule("@" + l + "keyframes " + g + "{" + "0%{opacity:" + j + "}" + h + "%{opacity:" + a + "}" + (h + .01) + "%{opacity:1}" + (h + b) % 100 + "%{opacity:" + a + "}" + "100%{opacity:" + j + "}" + "}", 0), e[g] = 1), g } function k(a, b) { var e = a.style, f, g; if (e[b] !== c) return b; b = b.charAt(0).toUpperCase() + b.slice(1); for (g = 0; g < d.length; g++) { f = d[g] + b; if (e[f] !== c) return f } } function l(a, b) { for (var c in b) a.style[k(a, c) || c] = b[c]; return a } function m(a) { for (var b = 1; b < arguments.length; b++) { var d = arguments[b]; for (var e in d) a[e] === c && (a[e] = d[e]) } return a } function n(a) { var b = { x: a.offsetLeft, y: a.offsetTop }; while (a = a.offsetParent) b.x += a.offsetLeft, b.y += a.offsetTop; return b } var d = ["webkit", "Moz", "ms", "O"], e = {}, f, i = function () { var a = g("style"); return h(b.getElementsByTagName("head")[0], a), a.sheet || a.styleSheet }(), o = { lines: 12, length: 7, width: 5, radius: 10, rotate: 0, color: "#000", speed: 1, trail: 100, opacity: .25, fps: 20, zIndex: 2e9, className: "spinner", top: "auto", left: "auto" }, p = function q(a) { if (!this.spin) return new q(a); this.opts = m(a || {}, q.defaults, o) }; p.defaults = {}, m(p.prototype, { spin: function (a) { this.stop(); var b = this, c = b.opts, d = b.el = l(g(0, { className: c.className }), { position: "relative", zIndex: c.zIndex }), e = c.radius + c.length + c.width, h, i; a && (a.insertBefore(d, a.firstChild || null), i = n(a), h = n(d), l(d, { left: (c.left == "auto" ? i.x - h.x + (a.offsetWidth >> 1) : c.left + e) + "px", top: (c.top == "auto" ? i.y - h.y + (a.offsetHeight >> 1) : c.top + e) + "px" })), d.setAttribute("aria-role", "progressbar"), b.lines(d, b.opts); if (!f) { var j = 0, k = c.fps, m = k / c.speed, o = (1 - c.opacity) / (m * c.trail / 100), p = m / c.lines; !function q() { j++; for (var a = c.lines; a; a--) { var e = Math.max(1 - (j + a * p) % m * o, c.opacity); b.opacity(d, c.lines - a, e, c) } b.timeout = b.el && setTimeout(q, ~~(1e3 / k)) }() } return b }, stop: function () { var a = this.el; return a && (clearTimeout(this.timeout), a.parentNode && a.parentNode.removeChild(a), this.el = c), this }, lines: function (a, b) { function e(a, d) { return l(g(), { position: "absolute", width: b.length + b.width + "px", height: b.width + "px", background: a, boxShadow: d, transformOrigin: "left", transform: "rotate(" + ~~(360 / b.lines * c + b.rotate) + "deg) translate(" + b.radius + "px" + ",0)", borderRadius: (b.width >> 1) + "px" }) } var c = 0, d; for (; c < b.lines; c++) d = l(g(), { position: "absolute", top: 1 + ~(b.width / 2) + "px", transform: b.hwaccel ? "translate3d(0,0,0)" : "", opacity: b.opacity, animation: f && j(b.opacity, b.trail, c, b.lines) + " " + 1 / b.speed + "s linear infinite" }), b.shadow && h(d, l(e("#000", "0 0 4px #000"), { top: "2px" })), h(a, h(d, e(b.color, "0 0 1px rgba(0,0,0,.1)"))); return a }, opacity: function (a, b, c) { b < a.childNodes.length && (a.childNodes[b].style.opacity = c) } }), !function () { function a(a, b) { return g("<" + a + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', b) } var b = l(g("group"), { behavior: "url(#default#VML)" }); !k(b, "transform") && b.adj ? (i.addRule(".spin-vml", "behavior:url(#default#VML)"), p.prototype.lines = function (b, c) { function f() { return l(a("group", { coordsize: e + " " + e, coordorigin: -d + " " + -d }), { width: e, height: e }) } function k(b, e, g) { h(i, h(l(f(), { rotation: 360 / c.lines * b + "deg", left: ~~e }), h(l(a("roundrect", { arcsize: 1 }), { width: d, height: c.width, left: c.radius, top: -c.width >> 1, filter: g }), a("fill", { color: c.color, opacity: c.opacity }), a("stroke", { opacity: 0 })))) } var d = c.length + c.width, e = 2 * d, g = -(c.width + c.length) * 2 + "px", i = l(f(), { position: "absolute", top: g, left: g }), j; if (c.shadow) for (j = 1; j <= c.lines; j++) k(j, -2, "progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)"); for (j = 1; j <= c.lines; j++) k(j); return h(b, i) }, p.prototype.opacity = function (a, b, c, d) { var e = a.firstChild; d = d.shadow && d.lines || 0, e && b + d < e.childNodes.length && (e = e.childNodes[b + d], e = e && e.firstChild, e = e && e.firstChild, e && (e.opacity = c)) }) : f = k(b, "animation") }(), a.Spinner = p })(window, document); var Mouse = { x: 0, y: 0, refresh: function (e) { if (e && !this.down && !jQuery(e.target).hasClass("flowpaper_zoomSlider")) return; var posx = 0, posy = 0; if (!e) e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop } this.x = posx; this.y = posy } }; var mouseMoveHandler = document.onmousemove || function () { }; document.onmousemove = function (e) { if (!e) { e = window.event; } if (e && e.which == 1) Mouse.down = true; Mouse.refresh(e) }; var MPosition = { get: function (obj) { var curleft = curtop = 0; if (obj.offsetParent) { do { curleft += obj.offsetLeft; curtop += obj.offsetTop } while (obj = obj.offsetParent) } return [curleft, curtop] } }; var Slider = function (wrapper, options) { if (typeof wrapper == "string") wrapper = document.getElementById(wrapper); if (!wrapper) return; var handle = wrapper.getElementsByTagName("div")[0]; if (!handle || handle.className.search(/(^|\s)flowpaper_handle(\s|$)/) == -1) return; this.init(wrapper, handle, options || {}); this.setup() }; Slider.prototype = { init: function (wrapper, handle, options) { this.wrapper = wrapper; this.handle = handle; this.options = options; this.value = { current: options.value || 0, target: options.value || 0, prev: -1 }; this.disabled = options.disabled || false; this.steps = options.steps || 0; this.snapping = options.snapping || false; this.speed = options.speed || 5; this.callback = options.callback || null; this.animation_callback = options.animation_callback || null; this.bounds = { pleft: options.pleft || 0, left: 0, pright: -(options.pright || 0), right: 0, width: 0, diff: 0 }; this.offset = { wrapper: 0, mouse: 0, target: 0, current: 0, prev: -9999 }; this.dragging = false; this.tapping = false }, setup: function () { var self = this; this.wrapper.onselectstart = function () { return false }; this.handle.onmousedown = function (e) { self.preventDefaults(e, true); this.focus(); self.handleMouseDownHandler(e) }; this.wrapper.onmousedown = function (e) { self.preventDefaults(e); self.wrapperMouseDownHandler(e) }; var mouseUpHandler = document.onmouseup || function () { }; if (document.addEventListener) document.addEventListener("mouseup", function (e) { if (self.dragging) { mouseUpHandler(e); self.preventDefaults(e); self.documentMouseUpHandler(e) } }); else document.onmouseup = function (e) { if (self.dragging) { mouseUpHandler(e); self.preventDefaults(e); self.documentMouseUpHandler(e) } }; var resizeHandler = document.onresize || function () { }; if (1 == 2) window.onresize = function (e) { resizeHandler(e); self.setWrapperOffset(); self.setBounds() }; this.setWrapperOffset(); if (!this.bounds.pleft && !this.bounds.pright) { this.bounds.pleft = MPosition.get(this.handle)[0] - this.offset.wrapper; this.bounds.pright = -this.bounds.pleft } this.setBounds(); this.setSteps(); this.interval = setInterval(function () { self.animate() }, 100); self.animate(false, true) }, setWrapperOffset: function () { this.offset.wrapper = MPosition.get(this.wrapper)[0] }, setBounds: function () { this.bounds.left = this.bounds.pleft; this.bounds.right = this.bounds.pright + this.wrapper.offsetWidth; this.bounds.width = this.bounds.right - this.bounds.left; this.bounds.diff = this.bounds.width - this.handle.offsetWidth }, setSteps: function () { if (this.steps > 1) { this.stepsRatio = []; for (var i = 0; i <= this.steps - 1; i++) this.stepsRatio[i] = i / (this.steps - 1) } }, disable: function () { this.disabled = true; this.handle.className += " disabled" }, enable: function () { this.disabled = false; this.handle.className = this.handle.className.replace(/\s?disabled/g, "") }, handleMouseDownHandler: function (e) { if (Mouse) { Mouse.down = true; Mouse.refresh(e) } var self = this; this.startDrag(e); this.cancelEvent(e) }, wrapperMouseDownHandler: function (e) { this.startTap() }, documentMouseUpHandler: function (e) { this.stopDrag(); this.stopTap(); if (Mouse) Mouse.down = false }, startTap: function (target) { if (this.disabled) return; if (target === undefined) target = Mouse.x - this.offset.wrapper - this.handle.offsetWidth / 2; this.setOffsetTarget(target); this.tapping = true }, stopTap: function () { if (this.disabled || !this.tapping) return; this.setOffsetTarget(this.offset.current); this.tapping = false; this.result() }, startDrag: function (e) { if (!e) e = window.event; if (this.disabled) return; this.offset.mouse = Mouse.x - MPosition.get(this.handle)[0]; this.dragging = true; if (e.preventDefault) e.preventDefault() }, stopDrag: function () { if (this.disabled || !this.dragging) return; this.dragging = false; this.result() }, feedback: function () { var value = this.value.current; if (this.steps > 1 && this.snapping) value = this.getClosestStep(value); if (value != this.value.prev) { if (typeof this.animation_callback == "function") this.animation_callback(value); this.value.prev = value } }, result: function () { var value = this.value.target; if (this.steps > 1) value = this.getClosestStep(value); if (typeof this.callback == "function") this.callback(value) }, animate: function (onMove, first) { if (onMove && !this.dragging) return; if (this.dragging) this.setOffsetTarget(Mouse.x - this.offset.mouse - this.offset.wrapper); this.value.target = Math.max(this.value.target, 0); this.value.target = Math.min(this.value.target, 1); this.offset.target = this.getOffsetByRatio(this.value.target); if (!this.dragging && !this.tapping || this.snapping) if (this.steps > 1) this.setValueTarget(this.getClosestStep(this.value.target)); if (this.dragging || first) this.value.current = this.value.target; this.slide(); this.show(); this.feedback() }, slide: function () { if (this.value.target > this.value.current) this.value.current += Math.min(this.value.target - this.value.current, this.speed / 100); else if (this.value.target < this.value.current) this.value.current -= Math.min(this.value.current - this.value.target, this.speed / 100); if (!this.snapping) this.offset.current = this.getOffsetByRatio(this.value.current); else this.offset.current = this.getOffsetByRatio(this.getClosestStep(this.value.current)) }, show: function () { if (this.offset.current != this.offset.prev) { this.handle.style.left = String(this.offset.current) + "px"; this.offset.prev = this.offset.current } }, setValue: function (value, snap) { this.setValueTarget(value); if (snap) this.value.current = this.value.target }, setValueTarget: function (value) { this.value.target = value; this.offset.target = this.getOffsetByRatio(value) }, setOffsetTarget: function (value) { this.offset.target = value; this.value.target = this.getRatioByOffset(value) }, getRatioByOffset: function (offset) { return (offset - this.bounds.left) / this.bounds.diff }, getOffsetByRatio: function (ratio) { return Math.round(ratio * this.bounds.diff) + this.bounds.left }, getClosestStep: function (value) { var k = 0; var min = 1; for (var i = 0; i <= this.steps - 1; i++) if (Math.abs(this.stepsRatio[i] - value) < min) { min = Math.abs(this.stepsRatio[i] - value); k = i } return this.stepsRatio[k] }, preventDefaults: function (e, selection) { if (!e) e = window.event; if (e.preventDefault) e.preventDefault(); if (selection && document.selection) document.selection.empty() }, cancelEvent: function (e) { if (!e) e = window.event; if (e.stopPropagation) e.stopPropagation(); else e.cancelBubble = true } }; // Copyright 2006 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. document.createElement("canvas").getContext || (function () { var s = Math, j = s.round, F = s.sin, G = s.cos, V = s.abs, W = s.sqrt, k = 10, v = k / 2; function X() { return this.context_ || (this.context_ = new H(this)) } var L = Array.prototype.slice; function Y(b, a) { var c = L.call(arguments, 2); return function () { return b.apply(a, c.concat(L.call(arguments))) } } var M = { init: function (b) { if (/MSIE/.test(navigator.userAgent) && !window.opera) { var a = b || document; a.createElement("canvas"); a.attachEvent("onreadystatechange", Y(this.init_, this, a)) } }, init_: function (b) { b.namespaces.g_vml_ || b.namespaces.add("g_vml_", "urn:schemas-microsoft-com:vml", "#default#VML"); b.namespaces.g_o_ || b.namespaces.add("g_o_", "urn:schemas-microsoft-com:office:office", "#default#VML"); if (!b.styleSheets.ex_canvas_) { var a = b.createStyleSheet(); a.owningElement.id = "ex_canvas_"; a.cssText = "canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}" } var c = b.getElementsByTagName("canvas"), d = 0; for (; d < c.length; d++) this.initElement(c[d]) }, initElement: function (b) { if (!b.getContext) { b.getContext = X; b.innerHTML = ""; b.attachEvent("onpropertychange", Z); b.attachEvent("onresize", $); var a = b.attributes; if (a.width && a.width.specified) b.style.width = a.width.nodeValue + "px"; else b.width = b.clientWidth; if (a.height && a.height.specified) b.style.height = a.height.nodeValue + "px"; else b.height = b.clientHeight } return b } }; function Z(b) { var a = b.srcElement; switch (b.propertyName) { case "width": a.style.width = a.attributes.width.nodeValue + "px"; a.getContext().clearRect(); break; case "height": a.style.height = a.attributes.height.nodeValue + "px"; a.getContext().clearRect(); break } } function $(b) { var a = b.srcElement; if (a.firstChild) { a.firstChild.style.width = a.clientWidth + "px"; a.firstChild.style.height = a.clientHeight + "px" } } M.init(); var N = [], B = 0; for (; B < 16; B++) { var C = 0; for (; C < 16; C++) N[B * 16 + C] = B.toString(16) + C.toString(16) } function I() { return [[1, 0, 0], [0, 1, 0], [0, 0, 1]] } function y(b, a) { var c = I(), d = 0; for (; d < 3; d++) { var f = 0; for (; f < 3; f++) { var h = 0, g = 0; for (; g < 3; g++) h += b[d][g] * a[g][f]; c[d][f] = h } } return c } function O(b, a) { a.fillStyle = b.fillStyle; a.lineCap = b.lineCap; a.lineJoin = b.lineJoin; a.lineWidth = b.lineWidth; a.miterLimit = b.miterLimit; a.shadowBlur = b.shadowBlur; a.shadowColor = b.shadowColor; a.shadowOffsetX = b.shadowOffsetX; a.shadowOffsetY = b.shadowOffsetY; a.strokeStyle = b.strokeStyle; a.globalAlpha = b.globalAlpha; a.arcScaleX_ = b.arcScaleX_; a.arcScaleY_ = b.arcScaleY_; a.lineScale_ = b.lineScale_ } function P(b) { var a, c = 1; b = String(b); if (b.substring(0, 3) == "rgb") { var d = b.indexOf("(", 3), f = b.indexOf(")", d + 1), h = b.substring(d + 1, f).split(","); a = "#"; var g = 0; for (; g < 3; g++) a += N[Number(h[g])]; if (h.length == 4 && b.substr(3, 1) == "a") c = h[3] } else a = b; return { color: a, alpha: c } } function aa(b) { switch (b) { case "butt": return "flat"; case "round": return "round"; case "square": default: return "square" } } function H(b) { this.m_ = I(); this.mStack_ = []; this.aStack_ = []; this.currentPath_ = []; this.fillStyle = this.strokeStyle = "#000"; this.lineWidth = 1; this.lineJoin = "miter"; this.lineCap = "butt"; this.miterLimit = k * 1; this.globalAlpha = 1; this.canvas = b; var a = b.ownerDocument.createElement("div"); a.style.width = b.clientWidth + "px"; a.style.height = b.clientHeight + "px"; a.style.overflow = "hidden"; a.style.position = "absolute"; b.appendChild(a); this.element_ = a; this.lineScale_ = this.arcScaleY_ = this.arcScaleX_ = 1 } var i = H.prototype; i.clearRect = function () { this.element_.innerHTML = "" }; i.beginPath = function () { this.currentPath_ = [] }; i.moveTo = function (b, a) { var c = this.getCoords_(b, a); this.currentPath_.push({ type: "moveTo", x: c.x, y: c.y }); this.currentX_ = c.x; this.currentY_ = c.y }; i.lineTo = function (b, a) { var c = this.getCoords_(b, a); this.currentPath_.push({ type: "lineTo", x: c.x, y: c.y }); this.currentX_ = c.x; this.currentY_ = c.y }; i.bezierCurveTo = function (b, a, c, d, f, h) { var g = this.getCoords_(f, h), l = this.getCoords_(b, a), e = this.getCoords_(c, d); Q(this, l, e, g) }; function Q(b, a, c, d) { b.currentPath_.push({ type: "bezierCurveTo", cp1x: a.x, cp1y: a.y, cp2x: c.x, cp2y: c.y, x: d.x, y: d.y }); b.currentX_ = d.x; b.currentY_ = d.y } i.quadraticCurveTo = function (b, a, c, d) { var f = this.getCoords_(b, a), h = this.getCoords_(c, d), g = { x: this.currentX_ + 0.6666666666666666 * (f.x - this.currentX_), y: this.currentY_ + 0.6666666666666666 * (f.y - this.currentY_) }; Q(this, g, { x: g.x + (h.x - this.currentX_) / 3, y: g.y + (h.y - this.currentY_) / 3 }, h) }; i.arc = function (b, a, c, d, f, h) { c *= k; var g = h ? "at" : "wa", l = b + G(d) * c - v, e = a + F(d) * c - v, m = b + G(f) * c - v, r = a + F(f) * c - v; if (l == m && !h) l += 0.125; var n = this.getCoords_(b, a), o = this.getCoords_(l, e), q = this.getCoords_(m, r); this.currentPath_.push({ type: g, x: n.x, y: n.y, radius: c, xStart: o.x, yStart: o.y, xEnd: q.x, yEnd: q.y }) }; i.rect = function (b, a, c, d) { this.moveTo(b, a); this.lineTo(b + c, a); this.lineTo(b + c, a + d); this.lineTo(b, a + d); this.closePath() }; i.strokeRect = function (b, a, c, d) { var f = this.currentPath_; this.beginPath(); this.moveTo(b, a); this.lineTo(b + c, a); this.lineTo(b + c, a + d); this.lineTo(b, a + d); this.closePath(); this.stroke(); this.currentPath_ = f }; i.fillRect = function (b, a, c, d) { var f = this.currentPath_; this.beginPath(); this.moveTo(b, a); this.lineTo(b + c, a); this.lineTo(b + c, a + d); this.lineTo(b, a + d); this.closePath(); this.fill(); this.currentPath_ = f }; i.createLinearGradient = function (b, a, c, d) { var f = new D("gradient"); f.x0_ = b; f.y0_ = a; f.x1_ = c; f.y1_ = d; return f }; i.createRadialGradient = function (b, a, c, d, f, h) { var g = new D("gradientradial"); g.x0_ = b; g.y0_ = a; g.r0_ = c; g.x1_ = d; g.y1_ = f; g.r1_ = h; return g }; i.drawImage = function (b) { var a, c, d, f, h, g, l, e, m = b.runtimeStyle.width, r = b.runtimeStyle.height; b.runtimeStyle.width = "auto"; b.runtimeStyle.height = "auto"; var n = b.width, o = b.height; b.runtimeStyle.width = m; b.runtimeStyle.height = r; if (arguments.length == 3) { a = arguments[1]; c = arguments[2]; h = g = 0; l = d = n; e = f = o } else if (arguments.length == 5) { a = arguments[1]; c = arguments[2]; d = arguments[3]; f = arguments[4]; h = g = 0; l = n; e = o } else if (arguments.length == 9) { h = arguments[1]; g = arguments[2]; l = arguments[3]; e = arguments[4]; a = arguments[5]; c = arguments[6]; d = arguments[7]; f = arguments[8] } else throw Error("Invalid number of arguments"); var q = this.getCoords_(a, c), t = []; t.push(" ', '", ""); this.element_.insertAdjacentHTML("BeforeEnd", t.join("")) }; i.stroke = function (b) { var a = [], c = P(b ? this.fillStyle : this.strokeStyle), d = c.color, f = c.alpha * this.globalAlpha; a.push(" g.x) g.x = e.x; if (h.y == null || e.y < h.y) h.y = e.y; if (g.y == null || e.y > g.y) g.y = e.y } } a.push(' ">'); if (b) if (typeof this.fillStyle == "object") { var m = this.fillStyle, r = 0, n = { x: 0, y: 0 }, o = 0, q = 1; if (m.type_ == "gradient") { var t = m.x1_ / this.arcScaleX_, E = m.y1_ / this.arcScaleY_, p = this.getCoords_(m.x0_ / this.arcScaleX_, m.y0_ / this.arcScaleY_), z = this.getCoords_(t, E); r = Math.atan2(z.x - p.x, z.y - p.y) * 180 / Math.PI; if (r < 0) r += 360; if (r < 1.0E-6) r = 0 } else { var p = this.getCoords_(m.x0_, m.y0_), w = g.x - h.x, x = g.y - h.y; n = { x: (p.x - h.x) / w, y: (p.y - h.y) / x }; w /= this.arcScaleX_ * k; x /= this.arcScaleY_ * k; var R = s.max(w, x); o = 2 * m.r0_ / R; q = 2 * m.r1_ / R - o } var u = m.colors_; u.sort(function (ba, ca) { return ba.offset - ca.offset }); var J = u.length, da = u[0].color, ea = u[J - 1].color, fa = u[0].alpha * this.globalAlpha, ga = u[J - 1].alpha * this.globalAlpha, S = [], l = 0; for (; l < J; l++) { var T = u[l]; S.push(T.offset * q + o + " " + T.color) } a.push('') } else a.push(''); else { var K = this.lineScale_ * this.lineWidth; if (K < 1) f *= K; a.push("') } a.push(""); this.element_.insertAdjacentHTML("beforeEnd", a.join("")) }; i.fill = function () { this.stroke(true) }; i.closePath = function () { this.currentPath_.push({ type: "close" }) }; i.getCoords_ = function (b, a) { var c = this.m_; return { x: k * (b * c[0][0] + a * c[1][0] + c[2][0]) - v, y: k * (b * c[0][1] + a * c[1][1] + c[2][1]) - v } }; i.save = function () { var b = {}; O(this, b); this.aStack_.push(b); this.mStack_.push(this.m_); this.m_ = y(I(), this.m_) }; i.restore = function () { O(this.aStack_.pop(), this); this.m_ = this.mStack_.pop() }; function ha(b) { var a = 0; for (; a < 3; a++) { var c = 0; for (; c < 2; c++) if (!isFinite(b[a][c]) || isNaN(b[a][c])) return false } return true } function A(b, a, c) { if (!!ha(a)) { b.m_ = a; if (c) b.lineScale_ = W(V(a[0][0] * a[1][1] - a[0][1] * a[1][0])) } } i.translate = function (b, a) { A(this, y([[1, 0, 0], [0, 1, 0], [b, a, 1]], this.m_), false) }; i.rotate = function (b) { var a = G(b), c = F(b); A(this, y([[a, c, 0], [-c, a, 0], [0, 0, 1]], this.m_), false) }; i.scale = function (b, a) { this.arcScaleX_ *= b; this.arcScaleY_ *= a; A(this, y([[b, 0, 0], [0, a, 0], [0, 0, 1]], this.m_), true) }; i.transform = function (b, a, c, d, f, h) { A(this, y([[b, a, 0], [c, d, 0], [f, h, 1]], this.m_), true) }; i.setTransform = function (b, a, c, d, f, h) { A(this, [[b, a, 0], [c, d, 0], [f, h, 1]], true) }; i.clip = function () { }; i.arcTo = function () { }; i.createPattern = function () { return new U }; function D(b) { this.type_ = b; this.r1_ = this.y1_ = this.x1_ = this.r0_ = this.y0_ = this.x0_ = 0; this.colors_ = [] } D.prototype.addColorStop = function (b, a) { a = P(a); this.colors_.push({ offset: b, color: a.color, alpha: a.alpha }) }; function U() { } G_vmlCanvasManager = M; CanvasRenderingContext2D = H; CanvasGradient = D; CanvasPattern = U })(); (function ($) { $.transit = { version: "0.1.3", propertyMap: { marginLeft: "margin", marginRight: "margin", marginBottom: "margin", marginTop: "margin", paddingLeft: "padding", paddingRight: "padding", paddingBottom: "padding", paddingTop: "padding" }, enabled: true, useTransitionEnd: false }; var div = document.createElement("div"); var support = {}; function getVendorPropertyName(prop) { if (prop in div.style) return prop; var prefixes = ["Moz", "Webkit", "O", "ms"]; var prop_ = prop.charAt(0).toUpperCase() + prop.substr(1); if (prop in div.style) return prop; for (var i = 0; i < prefixes.length; ++i) { var vendorProp = prefixes[i] + prop_; if (vendorProp in div.style) return vendorProp } } function checkTransform3dSupport() { div.style[support.transform] = ""; div.style[support.transform] = "rotateY(90deg)"; return div.style[support.transform] !== "" } var isChrome = navigator.userAgent.toLowerCase().indexOf("chrome") > -1; support.transition = getVendorPropertyName("transition"); support.transitionDelay = getVendorPropertyName("transitionDelay"); support.transform = getVendorPropertyName("transform"); support.transformOrigin = getVendorPropertyName("transformOrigin"); support.transform3d = checkTransform3dSupport(); $.extend($.support, support); var eventNames = { "MozTransition": "transitionend", "OTransition": "oTransitionEnd", "WebkitTransition": "webkitTransitionEnd", "msTransition": "MSTransitionEnd" }; var transitionEnd = support.transitionEnd = eventNames[support.transition] || null; div = null; $.cssEase = { "_default": "ease", "in": "ease-in", "out": "ease-out", "in-out": "ease-in-out", "snap": "cubic-bezier(0,1,.5,1)" }; $.cssHooks.transform = { get: function (elem) { return $(elem).data("transform") }, set: function (elem, v) { var value = v; if (!(value instanceof Transform)) value = new Transform(value); if (window.eb && eb.browser.chrome) elem.style[support.transform] = value.toString(true); else elem.style[support.transform] = value.toString(); $(elem).data("transform", value) } }; $.cssHooks.transformOrigin = { get: function (elem) { return elem.style[support.transformOrigin] }, set: function (elem, value) { elem.style[support.transformOrigin] = value } }; $.cssHooks.transition = { get: function (elem) { return elem.style[support.transition] }, set: function (elem, value) { elem.style[support.transition] = value } }; registerCssHook("scale"); registerCssHook("translate"); registerCssHook("rotate"); registerCssHook("rotateX"); registerCssHook("rotateY"); registerCssHook("rotate3d"); registerCssHook("perspective"); registerCssHook("skewX"); registerCssHook("skewY"); registerCssHook("x", true); registerCssHook("y", true); function Transform(str) { if (typeof str === "string") this.parse(str); return this } Transform.prototype = { setFromString: function (prop, val) { var args = typeof val === "string" ? val.split(",") : val.constructor === Array ? val : [val]; args.unshift(prop); Transform.prototype.set.apply(this, args) }, set: function (prop) { var args = Array.prototype.slice.apply(arguments, [1]); if (this.setter[prop]) this.setter[prop].apply(this, args); else this[prop] = args.join(",") }, get: function (prop) { if (this.getter[prop]) return this.getter[prop].apply(this); else return this[prop] || 0 }, setter: { rotate: function (theta) { this.rotate = unit(theta, "deg") }, rotateX: function (theta) { this.rotateX = unit(theta, "deg") }, rotateY: function (theta) { this.rotateY = unit(theta, "deg") }, scale: function (x, y) { if (y === undefined) y = x; this.scale = x + "," + y }, skewX: function (x) { this.skewX = unit(x, "deg") }, skewY: function (y) { this.skewY = unit(y, "deg") }, perspective: function (dist) { this.perspective = unit(dist, "px") }, x: function (x) { this.set("translate", x, null) }, y: function (y) { this.set("translate", null, y) }, translate: function (x, y) { if (this._translateX === undefined) this._translateX = 0; if (this._translateY === undefined) this._translateY = 0; if (x !== null) this._translateX = unit(x, "px"); if (y !== null) this._translateY = unit(y, "px"); this.translate = this._translateX + "," + this._translateY } }, getter: { x: function () { return this._translateX || 0 }, y: function () { return this._translateY || 0 }, scale: function () { var s = (this.scale || "1,1").split(","); if (s[0]) s[0] = parseFloat(s[0]); if (s[1]) s[1] = parseFloat(s[1]); return s[0] === s[1] ? s[0] : s }, rotate3d: function () { var s = (this.rotate3d || "0,0,0,0deg").split(","); for (var i = 0; i <= 3; ++i) if (s[i]) s[i] = parseFloat(s[i]); if (s[3]) s[3] = unit(s[3], "deg"); return s } }, parse: function (str) { var self = this; str.replace(/([a-zA-Z0-9]+)\((.*?)\)/g, function (x, prop, val) { self.setFromString(prop, val) }) }, toString: function (use3d) { var re = []; for (var i in this) if (this.hasOwnProperty(i)) { if (!support.transform3d && (i === "rotateX" || i === "rotateY" || i === "perspective" || i === "transformOrigin")) continue; if (i[0] !== "_") if (use3d && i === "scale") re.push(i + "3d(" + this[i] + ",1)"); else if (use3d && i === "translate") re.push(i + "3d(" + this[i] + ",0)"); else re.push(i + "(" + this[i] + ")") } return re.join(" ") } }; function callOrQueue(self, queue, fn) { if (queue === true) self.queue(fn); else if (queue) self.queue(queue, fn); else fn() } function getProperties(props) { var re = []; $.each(props, function (key) { key = $.camelCase(key); key = $.transit.propertyMap[key] || key; key = uncamel(key); if ($.inArray(key, re) === -1) re.push(key) }); return re } function getTransition(properties, duration, easing, delay) { var props = getProperties(properties); if ($.cssEase[easing]) easing = $.cssEase[easing]; var attribs = "" + toMS(duration) + " " + easing; if (parseInt(delay, 10) > 0) attribs += " " + toMS(delay); var transitions = []; $.each(props, function (i, name) { transitions.push(name + " " + attribs) }); return transitions.join(", ") } $.fn.transition = $.fn.transit = function (properties, duration, easing, callback) { var self = this; var delay = 0; var queue = true; if (typeof duration === "function") { callback = duration; duration = undefined } if (typeof easing === "function") { callback = easing; easing = undefined } if (typeof properties.easing !== "undefined") { easing = properties.easing; delete properties.easing } if (typeof properties.duration !== "undefined") { duration = properties.duration; delete properties.duration } if (typeof properties.complete !== "undefined") { callback = properties.complete; delete properties.complete } if (typeof properties.queue !== "undefined") { queue = properties.queue; delete properties.queue } if (typeof properties.delay !== "undefined") { delay = properties.delay; delete properties.delay } if (typeof duration === "undefined") duration = $.fx.speeds._default; if (typeof easing === "undefined") easing = $.cssEase._default; duration = toMS(duration); var transitionValue = getTransition(properties, duration, easing, delay); var work = $.transit.enabled && support.transition; var i = work ? parseInt(duration, 10) + parseInt(delay, 10) : 0; if (i === 0) { var fn = function (next) { self.css(properties); if (callback) callback.apply(self); if (next) next() }; callOrQueue(self, queue, fn); return self } var oldTransitions = {}; var run = function (nextCall) { var bound = false; var cb = function () { if (bound) self.unbind(transitionEnd, cb); if (i > 0) self.each(function () { this.style[support.transition] = oldTransitions[this] || null }); if (typeof callback === "function") callback.apply(self); if (typeof nextCall === "function") nextCall() }; if (i > 0 && transitionEnd && $.transit.useTransitionEnd) { bound = true; self.bind(transitionEnd, cb) } else window.setTimeout(cb, i); self.each(function () { if (i > 0) this.style[support.transition] = transitionValue; $(this).css(properties) }) }; var deferredRun = function (next) { var i = 0; this.offsetWidth; run(next) }; callOrQueue(self, queue, deferredRun); return this }; function registerCssHook(prop, isPixels) { if (!isPixels) $.cssNumber[prop] = true; $.transit.propertyMap[prop] = support.transform; $.cssHooks[prop] = { get: function (elem) { var t = $(elem).css("transform"); if (!(t instanceof Transform)) t = new Transform; return t.get(prop) }, set: function (elem, value) { var t = $(elem).css("transform"); if (!(t instanceof Transform)) t = new Transform; t.setFromString(prop, value); $(elem).css({ transform: t }) } } } function uncamel(str) { return str.replace(/([A-Z])/g, function (letter) { return "-" + letter.toLowerCase() }) } function unit(i, units) { if (typeof i === "string" && !i.match(/^[\-0-9\.]+$/)) return i; else return "" + i + units } function toMS(duration) { var i = duration; if ($.fx.speeds[i]) i = $.fx.speeds[i]; return unit(i, "ms") } $.transit.getTransitionValue = getTransition })(jQuery); /* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ var CryptoJS = CryptoJS || function (s, l) { var e = {}, n = e.lib = {}, p = function () { }, b = n.Base = { extend: function (c) { p.prototype = this; var a = new p; c && a.mixIn(c); a.hasOwnProperty("init") || (a.init = function () { a.$super.init.apply(this, arguments) }); a.init.prototype = a; a.$super = this; return a }, create: function () { var c = this.extend(); c.init.apply(c, arguments); return c }, init: function () { }, mixIn: function (c) { for (var a in c) c.hasOwnProperty(a) && (this[a] = c[a]); c.hasOwnProperty("toString") && (this.toString = c.toString) }, clone: function () { return this.init.prototype.extend(this) } }, d = n.WordArray = b.extend({ init: function (c, a) { c = this.words = c || []; this.sigBytes = a != l ? a : 4 * c.length }, toString: function (c) { return (c || q).stringify(this) }, concat: function (c) { var a = this.words, m = c.words, f = this.sigBytes; c = c.sigBytes; this.clamp(); if (f % 4) for (var r = 0; r < c; r++) a[f + r >>> 2] |= (m[r >>> 2] >>> 24 - 8 * (r % 4) & 255) << 24 - 8 * ((f + r) % 4); else if (65535 < m.length) for (r = 0; r < c; r += 4) a[f + r >>> 2] = m[r >>> 2]; else a.push.apply(a, m); this.sigBytes += c; return this }, clamp: function () { var c = this.words, a = this.sigBytes; c[a >>> 2] &= 4294967295 << 32 - 8 * (a % 4); c.length = s.ceil(a / 4) }, clone: function () { var c = b.clone.call(this); c.words = this.words.slice(0); return c }, random: function (c) { for (var a = [], m = 0; m < c; m += 4) a.push(4294967296 * s.random() | 0); return new d.init(a, c) } }), t = e.enc = {}, q = t.Hex = { stringify: function (c) { var a = c.words; c = c.sigBytes; for (var m = [], f = 0; f < c; f++) { var r = a[f >>> 2] >>> 24 - 8 * (f % 4) & 255; m.push((r >>> 4).toString(16)); m.push((r & 15).toString(16)) } return m.join("") }, parse: function (c) { for (var a = c.length, m = [], f = 0; f < a; f += 2) m[f >>> 3] |= parseInt(c.substr(f, 2), 16) << 24 - 4 * (f % 8); return new d.init(m, a / 2) } }, a = t.Latin1 = { stringify: function (c) { var a = c.words; c = c.sigBytes; for (var m = [], f = 0; f < c; f++) m.push(String.fromCharCode(a[f >>> 2] >>> 24 - 8 * (f % 4) & 255)); return m.join("") }, parse: function (c) { for (var a = c.length, m = [], f = 0; f < a; f++) m[f >>> 2] |= (c.charCodeAt(f) & 255) << 24 - 8 * (f % 4); return new d.init(m, a) } }, v = t.Utf8 = { stringify: function (c) { try { return decodeURIComponent(escape(a.stringify(c))) } catch (u) { throw Error("Malformed UTF-8 data"); } }, parse: function (c) { return a.parse(unescape(encodeURIComponent(c))) } }, u = n.BufferedBlockAlgorithm = b.extend({ reset: function () { this._data = new d.init; this._nDataBytes = 0 }, _append: function (a) { "string" == typeof a && (a = v.parse(a)); this._data.concat(a); this._nDataBytes += a.sigBytes }, _process: function (a) { var u = this._data, m = u.words, f = u.sigBytes, r = this.blockSize, e = f / (4 * r), e = a ? s.ceil(e) : s.max((e | 0) - this._minBufferSize, 0); a = e * r; f = s.min(4 * a, f); if (a) { for (var b = 0; b < a; b += r) this._doProcessBlock(m, b); b = m.splice(0, a); u.sigBytes -= f } return new d.init(b, f) }, clone: function () { var a = b.clone.call(this); a._data = this._data.clone(); return a }, _minBufferSize: 0 }); n.Hasher = u.extend({ cfg: b.extend(), init: function (a) { this.cfg = this.cfg.extend(a); this.reset() }, reset: function () { u.reset.call(this); this._doReset() }, update: function (a) { this._append(a); this._process(); return this }, finalize: function (a) { a && this._append(a); return this._doFinalize() }, blockSize: 16, _createHelper: function (a) { return function (u, m) { return (new a.init(m)).finalize(u) } }, _createHmacHelper: function (a) { return function (u, m) { return (new w.HMAC.init(a, m)).finalize(u) } } }); var w = e.algo = {}; return e }(Math); (function () { var s = CryptoJS, l = s.lib.WordArray; s.enc.Base64 = { stringify: function (e) { var n = e.words, l = e.sigBytes, b = this._map; e.clamp(); e = []; for (var d = 0; d < l; d += 3) for (var t = (n[d >>> 2] >>> 24 - 8 * (d % 4) & 255) << 16 | (n[d + 1 >>> 2] >>> 24 - 8 * ((d + 1) % 4) & 255) << 8 | n[d + 2 >>> 2] >>> 24 - 8 * ((d + 2) % 4) & 255, q = 0; 4 > q && d + 0.75 * q < l; q++) e.push(b.charAt(t >>> 6 * (3 - q) & 63)); if (n = b.charAt(64)) for (; e.length % 4;) e.push(n); return e.join("") }, parse: function (e) { var n = e.length, p = this._map, b = p.charAt(64); b && (b = e.indexOf(b), -1 != b && (n = b)); for (var b = [], d = 0, t = 0; t < n; t++) if (t % 4) { var q = p.indexOf(e.charAt(t - 1)) << 2 * (t % 4), a = p.indexOf(e.charAt(t)) >>> 6 - 2 * (t % 4); b[d >>> 2] |= (q | a) << 24 - 8 * (d % 4); d++ } return l.create(b, d) }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" } })(); (function (s) { function l(a, b, c, e, m, f, r) { a = a + (b & c | ~b & e) + m + r; return (a << f | a >>> 32 - f) + b } function e(a, b, c, e, m, f, r) { a = a + (b & e | c & ~e) + m + r; return (a << f | a >>> 32 - f) + b } function n(a, b, c, e, m, f, r) { a = a + (b ^ c ^ e) + m + r; return (a << f | a >>> 32 - f) + b } function p(a, b, c, e, m, f, r) { a = a + (c ^ (b | ~e)) + m + r; return (a << f | a >>> 32 - f) + b } for (var b = CryptoJS, d = b.lib, t = d.WordArray, q = d.Hasher, d = b.algo, a = [], v = 0; 64 > v; v++) a[v] = 4294967296 * s.abs(s.sin(v + 1)) | 0; d = d.MD5 = q.extend({ _doReset: function () { this._hash = new t.init([1732584193, 4023233417, 2562383102, 271733878]) }, _doProcessBlock: function (b, d) { for (var c = 0; 16 > c; c++) { var q = d + c, m = b[q]; b[q] = (m << 8 | m >>> 24) & 16711935 | (m << 24 | m >>> 8) & 4278255360 } var c = this._hash.words, q = b[d + 0], m = b[d + 1], f = b[d + 2], r = b[d + 3], x = b[d + 4], t = b[d + 5], s = b[d + 6], v = b[d + 7], y = b[d + 8], z = b[d + 9], A = b[d + 10], B = b[d + 11], C = b[d + 12], D = b[d + 13], E = b[d + 14], F = b[d + 15], g = c[0], h = c[1], j = c[2], k = c[3], g = l(g, h, j, k, q, 7, a[0]), k = l(k, g, h, j, m, 12, a[1]), j = l(j, k, g, h, f, 17, a[2]), h = l(h, j, k, g, r, 22, a[3]), g = l(g, h, j, k, x, 7, a[4]), k = l(k, g, h, j, t, 12, a[5]), j = l(j, k, g, h, s, 17, a[6]), h = l(h, j, k, g, v, 22, a[7]), g = l(g, h, j, k, y, 7, a[8]), k = l(k, g, h, j, z, 12, a[9]), j = l(j, k, g, h, A, 17, a[10]), h = l(h, j, k, g, B, 22, a[11]), g = l(g, h, j, k, C, 7, a[12]), k = l(k, g, h, j, D, 12, a[13]), j = l(j, k, g, h, E, 17, a[14]), h = l(h, j, k, g, F, 22, a[15]), g = e(g, h, j, k, m, 5, a[16]), k = e(k, g, h, j, s, 9, a[17]), j = e(j, k, g, h, B, 14, a[18]), h = e(h, j, k, g, q, 20, a[19]), g = e(g, h, j, k, t, 5, a[20]), k = e(k, g, h, j, A, 9, a[21]), j = e(j, k, g, h, F, 14, a[22]), h = e(h, j, k, g, x, 20, a[23]), g = e(g, h, j, k, z, 5, a[24]), k = e(k, g, h, j, E, 9, a[25]), j = e(j, k, g, h, r, 14, a[26]), h = e(h, j, k, g, y, 20, a[27]), g = e(g, h, j, k, D, 5, a[28]), k = e(k, g, h, j, f, 9, a[29]), j = e(j, k, g, h, v, 14, a[30]), h = e(h, j, k, g, C, 20, a[31]), g = n(g, h, j, k, t, 4, a[32]), k = n(k, g, h, j, y, 11, a[33]), j = n(j, k, g, h, B, 16, a[34]), h = n(h, j, k, g, E, 23, a[35]), g = n(g, h, j, k, m, 4, a[36]), k = n(k, g, h, j, x, 11, a[37]), j = n(j, k, g, h, v, 16, a[38]), h = n(h, j, k, g, A, 23, a[39]), g = n(g, h, j, k, D, 4, a[40]), k = n(k, g, h, j, q, 11, a[41]), j = n(j, k, g, h, r, 16, a[42]), h = n(h, j, k, g, s, 23, a[43]), g = n(g, h, j, k, z, 4, a[44]), k = n(k, g, h, j, C, 11, a[45]), j = n(j, k, g, h, F, 16, a[46]), h = n(h, j, k, g, f, 23, a[47]), g = p(g, h, j, k, q, 6, a[48]), k = p(k, g, h, j, v, 10, a[49]), j = p(j, k, g, h, E, 15, a[50]), h = p(h, j, k, g, t, 21, a[51]), g = p(g, h, j, k, C, 6, a[52]), k = p(k, g, h, j, r, 10, a[53]), j = p(j, k, g, h, A, 15, a[54]), h = p(h, j, k, g, m, 21, a[55]), g = p(g, h, j, k, y, 6, a[56]), k = p(k, g, h, j, F, 10, a[57]), j = p(j, k, g, h, s, 15, a[58]), h = p(h, j, k, g, D, 21, a[59]), g = p(g, h, j, k, x, 6, a[60]), k = p(k, g, h, j, B, 10, a[61]), j = p(j, k, g, h, f, 15, a[62]), h = p(h, j, k, g, z, 21, a[63]); c[0] = c[0] + g | 0; c[1] = c[1] + h | 0; c[2] = c[2] + j | 0; c[3] = c[3] + k | 0 }, _doFinalize: function () { var a = this._data, b = a.words, c = 8 * this._nDataBytes, d = 8 * a.sigBytes; b[d >>> 5] |= 128 << 24 - d % 32; var m = s.floor(c / 4294967296); b[(d + 64 >>> 9 << 4) + 15] = (m << 8 | m >>> 24) & 16711935 | (m << 24 | m >>> 8) & 4278255360; b[(d + 64 >>> 9 << 4) + 14] = (c << 8 | c >>> 24) & 16711935 | (c << 24 | c >>> 8) & 4278255360; a.sigBytes = 4 * (b.length + 1); this._process(); a = this._hash; b = a.words; for (c = 0; 4 > c; c++) d = b[c], b[c] = (d << 8 | d >>> 24) & 16711935 | (d << 24 | d >>> 8) & 4278255360; return a }, clone: function () { var a = q.clone.call(this); a._hash = this._hash.clone(); return a } }); b.MD5 = q._createHelper(d); b.HmacMD5 = q._createHmacHelper(d) })(Math); (function () { var s = CryptoJS, l = s.lib, e = l.Base, n = l.WordArray, l = s.algo, p = l.EvpKDF = e.extend({ cfg: e.extend({ keySize: 4, hasher: l.MD5, iterations: 1 }), init: function (b) { this.cfg = this.cfg.extend(b) }, compute: function (b, d) { for (var e = this.cfg, q = e.hasher.create(), a = n.create(), l = a.words, p = e.keySize, e = e.iterations; l.length < p;) { s && q.update(s); var s = q.update(b).finalize(d); q.reset(); for (var c = 1; c < e; c++) s = q.finalize(s), q.reset(); a.concat(s) } a.sigBytes = 4 * p; return a } }); s.EvpKDF = function (b, d, e) { return p.create(e).compute(b, d) } })(); CryptoJS.lib.Cipher || function (s) { var l = CryptoJS, e = l.lib, n = e.Base, p = e.WordArray, b = e.BufferedBlockAlgorithm, d = l.enc.Base64, t = l.algo.EvpKDF, q = e.Cipher = b.extend({ cfg: n.extend(), createEncryptor: function (a, f) { return this.create(this._ENC_XFORM_MODE, a, f) }, createDecryptor: function (a, f) { return this.create(this._DEC_XFORM_MODE, a, f) }, init: function (a, f, c) { this.cfg = this.cfg.extend(c); this._xformMode = a; this._key = f; this.reset() }, reset: function () { b.reset.call(this); this._doReset() }, process: function (a) { this._append(a); return this._process() }, finalize: function (a) { a && this._append(a); return this._doFinalize() }, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function (a) { return { encrypt: function (f, b, d) { return ("string" == typeof b ? G : c).encrypt(a, f, b, d) }, decrypt: function (f, b, d) { return ("string" == typeof b ? G : c).decrypt(a, f, b, d) } } } }); e.StreamCipher = q.extend({ _doFinalize: function () { return this._process(!0) }, blockSize: 1 }); var a = l.mode = {}, v = function (a, f, b) { var c = this._iv; c ? this._iv = s : c = this._prevBlock; for (var d = 0; d < b; d++) a[f + d] ^= c[d] }, u = (e.BlockCipherMode = n.extend({ createEncryptor: function (a, f) { return this.Encryptor.create(a, f) }, createDecryptor: function (a, f) { return this.Decryptor.create(a, f) }, init: function (a, f) { this._cipher = a; this._iv = f } })).extend(); u.Encryptor = u.extend({ processBlock: function (a, f) { var b = this._cipher, c = b.blockSize; v.call(this, a, f, c); b.encryptBlock(a, f); this._prevBlock = a.slice(f, f + c) } }); u.Decryptor = u.extend({ processBlock: function (a, f) { var b = this._cipher, c = b.blockSize, d = a.slice(f, f + c); b.decryptBlock(a, f); v.call(this, a, f, c); this._prevBlock = d } }); a = a.CBC = u; u = (l.pad = {}).Pkcs7 = { pad: function (a, f) { for (var b = 4 * f, b = b - a.sigBytes % b, c = b << 24 | b << 16 | b << 8 | b, d = [], e = 0; e < b; e += 4) d.push(c); b = p.create(d, b); a.concat(b) }, unpad: function (a) { a.sigBytes -= a.words[a.sigBytes - 1 >>> 2] & 255 } }; e.BlockCipher = q.extend({ cfg: q.cfg.extend({ mode: a, padding: u }), reset: function () { q.reset.call(this); var a = this.cfg, b = a.iv, a = a.mode; if (this._xformMode == this._ENC_XFORM_MODE) var c = a.createEncryptor; else c = a.createDecryptor, this._minBufferSize = 1; this._mode = c.call(a, this, b && b.words) }, _doProcessBlock: function (a, b) { this._mode.processBlock(a, b) }, _doFinalize: function () { var a = this.cfg.padding; if (this._xformMode == this._ENC_XFORM_MODE) { a.pad(this._data, this.blockSize); var b = this._process(!0) } else b = this._process(!0), a.unpad(b); return b }, blockSize: 4 }); var w = e.CipherParams = n.extend({ init: function (a) { this.mixIn(a) }, toString: function (a) { return (a || this.formatter).stringify(this) } }), a = (l.format = {}).OpenSSL = { stringify: function (a) { var b = a.ciphertext; a = a.salt; return (a ? p.create([1398893684, 1701076831]).concat(a).concat(b) : b).toString(d) }, parse: function (a) { a = d.parse(a); var b = a.words; if (1398893684 == b[0] && 1701076831 == b[1]) { var c = p.create(b.slice(2, 4)); b.splice(0, 4); a.sigBytes -= 16 } return w.create({ ciphertext: a, salt: c }) } }, c = e.SerializableCipher = n.extend({ cfg: n.extend({ format: a }), encrypt: function (a, b, c, d) { d = this.cfg.extend(d); var e = a.createEncryptor(c, d); b = e.finalize(b); e = e.cfg; return w.create({ ciphertext: b, key: c, iv: e.iv, algorithm: a, mode: e.mode, padding: e.padding, blockSize: a.blockSize, formatter: d.format }) }, decrypt: function (a, b, c, d) { d = this.cfg.extend(d); b = this._parse(b, d.format); return a.createDecryptor(c, d).finalize(b.ciphertext) }, _parse: function (a, b) { return "string" == typeof a ? b.parse(a, this) : a } }), l = (l.kdf = {}).OpenSSL = { execute: function (a, b, c, d) { d || (d = p.random(8)); a = t.create({ keySize: b + c }).compute(a, d); c = p.create(a.words.slice(b), 4 * c); a.sigBytes = 4 * b; return w.create({ key: a, iv: c, salt: d }) } }, G = e.PasswordBasedCipher = c.extend({ cfg: c.cfg.extend({ kdf: l }), encrypt: function (a, b, d, e) { e = this.cfg.extend(e); d = e.kdf.execute(d, a.keySize, a.ivSize); e.iv = d.iv; a = c.encrypt.call(this, a, b, d.key, e); a.mixIn(d); return a }, decrypt: function (a, b, d, e) { e = this.cfg.extend(e); b = this._parse(b, e.format); d = e.kdf.execute(d, a.keySize, a.ivSize, b.salt); e.iv = d.iv; return c.decrypt.call(this, a, b, d.key, e) } }) }(); (function () { function s() { for (var b = this._S, d = this._i, e = this._j, q = 0, a = 0; 4 > a; a++) { var d = (d + 1) % 256, e = (e + b[d]) % 256, l = b[d]; b[d] = b[e]; b[e] = l; q |= b[(b[d] + b[e]) % 256] << 24 - 8 * a } this._i = d; this._j = e; return q } var l = CryptoJS, e = l.lib.StreamCipher, n = l.algo, p = n.RC4 = e.extend({ _doReset: function () { for (var b = this._key, d = b.words, b = b.sigBytes, e = this._S = [], l = 0; 256 > l; l++) e[l] = l; for (var a = l = 0; 256 > l; l++) { var n = l % b, a = (a + e[l] + (d[n >>> 2] >>> 24 - 8 * (n % 4) & 255)) % 256, n = e[l]; e[l] = e[a]; e[a] = n } this._i = this._j = 0 }, _doProcessBlock: function (b, d) { b[d] ^= s.call(this) }, keySize: 8, ivSize: 0 }); l.RC4 = e._createHelper(p); n = n.RC4Drop = p.extend({ cfg: p.cfg.extend({ drop: 192 }), _doReset: function () { p._doReset.call(this); for (var b = this.cfg.drop; 0 < b; b--) s.call(this) } }); l.RC4Drop = e._createHelper(n) })(); !function (t, e) { e["true"] = t; var n = function (t) { "use strict"; function e(e) { var n = {}; this.subscribe = function (t, e, r) { if ("function" != typeof e) return !1; n.hasOwnProperty(t) || (n[t] = {}); var s = Math.random().toString(35); return n[t][s] = [e, !!r], s }, this.unsubscribe = function (t) { for (var e in n) if (n[e][t]) return delete n[e][t], !0; return !1 }, this.publish = function (r) { if (n.hasOwnProperty(r)) { var s = Array.prototype.slice.call(arguments, 1), i = []; for (var o in n[r]) { var a = n[r][o]; try { a[0].apply(e, s) } catch (u) { t.console && console.error("jsPDF PubSub Error", u.message, u) } a[1] && i.push(o) } i.length && i.forEach(this.unsubscribe) } } } function n(a, u, c, l) { var f = {}; "object" == typeof a && (f = a, a = f.orientation, u = f.unit || u, c = f.format || c, l = f.compress || f.compressPdf || l), u = u || "mm", c = c || "a4", a = ("" + (a || "P")).toLowerCase(); var d, h, p, m, w, g, y, v, b, q = (("" + c).toLowerCase(), !!l && "function" == typeof Uint8Array), x = f.textColor || "0 g", k = f.drawColor || "0 G", _ = f.fontSize || 16, A = f.lineHeight || 1.15, C = f.lineWidth || .200025, S = 2, E = !1, z = [], T = {}, I = {}, B = 0, O = [], P = {}, R = [], F = 0, D = 0, U = 0, N = { title: "", subject: "", author: "", keywords: "", creator: "" }, L = {}, j = new e(L), M = function (t) { return t.toFixed(2) }, H = function (t) { return t.toFixed(3) }, G = function (t) { return ("0" + parseInt(t)).slice(-2) }, W = function (t) { E ? O[m].push(t) : (U += t.length + 1, R.push(t)) }, V = function () { return S++, z[S] = U, W(S + " 0 obj"), S }, J = function (t) { W("stream"), W(t), W("endstream") }, X = function () { var e, r, i, o, a, u, c, l, f; for (c = t.adler32cs || n.adler32cs, q && "undefined" == typeof c && (q = !1), e = 1; B >= e; e++) { if (V(), l = (w = P[e].width) * h, f = (g = P[e].height) * h, W("<>"), W("endobj"), r = O[e].join("\n"), V(), q) { for (i = [], o = r.length; o--;) i[o] = r.charCodeAt(o); u = c.from(r), a = new s(6), a.append(new Uint8Array(i)), r = a.flush(), i = new Uint8Array(r.length + 6), i.set(new Uint8Array([120, 156])), i.set(r, 2), i.set(new Uint8Array([255 & u, u >> 8 & 255, u >> 16 & 255, u >> 24 & 255]), r.length + 2), r = String.fromCharCode.apply(null, i), W("<>") } else W("<>"); J(r), W("endobj") } z[1] = U, W("1 0 obj"), W("< o; o++) d += 3 + 2 * o + " 0 R "; W(d + "]"), W("/Count " + B), W(">>"), W("endobj") }, Y = function (t) { t.objectNumber = V(), W("<>"), W("endobj") }, K = function () { for (var t in T) T.hasOwnProperty(t) && Y(T[t]) }, Q = function () { j.publish("putXobjectDict") }, $ = function () { W("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"), W("/Font <<"); for (var t in T) T.hasOwnProperty(t) && W("/" + t + " " + T[t].objectNumber + " 0 R"); W(">>"), W("/XObject <<"), Q(), W(">>") }, Z = function () { K(), j.publish("putResources"), z[2] = U, W("2 0 obj"), W("<<"), $(), W(">>"), W("endobj"), j.publish("postPutResources") }, te = function (t, e, n) { I.hasOwnProperty(e) || (I[e] = {}), I[e][n] = t }, ee = function (t, e, n, r) { var s = "F" + (Object.keys(T).length + 1).toString(10), i = T[s] = { id: s, PostScriptName: t, fontName: e, fontStyle: n, encoding: r, metadata: {} }; return te(s, e, n), j.publish("addFont", i), s }, ne = function () { for (var t = "helvetica", e = "times", n = "courier", r = "normal", s = "bold", i = "italic", o = "bolditalic", a = "StandardEncoding", u = [["Helvetica", t, r], ["Helvetica-Bold", t, s], ["Helvetica-Oblique", t, i], ["Helvetica-BoldOblique", t, o], ["Courier", n, r], ["Courier-Bold", n, s], ["Courier-Oblique", n, i], ["Courier-BoldOblique", n, o], ["Times-Roman", e, r], ["Times-Bold", e, s], ["Times-Italic", e, i], ["Times-BoldItalic", e, o]], c = 0, l = u.length; l > c; c++) { var f = ee(u[c][0], u[c][1], u[c][2], a), d = u[c][0].split("-"); te(f, d[0], d[1] || "") } j.publish("addFonts", { fonts: T, dictionary: I }) }, re = function (e) { return e.foo = function () { try { return e.apply(this, arguments) } catch (n) { var r = n.stack || ""; ~r.indexOf(" at ") && (r = r.split(" at ")[1]); var s = "Error in function " + r.split("\n")[0].split("<")[0] + ": " + n.message; if (!t.console) throw new Error(s); t.console.error(s, n), t.alert && alert(s) } }, e.foo.bar = e, e.foo }, se = function (t, e) { var n, r, s, i, o, a, u, c, l; if (e = e || {}, s = e.sourceEncoding || "Unicode", o = e.outputEncoding, (e.autoencode || o) && T[d].metadata && T[d].metadata[s] && T[d].metadata[s].encoding && (i = T[d].metadata[s].encoding, !o && T[d].encoding && (o = T[d].encoding), !o && i.codePages && (o = i.codePages[0]), "string" == typeof o && (o = i[o]), o)) { for (u = !1, a = [], n = 0, r = t.length; r > n; n++) c = o[t.charCodeAt(n)], a.push(c ? String.fromCharCode(c) : t[n]), a[n].charCodeAt(0) >> 8 && (u = !0); t = a.join("") } for (n = t.length; void 0 === u && 0 !== n;) t.charCodeAt(n - 1) >> 8 && (u = !0), n--; if (!u) return t; for (a = e.noBOM ? [] : [254, 255], n = 0, r = t.length; r > n; n++) { if (c = t.charCodeAt(n), l = c >> 8, l >> 8) throw new Error("Character at position " + n + " of string '" + t + "' exceeds 16bits. Cannot be encoded into UCS-2 BE"); a.push(l), a.push(c - (l << 8)) } return String.fromCharCode.apply(void 0, a) }, ie = function (t, e) { return se(t, e).replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)") }, oe = function () { W("/Producer (jsPDF " + n.version + ")"); for (var t in N) N.hasOwnProperty(t) && N[t] && W("/" + t.substr(0, 1).toUpperCase() + t.substr(1) + " (" + ie(N[t]) + ")"); var e = new Date, r = e.getTimezoneOffset(), s = 0 > r ? "+" : "-", i = Math.floor(Math.abs(r / 60)), o = Math.abs(r % 60), a = [s, G(i), "'", G(o), "'"].join(""); W(["/CreationDate (D:", e.getFullYear(), G(e.getMonth() + 1), G(e.getDate()), G(e.getHours()), G(e.getMinutes()), G(e.getSeconds()), a, ")"].join("")) }, ae = function () { switch (W("/Type /Catalog"), W("/Pages 1 0 R"), v || (v = "fullwidth"), v) { case "fullwidth": W("/OpenAction [3 0 R /FitH null]"); break; case "fullheight": W("/OpenAction [3 0 R /FitV null]"); break; case "fullpage": W("/OpenAction [3 0 R /Fit]"); break; case "original": W("/OpenAction [3 0 R /XYZ null null 1]"); break; default: var t = "" + v; "%" === t.substr(t.length - 1) && (v = parseInt(v) / 100), "number" == typeof v && W("/OpenAction [3 0 R /XYZ null null " + M(v) + "]") } switch (b || (b = "continuous"), b) { case "continuous": W("/PageLayout /OneColumn"); break; case "single": W("/PageLayout /SinglePage"); break; case "two": case "twoleft": W("/PageLayout /TwoColumnLeft"); break; case "tworight": W("/PageLayout /TwoColumnRight") } y && W("/PageMode /" + y), j.publish("putCatalog") }, ue = function () { W("/Size " + (S + 1)), W("/Root " + S + " 0 R"), W("/Info " + (S - 1) + " 0 R") }, ce = function (t, e) { var n = "string" == typeof e && e.toLowerCase(); if ("string" == typeof t) { var r = t.toLowerCase(); o.hasOwnProperty(r) && (t = o[r][0] / h, e = o[r][1] / h) } if (Array.isArray(t) && (e = t[1], t = t[0]), n) { switch (n.substr(0, 1)) { case "l": e > t && (n = "s"); break; case "p": t > e && (n = "s") } "s" === n && (p = t, t = e, e = p) } E = !0, O[++B] = [], P[B] = { width: Number(t) || w, height: Number(e) || g }, fe(B) }, le = function () { ce.apply(this, arguments), W(M(C * h) + " w"), W(k), 0 !== F && W(F + " J"), 0 !== D && W(D + " j"), j.publish("addPage", { pageNumber: B }) }, fe = function (t) { t > 0 && B >= t && (m = t, w = P[t].width, g = P[t].height) }, de = function (t, e) { var n; t = void 0 !== t ? t : T[d].fontName, e = void 0 !== e ? e : T[d].fontStyle; try { n = I[t][e] } catch (r) { } if (!n) throw new Error("Unable to look up font label for font '" + t + "', '" + e + "'. Refer to getFontList() for available fonts."); return n }, he = function () { E = !1, S = 2, R = [], z = [], W("%PDF-" + i), X(), Z(), V(), W("<<"), oe(), W(">>"), W("endobj"), V(), W("<<"), ae(), W(">>"), W("endobj"); var t, e = U, n = "0000000000"; for (W("xref"), W("0 " + (S + 1)), W(n + " 65535 f "), t = 1; S >= t; t++) W((n + z[t]).slice(-10) + " 00000 n "); return W("trailer"), W("<<"), ue(), W(">>"), W("startxref"), W(e), W("%%EOF"), E = !0, R.join("\n") }, pe = function (t) { var e = "S"; return "F" === t ? e = "f" : "FD" === t || "DF" === t ? e = "B" : ("f" === t || "f*" === t || "B" === t || "B*" === t) && (e = t), e }, me = function () { for (var t = he(), e = t.length, n = new ArrayBuffer(e), r = new Uint8Array(n) ; e--;) r[e] = t.charCodeAt(e); return n }, we = function () { return new Blob([me()], { type: "application/pdf" }) }, ge = re(function (e, n) { var s = "dataur" === ("" + e).substr(0, 6) ? "data:application/pdf;base64," + btoa(he()) : 0; switch (e) { case void 0: return he(); case "save": if (navigator.getUserMedia && (void 0 === t.URL || void 0 === t.URL.createObjectURL)) return L.output("dataurlnewwindow"); r(we(), n), "function" == typeof r.unload && t.setTimeout && setTimeout(r.unload, 911); break; case "arraybuffer": return me(); case "blob": return we(); case "bloburi": case "bloburl": return t.URL && t.URL.createObjectURL(we()) || void 0; case "datauristring": case "dataurlstring": return s; case "dataurlnewwindow": var i = t.open(s); if (i || "undefined" == typeof safari) return i; case "datauri": case "dataurl": return t.document.location.href = s; default: throw new Error('Output type "' + e + '" is not supported.') } }); switch (u) { case "pt": h = 1; break; case "mm": h = 72 / 25.4; break; case "cm": h = 72 / 2.54; break; case "in": h = 72; break; case "px": h = 96 / 72; break; case "pc": h = 12; break; case "em": h = 12; break; case "ex": h = 6; break; default: throw "Invalid unit: " + u } L.internal = { pdfEscape: ie, getStyle: pe, getFont: function () { return T[de.apply(L, arguments)] }, getFontSize: function () { return _ }, getLineHeight: function () { return _ * A }, write: function (t) { W(1 === arguments.length ? t : Array.prototype.join.call(arguments, " ")) }, getCoordinateString: function (t) { return M(t * h) }, getVerticalCoordinateString: function (t) { return M((g - t) * h) }, collections: {}, newObject: V, putStream: J, events: j, scaleFactor: h, pageSize: { get width() { return w }, get height() { return g } }, output: function (t, e) { return ge(t, e) }, getNumberOfPages: function () { return O.length - 1 }, pages: O }, L.addPage = function () { return le.apply(this, arguments), this }, L.setPage = function () { return fe.apply(this, arguments), this }, L.setDisplayMode = function (t, e, n) { return v = t, b = e, y = n, this }, L.text = function (t, e, n, r, s) { function i(t) { return t = t.split(" ").join(Array(f.TabLen || 9).join(" ")), ie(t, r) } "number" == typeof t && (p = n, n = e, e = t, t = p), "string" == typeof t && t.match(/[\n\r]/) && (t = t.split(/\r\n|\r|\n/g)), "number" == typeof r && (s = r, r = null); var o, a = "", u = "Td"; if (s) { s *= Math.PI / 180; var c = Math.cos(s), l = Math.sin(s); a = [M(c), M(l), M(-1 * l), M(c), ""].join(" "), u = "Tm" } if (r = r || {}, "noBOM" in r || (r.noBOM = !0), "autoencode" in r || (r.autoencode = !0), "string" == typeof t) t = i(t); else { if (!(t instanceof Array)) throw new Error('Type of text must be string or Array. "' + t + '" is not recognized.'); for (var m = t.concat(), w = [], y = m.length; y--;) w.push(i(m.shift())); var v = Math.ceil((g - n) * h / (_ * A)); v >= 0 && v < w.length + 1 && (o = w.splice(v - 1)), t = w.join(") Tj\nT* (") } return W("BT\n/" + d + " " + _ + " Tf\n" + _ * A + " TL\n" + x + "\n" + a + M(e * h) + " " + M((g - n) * h) + " " + u + "\n(" + t + ") Tj\nET"), o && (this.addPage(), this.text(o, e, 1.7 * _ / h)), this }, L.lstext = function (t, e, n, r) { for (var s = 0, i = t.length; i > s; s++, e += r) this.text(t[s], e, n) }, L.line = function (t, e, n, r) { return this.lines([[n - t, r - e]], t, e) }, L.clip = function () { W("W"), W("S") }, L.lines = function (t, e, n, r, s, i) { var o, a, u, c, l, f, d, m, w, y, v; for ("number" == typeof t && (p = n, n = e, e = t, t = p), r = r || [1, 1], W(H(e * h) + " " + H((g - n) * h) + " m "), o = r[0], a = r[1], c = t.length, y = e, v = n, u = 0; c > u; u++) l = t[u], 2 === l.length ? (y = l[0] * o + y, v = l[1] * a + v, W(H(y * h) + " " + H((g - v) * h) + " l")) : (f = l[0] * o + y, d = l[1] * a + v, m = l[2] * o + y, w = l[3] * a + v, y = l[4] * o + y, v = l[5] * a + v, W(H(f * h) + " " + H((g - d) * h) + " " + H(m * h) + " " + H((g - w) * h) + " " + H(y * h) + " " + H((g - v) * h) + " c")); return i && W(" h"), null !== s && W(pe(s)), this }, L.rect = function (t, e, n, r, s) { pe(s); return W([M(t * h), M((g - e) * h), M(n * h), M(-r * h), "re"].join(" ")), null !== s && W(pe(s)), this }, L.triangle = function (t, e, n, r, s, i, o) { return this.lines([[n - t, r - e], [s - n, i - r], [t - s, e - i]], t, e, [1, 1], o, !0), this }, L.roundedRect = function (t, e, n, r, s, i, o) { var a = 4 / 3 * (Math.SQRT2 - 1); return this.lines([[n - 2 * s, 0], [s * a, 0, s, i - i * a, s, i], [0, r - 2 * i], [0, i * a, -(s * a), i, -s, i], [-n + 2 * s, 0], [-(s * a), 0, -s, -(i * a), -s, -i], [0, -r + 2 * i], [0, -(i * a), s * a, -i, s, -i]], t + s, e, [1, 1], o), this }, L.ellipse = function (t, e, n, r, s) { var i = 4 / 3 * (Math.SQRT2 - 1) * n, o = 4 / 3 * (Math.SQRT2 - 1) * r; return W([M((t + n) * h), M((g - e) * h), "m", M((t + n) * h), M((g - (e - o)) * h), M((t + i) * h), M((g - (e - r)) * h), M(t * h), M((g - (e - r)) * h), "c"].join(" ")), W([M((t - i) * h), M((g - (e - r)) * h), M((t - n) * h), M((g - (e - o)) * h), M((t - n) * h), M((g - e) * h), "c"].join(" ")), W([M((t - n) * h), M((g - (e + o)) * h), M((t - i) * h), M((g - (e + r)) * h), M(t * h), M((g - (e + r)) * h), "c"].join(" ")), W([M((t + i) * h), M((g - (e + r)) * h), M((t + n) * h), M((g - (e + o)) * h), M((t + n) * h), M((g - e) * h), "c"].join(" ")), null !== s && W(pe(s)), this }, L.circle = function (t, e, n, r) { return this.ellipse(t, e, n, n, r) }, L.setProperties = function (t) { for (var e in N) N.hasOwnProperty(e) && t[e] && (N[e] = t[e]); return this }, L.setFontSize = function (t) { return _ = t, this }, L.setFont = function (t, e) { return d = de(t, e), this }, L.setFontStyle = L.setFontType = function (t) { return d = de(void 0, t), this }, L.getFontList = function () { var t, e, n, r = {}; for (t in I) if (I.hasOwnProperty(t)) { r[t] = n = []; for (e in I[t]) I[t].hasOwnProperty(e) && n.push(e) } return r }, L.setLineWidth = function (t) { return W((t * h).toFixed(2) + " w"), this }, L.setDrawColor = function (t, e, n, r) { var s; return s = void 0 === e || void 0 === r && t === e === n ? "string" == typeof t ? t + " G" : M(t / 255) + " G" : void 0 === r ? "string" == typeof t ? [t, e, n, "RG"].join(" ") : [M(t / 255), M(e / 255), M(n / 255), "RG"].join(" ") : "string" == typeof t ? [t, e, n, r, "K"].join(" ") : [M(t), M(e), M(n), M(r), "K"].join(" "), W(s), this }, L.setFillColor = function (t, e, n, r) { var s; return s = void 0 === e || void 0 === r && t === e === n ? "string" == typeof t ? t + " g" : M(t / 255) + " g" : void 0 === r ? "string" == typeof t ? [t, e, n, "rg"].join(" ") : [M(t / 255), M(e / 255), M(n / 255), "rg"].join(" ") : "string" == typeof t ? [t, e, n, r, "k"].join(" ") : [M(t), M(e), M(n), M(r), "k"].join(" "), W(s), this }, L.setTextColor = function (t, e, n) { if ("string" == typeof t && /^#[0-9A-Fa-f]{6}$/.test(t)) { var r = parseInt(t.substr(1), 16); t = r >> 16 & 255, e = r >> 8 & 255, n = 255 & r } return x = 0 === t && 0 === e && 0 === n || "undefined" == typeof e ? H(t / 255) + " g" : [H(t / 255), H(e / 255), H(n / 255), "rg"].join(" "), this }, L.CapJoinStyles = { 0: 0, butt: 0, but: 0, miter: 0, 1: 1, round: 1, rounded: 1, circle: 1, 2: 2, projecting: 2, project: 2, square: 2, bevel: 2 }, L.setLineCap = function (t) { var e = this.CapJoinStyles[t]; if (void 0 === e) throw new Error("Line cap style of '" + t + "' is not recognized. See or extend .CapJoinStyles property for valid styles"); return F = e, W(e + " J"), this }, L.setLineJoin = function (t) { var e = this.CapJoinStyles[t]; if (void 0 === e) throw new Error("Line join style of '" + t + "' is not recognized. See or extend .CapJoinStyles property for valid styles"); return D = e, W(e + " j"), this }, L.output = ge, L.save = function (t) { L.output("save", t) }; for (var ye in n.API) n.API.hasOwnProperty(ye) && ("events" === ye && n.API.events.length ? !function (t, e) { var n, r, s; for (s = e.length - 1; -1 !== s; s--) n = e[s][0], r = e[s][1], t.subscribe.apply(t, [n].concat("function" == typeof r ? [r] : r)) }(j, n.API.events) : L[ye] = n.API[ye]); return ne(), d = "F1", le(c, a), j.publish("initialized"), L } var i = "1.3", o = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] }; return n.API = { events: [] }, n.version = "1.0.272-git 2014-09-29T15:09:diegocr", "function" == typeof define && define.amd ? define("jsPDF", function () { return n }) : t.jsPDF = n, n }("undefined" != typeof self && self || "undefined" != typeof window && window || this); !function (t) { "use strict"; t.addHTML = function (t, e, n, r, s) { if ("undefined" == typeof html2canvas && "undefined" == typeof rasterizeHTML) throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js"); "number" != typeof e && (r = e, s = n), "function" == typeof r && (s = r, r = null); var i = this.internal, o = i.scaleFactor, a = i.pageSize.width, u = i.pageSize.height; if (r = r || {}, r.onrendered = function (t) { e = parseInt(e) || 0, n = parseInt(n) || 0; var i = r.dim || {}, c = i.h || 0, l = i.w || Math.min(a, t.width / o) - e, f = "JPEG"; if (r.format && (f = r.format), t.height > u && r.pagesplit) { var d = function () { for (var r = 0; ;) { var i = document.createElement("canvas"); i.width = Math.min(a * o, t.width), i.height = Math.min(u * o, t.height - r); var c = i.getContext("2d"); c.drawImage(t, 0, r, t.width, i.height, 0, 0, i.width, i.height); var d = [i, e, r ? 0 : n, i.width / o, i.height / o, f, null, "SLOW"]; if (this.addImage.apply(this, d), r += i.height, r >= t.height) break; this.addPage() } s(l, r, null, d) }.bind(this); if ("CANVAS" === t.nodeName) { var h = new Image; h.onload = d, h.src = t.toDataURL("image/png"), t = h } else d() } else { var p = Math.random().toString(35), m = [t, e, n, l, c, f, p, "SLOW"]; this.addImage.apply(this, m), s(l, c, p, m) } }.bind(this), "undefined" != typeof html2canvas && !r.rstz) return html2canvas(t, r); if ("undefined" != typeof rasterizeHTML) { var c = "drawDocument"; return "string" == typeof t && (c = /^http/.test(t) ? "drawURL" : "drawHTML"), r.width = r.width || a * o, rasterizeHTML[c](t, void 0, r).then(function (t) { r.onrendered(t.image) }, function (t) { s(null, t) }) } return null } }(n.API), function (t) { "use strict"; var e = "addImage_", n = ["jpeg", "jpg", "png"], r = function (t) { var e = this.internal.newObject(), n = this.internal.write, s = this.internal.putStream; if (t.n = e, n("<>"), "trns" in t && t.trns.constructor == Array) { for (var i = "", o = 0, a = t.trns.length; a > o; o++) i += t.trns[o] + " " + t.trns[o] + " "; n("/Mask [" + i + "]") } if ("smask" in t && n("/SMask " + (e + 1) + " 0 R"), n("/Length " + t.data.length + ">>"), s(t.data), n("endobj"), "smask" in t) { var u = "/Predictor 15 /Colors 1 /BitsPerComponent " + t.bpc + " /Columns " + t.w, c = { w: t.w, h: t.h, cs: "DeviceGray", bpc: t.bpc, dp: u, data: t.smask }; "f" in t && (c.f = t.f), r.call(this, c) } t.cs === this.color_spaces.INDEXED && (this.internal.newObject(), n("<< /Length " + t.pal.length + ">>"), s(this.arrayBufferToBinaryString(new Uint8Array(t.pal))), n("endobj")) }, s = function () { var t = this.internal.collections[e + "images"]; for (var n in t) r.call(this, t[n]) }, i = function () { var t, n = this.internal.collections[e + "images"], r = this.internal.write; for (var s in n) t = n[s], r("/I" + t.i, t.n, "0", "R") }, o = function (e) { return e && "string" == typeof e && (e = e.toUpperCase()), e in t.image_compression ? e : t.image_compression.NONE }, a = function () { var t = this.internal.collections[e + "images"]; return t || (this.internal.collections[e + "images"] = t = {}, this.internal.events.subscribe("putResources", s), this.internal.events.subscribe("putXobjectDict", i)), t }, u = function (t) { var e = 0; return t && (e = Object.keys ? Object.keys(t).length : function (t) { var e = 0; for (var n in t) t.hasOwnProperty(n) && e++; return e }(t)), e }, c = function (t) { return "undefined" == typeof t || null === t }, l = function (e) { return "string" == typeof e && t.sHashCode(e) }, f = function (t) { return -1 === n.indexOf(t) }, d = function (e) { return "function" != typeof t["process" + e.toUpperCase()] }, h = function (t) { return "object" == typeof t && 1 === t.nodeType }, p = function (t, e, n) { if ("IMG" === t.nodeName && t.hasAttribute("src")) { var r = "" + t.getAttribute("src"); if (!n && 0 === r.indexOf("data:image/")) return r; !e && /\.png(?:[?#].*)?$/i.test(r) && (e = "png") } if ("CANVAS" === t.nodeName) var s = t; else { var s = document.createElement("canvas"); s.width = t.clientWidth || t.width, s.height = t.clientHeight || t.height; var i = s.getContext("2d"); if (!i) throw "addImage requires canvas to be supported by browser."; if (n) { var o, a, u, c, l, f, d, h, p = Math.PI / 180; "object" == typeof n && (o = n.x, a = n.y, u = n.bg, n = n.angle), h = n * p, c = Math.abs(Math.cos(h)), l = Math.abs(Math.sin(h)), f = s.width, d = s.height, s.width = d * l + f * c, s.height = d * c + f * l, isNaN(o) && (o = s.width / 2), isNaN(a) && (a = s.height / 2), i.clearRect(0, 0, s.width, s.height), i.fillStyle = u || "white", i.fillRect(0, 0, s.width, s.height), i.save(), i.translate(o, a), i.rotate(h), i.drawImage(t, -(f / 2), -(d / 2)), i.rotate(-h), i.translate(-o, -a), i.restore() } else i.drawImage(t, 0, 0, s.width, s.height) } return s.toDataURL("png" == ("" + e).toLowerCase() ? "image/png" : "image/jpeg") }, m = function (t, e) { var n; if (e) for (var r in e) if (t === e[r].alias) { n = e[r]; break } return n }, w = function (t, e, n) { return t || e || (t = -96, e = -96), 0 > t && (t = -1 * n.w * 72 / t / this.internal.scaleFactor), 0 > e && (e = -1 * n.h * 72 / e / this.internal.scaleFactor), 0 === t && (t = e * n.w / n.h), 0 === e && (e = t * n.h / n.w), [t, e] }, g = function (t, e, n, r, s, i, o) { var a = w.call(this, n, r, s), u = this.internal.getCoordinateString, c = this.internal.getVerticalCoordinateString; n = a[0], r = a[1], o[i] = s, this.internal.write("q", u(n), "0 0", u(r), u(t), c(e + r), "cm /I" + s.i, "Do Q") }; t.color_spaces = { DEVICE_RGB: "DeviceRGB", DEVICE_GRAY: "DeviceGray", DEVICE_CMYK: "DeviceCMYK", CAL_GREY: "CalGray", CAL_RGB: "CalRGB", LAB: "Lab", ICC_BASED: "ICCBased", INDEXED: "Indexed", PATTERN: "Pattern", SEPERATION: "Seperation", DEVICE_N: "DeviceN" }, t.decode = { DCT_DECODE: "DCTDecode", FLATE_DECODE: "FlateDecode", LZW_DECODE: "LZWDecode", JPX_DECODE: "JPXDecode", JBIG2_DECODE: "JBIG2Decode", ASCII85_DECODE: "ASCII85Decode", ASCII_HEX_DECODE: "ASCIIHexDecode", RUN_LENGTH_DECODE: "RunLengthDecode", CCITT_FAX_DECODE: "CCITTFaxDecode" }, t.image_compression = { NONE: "NONE", FAST: "FAST", MEDIUM: "MEDIUM", SLOW: "SLOW" }, t.sHashCode = function (t) { return Array.prototype.reduce && t.split("").reduce(function (t, e) { return t = (t << 5) - t + e.charCodeAt(0), t & t }, 0) }, t.isString = function (t) { return "string" == typeof t }, t.extractInfoFromBase64DataURI = function (t) { return /^data:([\w]+?\/([\w]+?));base64,(.+?)$/g.exec(t) }, t.supportsArrayBuffer = function () { return "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array }, t.isArrayBuffer = function (t) { return this.supportsArrayBuffer() ? t instanceof ArrayBuffer : !1 }, t.isArrayBufferView = function (t) { return this.supportsArrayBuffer() ? "undefined" == typeof Uint32Array ? !1 : t instanceof Int8Array || t instanceof Uint8Array || "undefined" != typeof Uint8ClampedArray && t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array : !1 }, t.binaryStringToUint8Array = function (t) { for (var e = t.length, n = new Uint8Array(e), r = 0; e > r; r++) n[r] = t.charCodeAt(r); return n }, t.arrayBufferToBinaryString = function (t) { this.isArrayBuffer(t) && (t = new Uint8Array(t)); for (var e = "", n = t.byteLength, r = 0; n > r; r++) e += String.fromCharCode(t[r]); return e }, t.arrayBufferToBase64 = function (t) { for (var e, n, r, s, i, o = "", a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", u = new Uint8Array(t), c = u.byteLength, l = c % 3, f = c - l, d = 0; f > d; d += 3) i = u[d] << 16 | u[d + 1] << 8 | u[d + 2], e = (16515072 & i) >> 18, n = (258048 & i) >> 12, r = (4032 & i) >> 6, s = 63 & i, o += a[e] + a[n] + a[r] + a[s]; return 1 == l ? (i = u[f], e = (252 & i) >> 2, n = (3 & i) << 4, o += a[e] + a[n] + "==") : 2 == l && (i = u[f] << 8 | u[f + 1], e = (64512 & i) >> 10, n = (1008 & i) >> 4, r = (15 & i) << 2, o += a[e] + a[n] + a[r] + "="), o }, t.createImageInfo = function (t, e, n, r, s, i, o, a, u, c, l, f) { var d = { alias: a, w: e, h: n, cs: r, bpc: s, i: o, data: t }; return i && (d.f = i), u && (d.dp = u), c && (d.trns = c), l && (d.pal = l), f && (d.smask = f), d }, t.addImage = function (t, e, r, s, i, w, y, v, b) { if ("string" != typeof e) { var q = w; w = i, i = s, s = r, r = e, e = q } if ("object" == typeof t && !h(t) && "imageData" in t) { var x = t; t = x.imageData, e = x.format || e, r = x.x || r || 0, s = x.y || s || 0, i = x.w || i, w = x.h || w, y = x.alias || y, v = x.compression || v, b = x.rotation || x.angle || b } if (isNaN(r) || isNaN(s)) throw console.error("jsPDF.addImage: Invalid coordinates", arguments), new Error("Invalid coordinates passed to jsPDF.addImage"); var k, _ = a.call(this); if (!(k = m(t, _))) { var A; if (h(t) && (t = p(t, e, b)), c(y) && (y = l(t)), !(k = m(y, _))) { if (this.isString(t)) { var C = this.extractInfoFromBase64DataURI(t); C ? (e = C[2], t = atob(C[3])) : 137 === t.charCodeAt(0) && 80 === t.charCodeAt(1) && 78 === t.charCodeAt(2) && 71 === t.charCodeAt(3) && (e = "png") } if (e = (e || "JPEG").toLowerCase(), f(e)) throw new Error("addImage currently only supports formats " + n + ", not '" + e + "'"); if (d(e)) throw new Error("please ensure that the plugin for '" + e + "' support is added"); if (this.supportsArrayBuffer() && (A = t, t = this.binaryStringToUint8Array(t)), k = this["process" + e.toUpperCase()](t, u(_), y, o(v), A), !k) throw new Error("An unkwown error occurred whilst processing the image") } } return g.call(this, r, s, i, w, k, k.i, _), this }; var y = function (t) { var e, n, r; if (255 === !t.charCodeAt(0) || 216 === !t.charCodeAt(1) || 255 === !t.charCodeAt(2) || 224 === !t.charCodeAt(3) || !t.charCodeAt(6) === "J".charCodeAt(0) || !t.charCodeAt(7) === "F".charCodeAt(0) || !t.charCodeAt(8) === "I".charCodeAt(0) || !t.charCodeAt(9) === "F".charCodeAt(0) || 0 === !t.charCodeAt(10)) throw new Error("getJpegSize requires a binary string jpeg file"); for (var s = 256 * t.charCodeAt(4) + t.charCodeAt(5), i = 4, o = t.length; o > i;) { if (i += s, 255 !== t.charCodeAt(i)) throw new Error("getJpegSize could not find the size of the image"); if (192 === t.charCodeAt(i + 1) || 193 === t.charCodeAt(i + 1) || 194 === t.charCodeAt(i + 1) || 195 === t.charCodeAt(i + 1) || 196 === t.charCodeAt(i + 1) || 197 === t.charCodeAt(i + 1) || 198 === t.charCodeAt(i + 1) || 199 === t.charCodeAt(i + 1)) return n = 256 * t.charCodeAt(i + 5) + t.charCodeAt(i + 6), e = 256 * t.charCodeAt(i + 7) + t.charCodeAt(i + 8), r = t.charCodeAt(i + 9), [e, n, r]; i += 2, s = 256 * t.charCodeAt(i) + t.charCodeAt(i + 1) } }, v = function (t) { var e = t[0] << 8 | t[1]; if (65496 !== e) throw new Error("Supplied data is not a JPEG"); for (var n, r, s, i, o = t.length, a = (t[4] << 8) + t[5], u = 4; o > u;) { if (u += a, n = b(t, u), a = (n[2] << 8) + n[3], (192 === n[1] || 194 === n[1]) && 255 === n[0] && a > 7) return n = b(t, u + 5), r = (n[2] << 8) + n[3], s = (n[0] << 8) + n[1], i = n[4], { width: r, height: s, numcomponents: i }; u += 2 } throw new Error("getJpegSizeFromBytes could not find the size of the image") }, b = function (t, e) { return t.subarray(e, e + 5) }; t.processJPEG = function (t, e, n, r, s) { var i, o = this.color_spaces.DEVICE_RGB, a = this.decode.DCT_DECODE, u = 8; return this.isString(t) ? (i = y(t), this.createImageInfo(t, i[0], i[1], 1 == i[3] ? this.color_spaces.DEVICE_GRAY : o, u, a, e, n)) : (this.isArrayBuffer(t) && (t = new Uint8Array(t)), this.isArrayBufferView(t) ? (i = v(t), t = s || this.arrayBufferToBinaryString(t), this.createImageInfo(t, i.width, i.height, 1 == i.numcomponents ? this.color_spaces.DEVICE_GRAY : o, u, a, e, n)) : null) }, t.processJPG = function () { return this.processJPEG.apply(this, arguments) } }(n.API), function (t) { "use strict"; t.autoPrint = function () { var t; return this.internal.events.subscribe("postPutResources", function () { t = this.internal.newObject(), this.internal.write("<< /S/Named /Type/Action /N/Print >>", "endobj") }), this.internal.events.subscribe("putCatalog", function () { this.internal.write("/OpenAction " + t + " 0 R") }), this } }(n.API), function (t) { "use strict"; var e, n, r, s, i = 3, o = 13, a = { x: void 0, y: void 0, w: void 0, h: void 0, ln: void 0 }, u = 1, c = function (t, e, n, r, s) { a = { x: t, y: e, w: n, h: r, ln: s } }, l = function () { return a }, f = { left: 0, top: 0, bottom: 0 }; t.setHeaderFunction = function (t) { s = t }, t.getTextDimensions = function (t) { e = this.internal.getFont().fontName, n = this.table_font_size || this.internal.getFontSize(), r = this.internal.getFont().fontStyle; var s, i, o = 19.049976 / 25.4; return i = document.createElement("font"), i.id = "jsPDFCell", i.style.fontStyle = r, i.style.fontName = e, i.style.fontSize = n + "pt", i.textContent = t, document.body.appendChild(i), s = { w: (i.offsetWidth + 1) * o, h: (i.offsetHeight + 1) * o }, document.body.removeChild(i), s }, t.cellAddPage = function () { var t = this.margins || f; this.addPage(), c(t.left, t.top, void 0, void 0), u += 1 }, t.cellInitialize = function () { a = { x: void 0, y: void 0, w: void 0, h: void 0, ln: void 0 }, u = 1 }, t.cell = function (t, e, n, r, s, a, u) { var d = l(); if (void 0 !== d.ln) if (d.ln === a) t = d.x + d.w, e = d.y; else { var h = this.margins || f; d.y + d.h + r + o >= this.internal.pageSize.height - h.bottom && (this.cellAddPage(), this.printHeaders && this.tableHeaderRow && this.printHeaderRow(a, !0)), e = l().y + l().h } if (void 0 !== s[0]) if (this.printingHeaderRow ? this.rect(t, e, n, r, "FD") : this.rect(t, e, n, r), "right" === u) { if (s instanceof Array) for (var p = 0; p < s.length; p++) { var m = s[p], w = this.getStringUnitWidth(m) * this.internal.getFontSize(); this.text(m, t + n - w - i, e + this.internal.getLineHeight() * (p + 1)) } } else this.text(s, t + i, e + this.internal.getLineHeight()); return c(t, e, n, r, a), this }, t.arrayMax = function (t, e) { var n, r, s, i = t[0]; for (n = 0, r = t.length; r > n; n += 1) s = t[n], e ? -1 === e(i, s) && (i = s) : s > i && (i = s); return i }, t.table = function (e, n, r, s, i) { if (!r) throw "No data for PDF table"; var o, c, l, d, h, p, m, w, g, y, v = [], b = [], q = {}, x = {}, k = [], _ = [], A = !1, C = !0, S = 12, E = f; if (E.width = this.internal.pageSize.width, i && (i.autoSize === !0 && (A = !0), i.printHeaders === !1 && (C = !1), i.fontSize && (S = i.fontSize), i.margins && (E = i.margins)), this.lnMod = 0, a = { x: void 0, y: void 0, w: void 0, h: void 0, ln: void 0 }, u = 1, this.printHeaders = C, this.margins = E, this.setFontSize(S), this.table_font_size = S, void 0 === s || null === s) v = Object.keys(r[0]); else if (s[0] && "string" != typeof s[0]) { var z = 19.049976 / 25.4; for (c = 0, l = s.length; l > c; c += 1) o = s[c], v.push(o.name), b.push(o.prompt), x[o.name] = o.width * z } else v = s; if (A) for (y = function (t) { return t[o] }, c = 0, l = v.length; l > c; c += 1) { for (o = v[c], q[o] = r.map(y), k.push(this.getTextDimensions(b[c] || o).w), p = q[o], m = 0, d = p.length; d > m; m += 1) h = p[m], k.push(this.getTextDimensions(h).w); x[o] = t.arrayMax(k) } if (C) { var T = this.calculateLineHeight(v, x, b.length ? b : v); for (c = 0, l = v.length; l > c; c += 1) o = v[c], _.push([e, n, x[o], T, String(b.length ? b[c] : o)]); this.setTableHeaderRow(_), this.printHeaderRow(1, !1) } for (c = 0, l = r.length; l > c; c += 1) { var T; for (w = r[c], T = this.calculateLineHeight(v, x, w), m = 0, g = v.length; g > m; m += 1) o = v[m], this.cell(e, n, x[o], T, w[o], c + 2, o.align) } return this.lastCellPos = a, this.table_x = e, this.table_y = n, this }, t.calculateLineHeight = function (t, e, n) { for (var r, s = 0, o = 0; o < t.length; o++) { r = t[o], n[r] = this.splitTextToSize(String(n[r]), e[r] - i); var a = this.internal.getLineHeight() * n[r].length + i; a > s && (s = a) } return s }, t.setTableHeaderRow = function (t) { this.tableHeaderRow = t }, t.printHeaderRow = function (t, e) { if (!this.tableHeaderRow) throw "Property tableHeaderRow does not exist."; var n, r, i, o; if (this.printingHeaderRow = !0, void 0 !== s) { var a = s(this, u); c(a[0], a[1], a[2], a[3], -1) } this.setFontStyle("bold"); var l = []; for (i = 0, o = this.tableHeaderRow.length; o > i; i += 1) this.setFillColor(200, 200, 200), n = this.tableHeaderRow[i], e && (n[1] = this.margins && this.margins.top || 0, l.push(n)), r = [].concat(n), this.cell.apply(this, r.concat(t)); l.length > 0 && this.setTableHeaderRow(l), this.setFontStyle("normal"), this.printingHeaderRow = !1 } }(n.API), function (t) { var e, n, r, s, i, o, a, u, c, l, f, d, h, p, m, w, g, y, v; e = function () { function t() { } return function (e) { return t.prototype = e, new t } }(), c = function (t) { var e, n, r, s, i, o, a; for (n = 0, r = t.length, e = void 0, s = !1, o = !1; !s && n !== r;) e = t[n] = t[n].trimLeft(), e && (s = !0), n++; for (n = r - 1; r && !o && -1 !== n;) e = t[n] = t[n].trimRight(), e && (o = !0), n--; for (i = /\s+$/g, a = !0, n = 0; n !== r;) e = t[n].replace(/\s+/g, " "), a && (e = e.trimLeft()), e && (a = i.test(e)), t[n] = e, n++; return t }, l = function (t, e, n, r) { return this.pdf = t, this.x = e, this.y = n, this.settings = r, this.watchFunctions = [], this.init(), this }, f = function (t) { var e, n, s; for (e = void 0, s = t.split(","), n = s.shift() ; !e && n;) e = r[n.trim().toLowerCase()], n = s.shift(); return e }, d = function (t) { t = "auto" === t ? "0px" : t, t.indexOf("em") > -1 && !isNaN(Number(t.replace("em", ""))) && (t = 18.719 * Number(t.replace("em", "")) + "px"), t.indexOf("pt") > -1 && !isNaN(Number(t.replace("pt", ""))) && (t = 1.333 * Number(t.replace("pt", "")) + "px"); var e, n, r; return n = void 0, e = 16, (r = h[t]) ? r : (r = { "xx-small": 9, "x-small": 11, small: 13, medium: 16, large: 19, "x-large": 23, "xx-large": 28, auto: 0 }[{ css_line_height_string: t }], r !== n ? h[t] = r / e : (r = parseFloat(t)) ? h[t] = r / e : (r = t.match(/([\d\.]+)(px)/), h[t] = 3 === r.length ? parseFloat(r[1]) / e : 1)) }, u = function (t) { var e, n, r; return r = function (t) { var e; return e = function (t) { return document.defaultView && document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(t, null) : t.currentStyle ? t.currentStyle : t.style }(t), function (t) { return t = t.replace(/-\D/g, function (t) { return t.charAt(1).toUpperCase() }), e[t] } }(t), e = {}, n = void 0, e["font-family"] = f(r("font-family")) || "times", e["font-style"] = s[r("font-style")] || "normal", e["text-align"] = TextAlignMap[r("text-align")] || "left", n = i[r("font-weight")] || "normal", "bold" === n && (e["font-style"] = "normal" === e["font-style"] ? n : n + e["font-style"]), e["font-size"] = d(r("font-size")) || 1, e["line-height"] = d(r("line-height")) || 1, e.display = "inline" === r("display") ? "inline" : "block", n = "block" === e.display, e["margin-top"] = n && d(r("margin-top")) || 0, e["margin-bottom"] = n && d(r("margin-bottom")) || 0, e["padding-top"] = n && d(r("padding-top")) || 0, e["padding-bottom"] = n && d(r("padding-bottom")) || 0, e["margin-left"] = n && d(r("margin-left")) || 0, e["margin-right"] = n && d(r("margin-right")) || 0, e["padding-left"] = n && d(r("padding-left")) || 0, e["padding-right"] = n && d(r("padding-right")) || 0, e["float"] = o[r("cssFloat")] || "none", e.clear = a[r("clear")] || "none", e }, p = function (t, e, n) { var r, s, i, o, a; if (i = !1, s = void 0, o = void 0, a = void 0, r = n["#" + t.id]) if ("function" == typeof r) i = r(t, e); else for (s = 0, o = r.length; !i && s !== o;) i = r[s](t, e), s++; if (r = n[t.nodeName], !i && r) if ("function" == typeof r) i = r(t, e); else for (s = 0, o = r.length; !i && s !== o;) i = r[s](t, e), s++; return i }, v = function (t, e) { var n, r, s, i, o, a, u, c, l, f; for (n = [], r = [], s = 0, f = t.rows[0].cells.length, c = t.clientWidth; f > s;) l = t.rows[0].cells[s], r[s] = { name: l.textContent.toLowerCase().replace(/\s+/g, ""), prompt: l.textContent.replace(/\r?\n/g, ""), width: l.clientWidth / c * e.pdf.internal.pageSize.width }, s++; for (s = 1; s < t.rows.length;) { for (a = t.rows[s], o = {}, i = 0; i < a.cells.length;) o[r[i].name] = a.cells[i].textContent.replace(/\r?\n/g, ""), i++; n.push(o), s++ } return u = { rows: n, headers: r } }; var b = { SCRIPT: 1, STYLE: 1, NOSCRIPT: 1, OBJECT: 1, EMBED: 1, SELECT: 1 }, q = 1; n = function (t, e, r) { var s, i, o, a, c, l, f, d, h; for (i = t.childNodes, s = void 0, o = u(t), c = "block" === o.display, c && (e.setBlockBoundary(), e.setBlockStyle(o)), f = 19.049976 / 25.4, a = 0, l = i.length; l > a;) { if (s = i[a], "object" == typeof s) { if (e.executeWatchFunctions(s), 1 === s.nodeType && "HEADER" === s.nodeName) { var w = s, g = e.pdf.margins_doc.top; e.pdf.internal.events.subscribe("addPage", function () { e.y = g, n(w, e, r), e.pdf.margins_doc.top = e.y + 10, e.y += 10 }, !1) } if (8 === s.nodeType && "#comment" === s.nodeName) ~s.textContent.indexOf("ADD_PAGE") && (e.pdf.addPage(), e.y = e.pdf.margins_doc.top); else if (1 !== s.nodeType || b[s.nodeName]) if (3 === s.nodeType) { var y = s.nodeValue; if (s.nodeValue && "LI" === s.parentNode.nodeName) if ("OL" === s.parentNode.parentNode.nodeName) y = q++ + ". " + y; else { var x = 16 * o["font-size"], k = 2; x > 20 && (k = 3), h = function (t, e) { this.pdf.circle(t, e, k, "FD") } } e.addText(y, o) } else "string" == typeof s && e.addText(s, o); else { var _; if ("IMG" === s.nodeName) { var A = s.getAttribute("src"); _ = m[e.pdf.sHashCode(A) || A] } if (_) { e.pdf.internal.pageSize.height - e.pdf.margins_doc.bottom < e.y + s.height && e.y > e.pdf.margins_doc.top && (e.pdf.addPage(), e.y = e.pdf.margins_doc.top, e.executeWatchFunctions(s)); var C = u(s), S = e.x, E = 12 / e.pdf.internal.scaleFactor, z = (C["margin-left"] + C["padding-left"]) * E, T = (C["margin-right"] + C["padding-right"]) * E, I = (C["margin-top"] + C["padding-top"]) * E, B = (C["margin-bottom"] + C["padding-bottom"]) * E; S += void 0 !== C["float"] && "right" === C["float"] ? e.settings.width - s.width - T : z, e.pdf.addImage(_, S, e.y + I, s.width, s.height), _ = void 0, "right" === C["float"] || "left" === C["float"] ? (e.watchFunctions.push(function (t, n, r, s) { return e.y >= n ? (e.x += t, e.settings.width += r, !0) : s && 1 === s.nodeType && !b[s.nodeName] && e.x + s.width > e.pdf.margins_doc.left + e.pdf.margins_doc.width ? (e.x += t, e.y = n, e.settings.width += r, !0) : !1 }.bind(this, "left" === C["float"] ? -s.width - z - T : 0, e.y + s.height + I + B, s.width)), e.watchFunctions.push(function (t, n, r) { return e.y < t && n === e.pdf.internal.getNumberOfPages() ? 1 === r.nodeType && "both" === u(r).clear ? (e.y = t, !0) : !1 : !0 }.bind(this, e.y + s.height, e.pdf.internal.getNumberOfPages())), e.settings.width -= s.width + z + T, "left" === C["float"] && (e.x += s.width + z + T)) : e.y += s.height + B } else if ("TABLE" === s.nodeName) d = v(s, e), e.y += 10, e.pdf.table(e.x, e.y, d.rows, d.headers, { autoSize: !1, printHeaders: !0, margins: e.pdf.margins_doc }), e.y = e.pdf.lastCellPos.y + e.pdf.lastCellPos.h + 20; else if ("OL" === s.nodeName || "UL" === s.nodeName) q = 1, p(s, e, r) || n(s, e, r), e.y += 10; else if ("LI" === s.nodeName) { var O = e.x; e.x += "UL" === s.parentNode.nodeName ? 22 : 10, e.y += 3, p(s, e, r) || n(s, e, r), e.x = O } else "BR" === s.nodeName ? e.y += o["font-size"] * e.pdf.internal.scaleFactor : p(s, e, r) || n(s, e, r) } } a++ } return c ? e.setBlockBoundary(h) : void 0 }, m = {}, w = function (t, e, n, r) { function s() { e.pdf.internal.events.publish("imagesLoaded"), r(o) } function i(t, n, r) { if (t) { var i = new Image; o = ++c, i.crossOrigin = "", i.onerror = i.onload = function () { if (i.complete && (0 === i.src.indexOf("data:image/") && (i.width = n || i.width || 0, i.height = r || i.height || 0), i.width + i.height)) { var o = e.pdf.sHashCode(t) || t; m[o] = m[o] || i } --c || s() }, i.src = t } } for (var o, a = t.getElementsByTagName("img"), u = a.length, c = 0; u--;) i(a[u].getAttribute("src"), a[u].width, a[u].height); return c || s() }, g = function (t, e, r) { var s = t.getElementsByTagName("footer"); if (s.length > 0) { s = s[0]; var i = e.pdf.internal.write, o = e.y; e.pdf.internal.write = function () { }, n(s, e, r); var a = Math.ceil(e.y - o) + 5; e.y = o, e.pdf.internal.write = i, e.pdf.margins_doc.bottom += a; for (var u = function (t) { var i = void 0 !== t ? t.pageNumber : 1, o = e.y; e.y = e.pdf.internal.pageSize.height - e.pdf.margins_doc.bottom, e.pdf.margins_doc.bottom -= a; for (var u = s.getElementsByTagName("span"), c = 0; c < u.length; ++c) (" " + u[c].className + " ").replace(/[\n\t]/g, " ").indexOf(" pageCounter ") > -1 && (u[c].innerHTML = i), (" " + u[c].className + " ").replace(/[\n\t]/g, " ").indexOf(" totalPages ") > -1 && (u[c].innerHTML = "###jsPDFVarTotalPages###"); n(s, e, r), e.pdf.margins_doc.bottom += a, e.y = o }, c = s.getElementsByTagName("span"), l = 0; l < c.length; ++l) (" " + c[l].className + " ").replace(/[\n\t]/g, " ").indexOf(" totalPages ") > -1 && e.pdf.internal.events.subscribe("htmlRenderingFinished", e.pdf.putTotalPages.bind(e.pdf, "###jsPDFVarTotalPages###"), !0); e.pdf.internal.events.subscribe("addPage", u, !1), u(), b.FOOTER = 1 } }, y = function (t, e, r, s, i, o) { if (!e) return !1; "string" == typeof e || e.parentNode || (e = "" + e.innerHTML), "string" == typeof e && (e = function (t) { var e, n, r, s; return r = "jsPDFhtmlText" + Date.now().toString() + (1e3 * Math.random()).toFixed(0), s = "position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;", n = document.createElement("div"), n.style.cssText = s, n.innerHTML = '