From fa2ec6de3de457ee65e170bb403b2c2672f32d5a Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Thu, 17 Jul 2014 06:58:43 -0700 Subject: [PATCH] Added tooltips --- client/components/jquery/bootstrap.js | 529 ++++++++++++++++++++++++++ client/css/bootstrap.css | 287 +++++++++++++- client/css/style.css | 12 +- client/index.html | 34 +- client/js/chat.js | 83 ++-- client/js/components.min.js | 8 +- 6 files changed, 877 insertions(+), 76 deletions(-) create mode 100644 client/components/jquery/bootstrap.js diff --git a/client/components/jquery/bootstrap.js b/client/components/jquery/bootstrap.js new file mode 100644 index 0000000..9de50ff --- /dev/null +++ b/client/components/jquery/bootstrap.js @@ -0,0 +1,529 @@ +/*! + * Bootstrap v3.2.0 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +/*! + * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=242b77ebf84da0cd12cf) + * Config saved to config.json and https://gist.github.com/242b77ebf84da0cd12cf + */ +if (typeof jQuery === "undefined") { throw new Error("Bootstrap's JavaScript requires jQuery") } + +/* ======================================================================== + * Bootstrap: tooltip.js v3.2.0 + * http://getbootstrap.com/javascript/#tooltip + * Inspired by the original jQuery.tipsy by Jason Frame + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // TOOLTIP PUBLIC CLASS DEFINITION + // =============================== + + var Tooltip = function (element, options) { + this.type = + this.options = + this.enabled = + this.timeout = + this.hoverState = + this.$element = null + + this.init('tooltip', element, options) + } + + Tooltip.VERSION = '3.2.0' + + Tooltip.DEFAULTS = { + animation: true, + placement: 'top', + selector: false, + template: '', + trigger: 'hover focus', + title: '', + delay: 0, + html: false, + container: false, + viewport: { + selector: 'body', + padding: 0 + } + } + + Tooltip.prototype.init = function (type, element, options) { + this.enabled = true + this.type = type + this.$element = $(element) + this.options = this.getOptions(options) + this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport) + + var triggers = this.options.trigger.split(' ') + + for (var i = triggers.length; i--;) { + var trigger = triggers[i] + + if (trigger == 'click') { + this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) + } else if (trigger != 'manual') { + var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' + var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' + + this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) + this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) + } + } + + this.options.selector ? + (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : + this.fixTitle() + } + + Tooltip.prototype.getDefaults = function () { + return Tooltip.DEFAULTS + } + + Tooltip.prototype.getOptions = function (options) { + options = $.extend({}, this.getDefaults(), this.$element.data(), options) + + if (options.delay && typeof options.delay == 'number') { + options.delay = { + show: options.delay, + hide: options.delay + } + } + + return options + } + + Tooltip.prototype.getDelegateOptions = function () { + var options = {} + var defaults = this.getDefaults() + + this._options && $.each(this._options, function (key, value) { + if (defaults[key] != value) options[key] = value + }) + + return options + } + + Tooltip.prototype.enter = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget).data('bs.' + this.type) + + if (!self) { + self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) + $(obj.currentTarget).data('bs.' + this.type, self) + } + + clearTimeout(self.timeout) + + self.hoverState = 'in' + + if (!self.options.delay || !self.options.delay.show) return self.show() + + self.timeout = setTimeout(function () { + if (self.hoverState == 'in') self.show() + }, self.options.delay.show) + } + + Tooltip.prototype.leave = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget).data('bs.' + this.type) + + if (!self) { + self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) + $(obj.currentTarget).data('bs.' + this.type, self) + } + + clearTimeout(self.timeout) + + self.hoverState = 'out' + + if (!self.options.delay || !self.options.delay.hide) return self.hide() + + self.timeout = setTimeout(function () { + if (self.hoverState == 'out') self.hide() + }, self.options.delay.hide) + } + + Tooltip.prototype.show = function () { + var e = $.Event('show.bs.' + this.type) + + if (this.hasContent() && this.enabled) { + this.$element.trigger(e) + + var inDom = $.contains(document.documentElement, this.$element[0]) + if (e.isDefaultPrevented() || !inDom) return + var that = this + + var $tip = this.tip() + + var tipId = this.getUID(this.type) + + this.setContent() + $tip.attr('id', tipId) + this.$element.attr('aria-describedby', tipId) + + if (this.options.animation) $tip.addClass('fade') + + var placement = typeof this.options.placement == 'function' ? + this.options.placement.call(this, $tip[0], this.$element[0]) : + this.options.placement + + var autoToken = /\s?auto?\s?/i + var autoPlace = autoToken.test(placement) + if (autoPlace) placement = placement.replace(autoToken, '') || 'top' + + $tip + .detach() + .css({ top: 0, left: 0, display: 'block' }) + .addClass(placement) + .data('bs.' + this.type, this) + + this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) + + var pos = this.getPosition() + var actualWidth = $tip[0].offsetWidth + var actualHeight = $tip[0].offsetHeight + + if (autoPlace) { + var orgPlacement = placement + var $parent = this.$element.parent() + var parentDim = this.getPosition($parent) + + placement = placement == 'bottom' && pos.top + pos.height + actualHeight - parentDim.scroll > parentDim.height ? 'top' : + placement == 'top' && pos.top - parentDim.scroll - actualHeight < 0 ? 'bottom' : + placement == 'right' && pos.right + actualWidth > parentDim.width ? 'left' : + placement == 'left' && pos.left - actualWidth < parentDim.left ? 'right' : + placement + + $tip + .removeClass(orgPlacement) + .addClass(placement) + } + + var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) + + this.applyPlacement(calculatedOffset, placement) + + var complete = function () { + that.$element.trigger('shown.bs.' + that.type) + that.hoverState = null + } + + $.support.transition && this.$tip.hasClass('fade') ? + $tip + .one('bsTransitionEnd', complete) + .emulateTransitionEnd(150) : + complete() + } + } + + Tooltip.prototype.applyPlacement = function (offset, placement) { + var $tip = this.tip() + var width = $tip[0].offsetWidth + var height = $tip[0].offsetHeight + + // manually read margins because getBoundingClientRect includes difference + var marginTop = parseInt($tip.css('margin-top'), 10) + var marginLeft = parseInt($tip.css('margin-left'), 10) + + // we must check for NaN for ie 8/9 + if (isNaN(marginTop)) marginTop = 0 + if (isNaN(marginLeft)) marginLeft = 0 + + offset.top = offset.top + marginTop + offset.left = offset.left + marginLeft + + // $.fn.offset doesn't round pixel values + // so we use setOffset directly with our own function B-0 + $.offset.setOffset($tip[0], $.extend({ + using: function (props) { + $tip.css({ + top: Math.round(props.top), + left: Math.round(props.left) + }) + } + }, offset), 0) + + $tip.addClass('in') + + // check to see if placing tip in new offset caused the tip to resize itself + var actualWidth = $tip[0].offsetWidth + var actualHeight = $tip[0].offsetHeight + + if (placement == 'top' && actualHeight != height) { + offset.top = offset.top + height - actualHeight + } + + var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) + + if (delta.left) offset.left += delta.left + else offset.top += delta.top + + var arrowDelta = delta.left ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight + var arrowPosition = delta.left ? 'left' : 'top' + var arrowOffsetPosition = delta.left ? 'offsetWidth' : 'offsetHeight' + + $tip.offset(offset) + this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], arrowPosition) + } + + Tooltip.prototype.replaceArrow = function (delta, dimension, position) { + this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '') + } + + Tooltip.prototype.setContent = function () { + var $tip = this.tip() + var title = this.getTitle() + + $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) + $tip.removeClass('fade in top bottom left right') + } + + Tooltip.prototype.hide = function () { + var that = this + var $tip = this.tip() + var e = $.Event('hide.bs.' + this.type) + + this.$element.removeAttr('aria-describedby') + + function complete() { + if (that.hoverState != 'in') $tip.detach() + that.$element.trigger('hidden.bs.' + that.type) + } + + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return + + $tip.removeClass('in') + + $.support.transition && this.$tip.hasClass('fade') ? + $tip + .one('bsTransitionEnd', complete) + .emulateTransitionEnd(150) : + complete() + + this.hoverState = null + + return this + } + + Tooltip.prototype.fixTitle = function () { + var $e = this.$element + if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') { + $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') + } + } + + Tooltip.prototype.hasContent = function () { + return this.getTitle() + } + + Tooltip.prototype.getPosition = function ($element) { + $element = $element || this.$element + var el = $element[0] + var isBody = el.tagName == 'BODY' + return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, { + scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(), + width: isBody ? $(window).width() : $element.outerWidth(), + height: isBody ? $(window).height() : $element.outerHeight() + }, isBody ? { top: 0, left: 0 } : $element.offset()) + } + + Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { + return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : + /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } + + } + + Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { + var delta = { top: 0, left: 0 } + if (!this.$viewport) return delta + + var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 + var viewportDimensions = this.getPosition(this.$viewport) + + if (/right|left/.test(placement)) { + var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll + var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight + if (topEdgeOffset < viewportDimensions.top) { // top overflow + delta.top = viewportDimensions.top - topEdgeOffset + } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow + delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset + } + } else { + var leftEdgeOffset = pos.left - viewportPadding + var rightEdgeOffset = pos.left + viewportPadding + actualWidth + if (leftEdgeOffset < viewportDimensions.left) { // left overflow + delta.left = viewportDimensions.left - leftEdgeOffset + } else if (rightEdgeOffset > viewportDimensions.width) { // right overflow + delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset + } + } + + return delta + } + + Tooltip.prototype.getTitle = function () { + var title + var $e = this.$element + var o = this.options + + title = $e.attr('data-original-title') + || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) + + return title + } + + Tooltip.prototype.getUID = function (prefix) { + do prefix += ~~(Math.random() * 1000000) + while (document.getElementById(prefix)) + return prefix + } + + Tooltip.prototype.tip = function () { + return (this.$tip = this.$tip || $(this.options.template)) + } + + Tooltip.prototype.arrow = function () { + return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) + } + + Tooltip.prototype.validate = function () { + if (!this.$element[0].parentNode) { + this.hide() + this.$element = null + this.options = null + } + } + + Tooltip.prototype.enable = function () { + this.enabled = true + } + + Tooltip.prototype.disable = function () { + this.enabled = false + } + + Tooltip.prototype.toggleEnabled = function () { + this.enabled = !this.enabled + } + + Tooltip.prototype.toggle = function (e) { + var self = this + if (e) { + self = $(e.currentTarget).data('bs.' + this.type) + if (!self) { + self = new this.constructor(e.currentTarget, this.getDelegateOptions()) + $(e.currentTarget).data('bs.' + this.type, self) + } + } + + self.tip().hasClass('in') ? self.leave(self) : self.enter(self) + } + + Tooltip.prototype.destroy = function () { + clearTimeout(this.timeout) + this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) + } + + + // TOOLTIP PLUGIN DEFINITION + // ========================= + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.tooltip') + var options = typeof option == 'object' && option + + if (!data && option == 'destroy') return + if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.tooltip + + $.fn.tooltip = Plugin + $.fn.tooltip.Constructor = Tooltip + + + // TOOLTIP NO CONFLICT + // =================== + + $.fn.tooltip.noConflict = function () { + $.fn.tooltip = old + return this + } + +}(jQuery); + +/* ======================================================================== + * Bootstrap: transition.js v3.2.0 + * http://getbootstrap.com/javascript/#transitions + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // ============================================================ + + function transitionEnd() { + var el = document.createElement('bootstrap') + + var transEndEventNames = { + WebkitTransition : 'webkitTransitionEnd', + MozTransition : 'transitionend', + OTransition : 'oTransitionEnd otransitionend', + transition : 'transitionend' + } + + for (var name in transEndEventNames) { + if (el.style[name] !== undefined) { + return { end: transEndEventNames[name] } + } + } + + return false // explicit for ie8 ( ._.) + } + + // http://blog.alexmaccaw.com/css-transitions + $.fn.emulateTransitionEnd = function (duration) { + var called = false + var $el = this + $(this).one('bsTransitionEnd', function () { called = true }) + var callback = function () { if (!called) $($el).trigger($.support.transition.end) } + setTimeout(callback, duration) + return this + } + + $(function () { + $.support.transition = transitionEnd() + + if (!$.support.transition) return + + $.event.special.bsTransitionEnd = { + bindType: $.support.transition.end, + delegateType: $.support.transition.end, + handle: function (e) { + if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) + } + } + }) + +}(jQuery); diff --git a/client/css/bootstrap.css b/client/css/bootstrap.css index 253f179..e9b1d71 100644 --- a/client/css/bootstrap.css +++ b/client/css/bootstrap.css @@ -1,10 +1,14 @@ /*! - * Bootstrap v3.1.1 (http://getbootstrap.com) + * Bootstrap v3.2.0 (http://getbootstrap.com) * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -/*! normalize.css v3.0.0 | MIT License | git.io/normalize */ +/*! + * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=242b77ebf84da0cd12cf) + * Config saved to config.json and https://gist.github.com/242b77ebf84da0cd12cf + */ +/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ html { font-family: sans-serif; -ms-text-size-adjust: 100%; @@ -196,7 +200,7 @@ th { box-sizing: border-box; } html { - font-size: 62.5%; + font-size: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { @@ -236,6 +240,7 @@ img { } .img-responsive { display: block; + width: 100% \9; max-width: 100%; height: auto; } @@ -249,8 +254,10 @@ img { border: 1px solid #dddddd; border-radius: 4px; -webkit-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; display: inline-block; + width: 100% \9; max-width: 100%; height: auto; } @@ -273,6 +280,15 @@ hr { clip: rect(0, 0, 0, 0); border: 0; } +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} h1, h2, h3, @@ -316,7 +332,7 @@ h6 .small, .h6 .small { font-weight: normal; line-height: 1; - color: #999999; + color: #777777; } h1, .h1, @@ -394,7 +410,7 @@ p { .lead { margin-bottom: 20px; font-size: 16px; - font-weight: 200; + font-weight: 300; line-height: 1.4; } @media (min-width: 768px) { @@ -409,6 +425,11 @@ small, cite { font-style: normal; } +mark, +.mark { + background-color: #fcf8e3; + padding: .2em; +} .text-left { text-align: left; } @@ -421,8 +442,20 @@ cite { .text-justify { text-align: justify; } +.text-nowrap { + white-space: nowrap; +} +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} .text-muted { - color: #999999; + color: #777777; } .text-primary { color: #428bca; @@ -546,7 +579,7 @@ dd { abbr[title], abbr[data-original-title] { cursor: help; - border-bottom: 1px dotted #999999; + border-bottom: 1px dotted #777777; } .initialism { font-size: 90%; @@ -569,7 +602,7 @@ blockquote .small { display: block; font-size: 80%; line-height: 1.42857143; - color: #999999; + color: #777777; } blockquote footer:before, blockquote small:before, @@ -722,7 +755,7 @@ address { right: 8.33333333%; } .col-xs-pull-0 { - right: 0%; + right: auto; } .col-xs-push-12 { left: 100%; @@ -761,7 +794,7 @@ address { left: 8.33333333%; } .col-xs-push-0 { - left: 0%; + left: auto; } .col-xs-offset-12 { margin-left: 100%; @@ -879,7 +912,7 @@ address { right: 8.33333333%; } .col-sm-pull-0 { - right: 0%; + right: auto; } .col-sm-push-12 { left: 100%; @@ -918,7 +951,7 @@ address { left: 8.33333333%; } .col-sm-push-0 { - left: 0%; + left: auto; } .col-sm-offset-12 { margin-left: 100%; @@ -960,8 +993,137 @@ address { margin-left: 0%; } } +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +tr.collapse.in { + display: table-row; +} +tbody.collapse.in { + display: table-row-group; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height 0.35s ease; + -o-transition: height 0.35s ease; + transition: height 0.35s ease; +} +.tooltip { + position: absolute; + z-index: 1070; + display: block; + visibility: visible; + font-size: 12px; + line-height: 1.4; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.9; + filter: alpha(opacity=90); +} +.tooltip.top { + margin-top: -3px; + padding: 5px 0; +} +.tooltip.right { + margin-left: 3px; + padding: 0 5px; +} +.tooltip.bottom { + margin-top: 3px; + padding: 5px 0; +} +.tooltip.left { + margin-left: -3px; + padding: 0 5px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-left .tooltip-arrow { + bottom: 0; + left: 5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + right: 5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + left: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + right: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} .clearfix:before, .clearfix:after, +.dl-horizontal dd:before, +.dl-horizontal dd:after, .container:before, .container:after, .container-fluid:before, @@ -972,6 +1134,7 @@ address { display: table; } .clearfix:after, +.dl-horizontal dd:after, .container:after, .container-fluid:after, .row:after { @@ -1010,6 +1173,8 @@ address { } .affix { position: fixed; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); } @-ms-viewport { width: device-width; @@ -1020,6 +1185,20 @@ address { .visible-lg { display: none !important; } +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block { + display: none !important; +} @media (max-width: 767px) { .visible-xs { display: block !important; @@ -1035,6 +1214,21 @@ address { display: table-cell !important; } } +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; + } +} @media (min-width: 768px) and (max-width: 991px) { .visible-sm { display: block !important; @@ -1050,6 +1244,21 @@ address { display: table-cell !important; } } +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; + } +} @media (min-width: 992px) and (max-width: 1199px) { .visible-md { display: block !important; @@ -1065,6 +1274,21 @@ address { display: table-cell !important; } } +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; + } +} @media (min-width: 1200px) { .visible-lg { display: block !important; @@ -1080,6 +1304,21 @@ address { display: table-cell !important; } } +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; + } +} @media (max-width: 767px) { .hidden-xs { display: none !important; @@ -1118,6 +1357,30 @@ address { display: table-cell !important; } } +.visible-print-block { + display: none !important; +} +@media print { + .visible-print-block { + display: block !important; + } +} +.visible-print-inline { + display: none !important; +} +@media print { + .visible-print-inline { + display: inline !important; + } +} +.visible-print-inline-block { + display: none !important; +} +@media print { + .visible-print-inline-block { + display: inline-block !important; + } +} @media print { .hidden-print { display: none !important; diff --git a/client/css/style.css b/client/css/style.css index d9f5d52..26afb10 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -39,6 +39,14 @@ button { outline: none; padding: 0; } +.tooltip-inner { + background: #fff; + border-radius: 2px; + color: #262c36; +} +.tooltip.top .tooltip-arrow { + border-top-color: #fff; +} .btn { border: 2px solid #95a5a6; border: 2px solid #84d1ff; @@ -257,7 +265,7 @@ button { #header button:hover { opacity: 1; } -#header #lt { +#header #lt { left: 4px; text-align: left; } @@ -611,4 +619,4 @@ button { #windows .title { display: none; } -} \ No newline at end of file +} diff --git a/client/index.html b/client/index.html index 03e0de3..754d6a7 100644 --- a/client/index.html +++ b/client/index.html @@ -1,23 +1,23 @@ - + - + Shout - + "> - + - + - +
@@ -36,7 +36,7 @@

- +
@@ -147,7 +147,7 @@
- +
- + - + - + - +
- + - + - \ No newline at end of file + diff --git a/client/js/chat.js b/client/js/chat.js index 2e597c0..14c7681 100644 --- a/client/js/chat.js +++ b/client/js/chat.js @@ -27,25 +27,26 @@ $(function() { "/voice", "/whois" ]; - + var sidebar = $("#sidebar"); var chat = $("#chat"); - + var pop = new Audio(); pop.src = "/audio/pop.ogg"; - + $("#play").on("click", function() { pop.play(); }); - + $("#footer button").tooltip(); + var favico = new Favico({ animation: "none" }); - + var tpl = []; function render(name, data) { tpl[name] = tpl[name] || Handlebars.compile($("#templates ." + name).html()); return tpl[name](data); } - + Handlebars.registerHelper( "partial", function(id) { return new Handlebars.SafeString(render(id, this)); @@ -55,13 +56,13 @@ $(function() { socket.on("auth", function(data) { console.log(data); }); - + socket.on("init", function(data) { if (data.networks.length === 0) { $("#footer").find(".connect").trigger("click"); return; } - + sidebar.find(".networks").append( render("networks", { networks: data.networks @@ -75,7 +76,7 @@ $(function() { channels: channels }) ); - + var id = $.cookie("target"); var target = sidebar.find("[data-target=" + id + "]").trigger("click"); if (target.length === 0) { @@ -87,7 +88,7 @@ $(function() { } } }); - + socket.on("join", function(data) { var id = data.network; var network = sidebar.find("#network-" + id); @@ -105,7 +106,7 @@ $(function() { .last() .trigger("click"); }); - + socket.on("msg", function(data) { var target = data.chan; if (data.msg.type == "error") { @@ -120,7 +121,7 @@ $(function() { data.msg ]); }); - + socket.on("network", function(data) { sidebar.find(".empty").hide(); sidebar.find(".networks").append( @@ -142,11 +143,11 @@ $(function() { .find("input") .val(""); }); - + socket.on("nick", function(data) { console.log(data); }); - + socket.on("part", function(data) { var id = data.chan; sidebar.find("[data-target=#chan-" + id + "]") @@ -156,7 +157,7 @@ $(function() { .eq(0) .trigger("click"); }); - + socket.on("quit", function(data) { var id = data.network; sidebar.find("#network-" + id) @@ -166,13 +167,13 @@ $(function() { .eq(0) .trigger("click"); }); - + socket.on("users", function(data) { chat.find("#chan-" + data.chan) .find(".users") .html(render("users", data)); }); - + $.cookie.json = true; var settings = $("#settings"); var options = $.extend({ @@ -183,13 +184,13 @@ $(function() { part: true, quit: true, }, $.cookie("settings")); - + for (var i in options) { if (options[i]) { settings.find("input[name=" + i + "]").prop("checked", true); } } - + settings.on("change", "input", function() { var self = $(this); var name = self.attr("name"); @@ -207,7 +208,7 @@ $(function() { }).find("input") .eq(0) .trigger("change"); - + var viewport = $("#viewport"); $("#rt, #lt").on("click", function(e) { var self = $(this); @@ -219,11 +220,11 @@ $(function() { }); } }); - + var input = $("#input") .history() .tab(complete, {hint: false}); - + var form = $("#form").on("submit", function(e) { e.preventDefault(); var text = input.val(); @@ -233,7 +234,7 @@ $(function() { text: text }); }); - + var top = 1; sidebar.on("click", "button:not(.active)", function() { var self = $(this); @@ -241,27 +242,27 @@ $(function() { if (!target) { return; } - + $.cookie("target", target); chat.data( "id", self.data("id") ); - + sidebar.find(".active").removeClass("active"); self.addClass("active") .find(".badge") .removeClass("highlight") .empty(); - + if (sidebar.find(".highlight").length == 0) { favico.badge(""); } - + $("#rt").toggle(self.hasClass("chan")); $("#header").find("h1").html(self.data("title")); viewport.removeClass(); - + $("#windows .active").removeClass("active"); var chan = $(target) .css("z-index", top++) @@ -269,7 +270,7 @@ $(function() { .find(".chat") .sticky(); }); - + sidebar.on("click", ".close", function() { var cmd = "/close"; var chan = $(this).closest(".chan"); @@ -294,7 +295,7 @@ $(function() { }); return false; }); - + chat.on("input", ".search", function() { var value = $(this).val(); var names = $(this).closest(".users").find(".names"); @@ -308,7 +309,7 @@ $(function() { } }); }); - + chat.on("click", ".user", function() { var user = $(this).html().trim().replace(/[+%@~]/, ""); if (user.indexOf("#") !== -1) { @@ -320,7 +321,7 @@ $(function() { text: text }); }); - + chat.on("msg", ".messages", function(e, target, msg) { var type = msg.type; var highlight = type.contains("highlight"); @@ -330,12 +331,12 @@ $(function() { favico.badge("!"); } } - + var btn = sidebar.find(".chan[data-target=" + target + "]:not(.active)"); if (btn.length === 0) { return; } - + var ignore = [ "join", "part", @@ -345,7 +346,7 @@ $(function() { if ($.inArray(type, ignore) !== -1){ return; } - + var badge = btn.find(".badge"); if (badge.length !== 0) { var i = (parseInt(badge.html()) || 0) + 1; @@ -355,7 +356,7 @@ $(function() { } } }); - + var connect = $("#connect"); connect.on("submit", "form", function(e) { e.preventDefault(); @@ -363,19 +364,19 @@ $(function() { .find(".btn") .attr("disabled", true) .end(); - + var post = {}; var values = form.serializeArray(); - + $.each(values, function(i, obj) { if (obj.value !== "") { post[obj.name] = obj.value; } }); - + socket.emit("conn", post); }); - + function complete(word) { var words = commands.slice(); var users = chat.find(".active") @@ -396,7 +397,7 @@ $(function() { } ); } - + document.addEventListener( "visibilitychange", function() { diff --git a/client/js/components.min.js b/client/js/components.min.js index 921d726..a1ce2fe 100644 --- a/client/js/components.min.js +++ b/client/js/components.min.js @@ -2,7 +2,7 @@ this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges)this.yylloc.range=[0,0];this.offset=0;return this},input:function(){var a=this._input[0];this.yytext+=a;this.yyleng++;this.offset++;this.match+=a;this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);if(b){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges)this.yylloc.range[1]++;this._input=this._input.slice(1);return a},unput:function(a){var b=a.length;var c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-b-1);this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(c.length-1)this.yylineno-=c.length-1;var e=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b};if(this.options.ranges){this.yylloc.range=[e[0],e[0]+this.yyleng-b]}return this},more:function(){this._more=true;return this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;if(a.length<20){a+=this._input.substr(0,20-a.length)}return(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput();var b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done){return this.EOF}if(!this._input)this.done=true;var a,b,c,d,e,f;if(!this._more){this.yytext="";this.match=""}var g=this._currentRules();for(var h=0;hb[0].length)){b=c;d=h;if(!this.options.flex)break}}if(b){f=b[0].match(/(?:\r\n?|\n).*/g);if(f)this.yylineno+=f.length;this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length};this.yytext+=b[0];this.match+=b[0];this.matches=b;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._input=this._input.slice(b[0].length);this.matched+=b[0];a=this.performAction.call(this,this.yy,this,g[d],this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input)this.done=false;if(a)return a;else return}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function c(){var a=this.next();if(typeof a!=="undefined"){return a}else{return this.lex()}},begin:function d(a){this.conditionStack.push(a)},popState:function e(){return this.conditionStack.pop()},_currentRules:function f(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function g(a){this.begin(a)}};a.options={};a.performAction=function h(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}var f=d;switch(c){case 0:if(b.yytext.slice(-2)==="\\\\"){e(0,1);this.begin("mu")}else if(b.yytext.slice(-1)==="\\"){e(0,1);this.begin("emu")}else{this.begin("mu")}if(b.yytext)return 10;break;case 1:return 10;break;case 2:this.popState();return 10;break;case 3:b.yytext=b.yytext.substr(5,b.yyleng-9);this.popState();return 11;break;case 4:return 10;break;case 5:e(0,4);this.popState();return 17;break;case 6:return 40;break;case 7:return 41;break;case 8:return 18;break;case 9:this.popState();this.begin("raw");return 20;break;case 10:b.yytext=b.yytext.substr(4,b.yyleng-8);this.popState();return"RAW_BLOCK";break;case 11:return 29;break;case 12:return 21;break;case 13:return 24;break;case 14:return 23;break;case 15:return 23;break;case 16:return 27;break;case 17:return 26;break;case 18:this.popState();this.begin("com");break;case 19:e(3,5);this.popState();return 17;break;case 20:return 26;break;case 21:return 46;break;case 22:return 45;break;case 23:return 45;break;case 24:return 49;break;case 25:break;case 26:this.popState();return 28;break;case 27:this.popState();return 22;break;case 28:b.yytext=e(1,2).replace(/\\"/g,'"');return 37;break;case 29:b.yytext=e(1,2).replace(/\\'/g,"'");return 37;break;case 30:return 47;break;case 31:return 39;break;case 32:return 39;break;case 33:return 38;break;case 34:return 45;break;case 35:b.yytext=e(1,2);return 45;break;case 36:return"INVALID";break;case 37:return 5;break}};a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{\{\{[^\x00]*\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];a.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inclusive:false},emu:{rules:[2],inclusive:false},com:{rules:[5],inclusive:false},raw:{rules:[3,4],inclusive:false},INITIAL:{rules:[0,1,37],inclusive:true}};return a}();a.lexer=c;function d(){this.yy={}}d.prototype=a;a.Parser=d;return new d}();a=b;return a}();var i=function(a,b){"use strict";var c={};var d=a;var e=b;c.parser=d;function f(a){if(a.constructor===e.ProgramNode){return a}d.yy=e;return d.parse(a)}c.parse=f;return c}(h,g);var j=function(a){"use strict";var b={};var c=a;function d(){}b.Compiler=d;d.prototype={compiler:d,disassemble:function(){var a=this.opcodes,b,c=[],d,e;for(var f=0,g=a.length;f0){b+=", "+c.join(", ")}for(var d in this.aliases){if(this.aliases.hasOwnProperty(d)){b+=", "+d+"="+this.aliases[d]}}var e=["depth0","helpers","partials","data"];for(var f=0,g=this.environment.depths.list.length;fthis.stackVars.length){this.stackVars.push("stack"+this.stackSlot)}return this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,c=a.length;b":">"};return a.replace(/[<>]/g,function(a){return b[a]})}Handlebars.registerHelper("uri",function(a){var b=[];a=URI.withinString(a,function(a){b.push(a);return"$("+(b.length-1)+")"});a=escape(a);for(var c in b){var d=escape(b[c]);a=a.replace("$("+c+")",""+d+"")}return a});(function(a,b){if(typeof module==="object"&&typeof module.exports==="object"){module.exports=a.document?b(a,true):function(a){if(!a.document){throw new Error("jQuery requires a window with a document")}return b(a)}}else{b(a)}})(typeof window!=="undefined"?window:this,function(a,b){var c=[];var d=c.slice;var e=c.concat;var f=c.push;var g=c.indexOf;var h={};var i=h.toString;var j=h.hasOwnProperty;var k={};var l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return a!=null?a<0?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);b.prevObject=this;b.context=this.context;return b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c=0},isPlainObject:function(a){if(n.type(a)!=="object"||a.nodeType||n.isWindow(a)){return false}if(a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")){return false}return true},isEmptyObject:function(a){var b;for(b in a){return false}return true},type:function(a){if(a==null){return a+""}return typeof a==="object"||typeof a==="function"?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a);if(a){if(a.indexOf("use strict")===1){b=l.createElement("script");b.text=a;l.head.appendChild(b).parentNode.removeChild(b)}else{c(a)}}},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;e0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){if(a===b){l=true}return 0},C=typeof undefined,D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){var b=0,c=this.length;for(;b+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,d&1023|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes);F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0; while(a[c++]=b[d++]){}a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n){m(b)}b=b||n;d=d||[];if(!a||typeof a!=="string"){return d}if((k=b.nodeType)!==1&&k!==9){return[]}if(p&&!e){if(f=_.exec(a)){if(j=f[1]){if(k===9){h=b.getElementById(j);if(h&&h.parentNode){if(h.id===j){d.push(h);return d}}else{return d}}else{if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j){d.push(h);return d}}}else if(f[2]){I.apply(d,b.getElementsByTagName(a));return d}else if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName){I.apply(d,b.getElementsByClassName(j));return d}}if(c.qsa&&(!q||!q.test(a))){s=r=u;w=b;x=k===9&&a;if(k===1&&b.nodeName.toLowerCase()!=="object"){o=g(a);if(r=b.getAttribute("id")){s=r.replace(bb,"\\$&")}else{b.setAttribute("id",s)}s="[id='"+s+"'] ";l=o.length;while(l--){o[l]=s+qb(o[l])}w=ab.test(a)&&ob(b.parentNode)||b;x=o.join(",")}if(x){try{I.apply(d,w.querySelectorAll(x));return d}catch(y){}finally{if(!r){b.removeAttribute("id")}}}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){if(a.push(c+" ")>d.cacheLength){delete b[a.shift()]}return b[c+" "]=e}return b}function hb(a){a[u]=true;return a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return false}finally{if(b.parentNode){b.parentNode.removeChild(b)}b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--){d.attrHandle[c[e]]=b}}function kb(a,b){var c=b&&a,d=c&&a.nodeType===1&&b.nodeType===1&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d){return d}if(c){while(c=c.nextSibling){if(c===b){return-1}}}return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function nb(a){return hb(function(b){b=+b;return hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--){if(c[e=f[g]]){c[e]=!(d[e]=c[e])}}})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={};f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":false};m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;if(e===n||e.nodeType!==9||!e.documentElement){return n}n=e;o=e.documentElement;p=!f(e);if(g&&g!==g.top){if(g.addEventListener){g.addEventListener("unload",function(){m()},false)}else if(g.attachEvent){g.attachEvent("onunload",function(){m()})}}c.attributes=ib(function(a){a.className="i";return!a.getAttribute("className")});c.getElementsByTagName=ib(function(a){a.appendChild(e.createComment(""));return!a.getElementsByTagName("*").length});c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){a.innerHTML="
";a.firstChild.className="i";return a.getElementsByClassName("i").length===2});c.getById=ib(function(a){o.appendChild(a).id=u;return!e.getElementsByName||!e.getElementsByName(u).length});if(c.getById){d.find["ID"]=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}};d.filter["ID"]=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}}else{delete d.find["ID"];d.filter["ID"]=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}}d.find["TAG"]=c.getElementsByTagName?function(a,b){if(typeof b.getElementsByTagName!==C){return b.getElementsByTagName(a)}}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if(a==="*"){while(c=f[e++]){if(c.nodeType===1){d.push(c)}}return d}return f};d.find["CLASS"]=c.getElementsByClassName&&function(a,b){if(typeof b.getElementsByClassName!==C&&p){return b.getElementsByClassName(a)}};r=[];q=[];if(c.qsa=$.test(e.querySelectorAll)){ib(function(a){a.innerHTML="";if(a.querySelectorAll("[msallowclip^='']").length){q.push("[*^$]="+M+"*(?:''|\"\")")}if(!a.querySelectorAll("[selected]").length){q.push("\\["+M+"*(?:value|"+L+")")}if(!a.querySelectorAll(":checked").length){q.push(":checked")}});ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden");a.appendChild(b).setAttribute("name","D");if(a.querySelectorAll("[name=d]").length){q.push("name"+M+"*[*^$|!~]?=")}if(!a.querySelectorAll(":enabled").length){q.push(":enabled",":disabled")}a.querySelectorAll("*,:x");q.push(",.*:")})}if(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector)){ib(function(a){c.disconnectedMatch=s.call(a,"div");s.call(a,"[s!='']:x");r.push("!=",Q)})}q=q.length&&new RegExp(q.join("|"));r=r.length&&new RegExp(r.join("|"));b=$.test(o.compareDocumentPosition);t=b||$.test(o.contains)?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&(c.contains?c.contains(d):a.compareDocumentPosition&&a.compareDocumentPosition(d)&16))}:function(a,b){if(b){while(b=b.parentNode){if(b===a){return true}}}return false};B=b?function(a,b){if(a===b){l=true;return 0}var d=!a.compareDocumentPosition-!b.compareDocumentPosition;if(d){return d}d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1;if(d&1||!c.sortDetached&&b.compareDocumentPosition(a)===d){if(a===e||a.ownerDocument===v&&t(v,a)){return-1}if(b===e||b.ownerDocument===v&&t(v,b)){return 1}return k?K.call(k,a)-K.call(k,b):0}return d&4?-1:1}:function(a,b){if(a===b){l=true;return 0}var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g){return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0}else if(f===g){return kb(a,b)}c=a;while(c=c.parentNode){h.unshift(c)}c=b;while(c=c.parentNode){i.unshift(c)}while(h[d]===i[d]){d++}return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0};return e};fb.matches=function(a,b){return fb(a,null,null,b)};fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n){m(a)}b=b.replace(U,"='$1']");if(c.matchesSelector&&p&&(!r||!r.test(b))&&(!q||!q.test(b))){try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&a.document.nodeType!==11){return d}}catch(e){}}return fb(b,n,null,[a]).length>0};fb.contains=function(a,b){if((a.ownerDocument||a)!==n){m(a)}return t(a,b)};fb.attr=function(a,b){if((a.ownerDocument||a)!==n){m(a)}var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):undefined;return f!==undefined?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null};fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};fb.uniqueSort=function(a){var b,d=[],e=0,f=0;l=!c.detectDuplicates;k=!c.sortStable&&a.slice(0);a.sort(B);if(l){while(b=a[f++]){if(b===a[f]){e=d.push(f)}}while(e--){a.splice(d[e],1)}}k=null;return a};e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(!f){while(b=a[d++]){c+=e(b)}}else if(f===1||f===9||f===11){if(typeof a.textContent==="string"){return a.textContent}else{for(a=a.firstChild;a;a=a.nextSibling){c+=e(a)}}}else if(f===3||f===4){return a.nodeValue}return c};d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){a[1]=a[1].replace(cb,db);a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db);if(a[2]==="~="){a[3]=" "+a[3]+" "}return a.slice(0,4)},CHILD:function(a){a[1]=a[1].toLowerCase();if(a[1].slice(0,3)==="nth"){if(!a[3]){fb.error(a[0])}a[4]=+(a[4]?a[5]+(a[6]||1):2*(a[3]==="even"||a[3]==="odd"));a[5]=+(a[7]+a[8]||a[3]==="odd")}else if(a[3]){fb.error(a[0])}return a},PSEUDO:function(a){var b,c=!a[6]&&a[2];if(X["CHILD"].test(a[0])){return null}if(a[3]){a[2]=a[4]||a[5]||""}else if(c&&V.test(c)&&(b=g(c,true))&&(b=c.indexOf(")",c.length-b)-c.length)){a[0]=a[0].slice(0,b);a[2]=c.slice(0,b)}return a.slice(0,3)}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return a==="*"?function(){return true}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test(typeof a.className==="string"&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);if(e==null){return b==="!="}if(!b){return true}e+="";return b==="="?e===c:b==="!="?e!==c:b==="^="?c&&e.indexOf(c)===0:b==="*="?c&&e.indexOf(c)>-1:b==="$="?c&&e.slice(-c.length)===c:b==="~="?(" "+e+" ").indexOf(c)>-1:b==="|="?e===c||e.slice(0,c.length+1)===c+"-":false}},CHILD:function(a,b,c,d,e){var f=a.slice(0,3)!=="nth",g=a.slice(-4)!=="last",h=b==="of-type";return d===1&&e===0?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p]){if(h?l.nodeName.toLowerCase()===r:l.nodeType===1){return false}}o=p=a==="only"&&!o&&"nextSibling"}return true}o=[g?q.firstChild:q.lastChild];if(g&&s){k=q[u]||(q[u]={});j=k[a]||[];n=j[0]===w&&j[1];m=j[0]===w&&j[2];l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop()){if(l.nodeType===1&&++m&&l===b){k[a]=[w,n,m];break}}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w){m=j[1]}else{while(l=++n&&l&&l[p]||(m=n=0)||o.pop()){if((h?l.nodeName.toLowerCase()===r:l.nodeType===1)&&++m){if(s){(l[u]||(l[u]={}))[a]=[w,m]}if(l===b){break}}}}m-=e;return m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);if(e[u]){return e(b)}if(e.length>1){c=[a,a,"",b];return d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--){d=K.call(a,f[g]);a[d]=!(c[d]=f[g])}}):function(a){return e(a,0,c)}}return e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--){if(f=g[h]){a[h]=!(b[h]=f)}}}):function(a,e,f){b[0]=a;d(b,null,f,c);return!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){if(!W.test(a||"")){fb.error("unsupported lang: "+a)}a=a.replace(cb,db).toLowerCase();return function(b){var c;do{if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang")){c=c.toLowerCase();return c===a||c.indexOf(a+"-")===0}}while((b=b.parentNode)&&b.nodeType===1);return false}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===false},disabled:function(a){return a.disabled===true},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){if(a.parentNode){a.parentNode.selectedIndex}return a.selected===true},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling){if(a.nodeType<6){return false}}return true},parent:function(a){return!d.pseudos["empty"](a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},text:function(a){var b;return a.nodeName.toLowerCase()==="input"&&a.type==="text"&&((b=a.getAttribute("type"))==null||b.toLowerCase()==="text")},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[c<0?c+b:c]}),even:nb(function(a,b){var c=0;for(;c=0;){a.push(d)}return a}),gt:nb(function(a,b,c){var d=c<0?c+b:c;for(;++d1?function(b,c,d){var e=a.length;while(e--){if(!a[e](b,c,d)){return false}}return true}:a[0]}function tb(a,b,c){var d=0,e=b.length;for(;d-1){f[j]=!(g[j]=l)}}}}else{r=ub(r===g?r.splice(o,r.length):r);if(e){e(null,g,r,i)}else{I.apply(g,r)}}})}function wb(a){var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,true),l=rb(function(a){return K.call(b,a)>-1},h,true),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];for(;i1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:a[i-2].type===" "?"*":""})).replace(R,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find["TAG"]("*",k),v=w+=t==null?1:Math.random()||.1,x=u.length;if(k){j=g!==n&&g}for(;q!==x&&(l=u[q])!=null;q++){if(e&&l){m=0;while(o=a[m++]){if(o(l,g,h)){i.push(l);break}}if(k){w=v}}if(c){if(l=!o&&l){p--}if(f){r.push(l)}}}p+=q;if(c&&q!==p){m=0;while(o=b[m++]){o(r,s,g,h)}if(f){if(p>0){while(q--){if(!(r[q]||s[q])){s[q]=G.call(i)}}}s=ub(s)}I.apply(i,s);if(k&&!f&&s.length>0&&p+b.length>1){fb.uniqueSort(i)}}if(k){w=v;j=t}return r};return c?hb(f):f}h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){if(!b){b=g(a)}c=b.length;while(c--){f=wb(b[c]);if(f[u]){d.push(f)}else{e.push(f)}}f=A(a,xb(e,d));f.selector=a}return f};i=fb.select=function(a,b,e,f){var i,j,k,l,m,n=typeof a==="function"&&a,o=!f&&g(a=n.selector||a);e=e||[];if(o.length===1){j=o[0]=o[0].slice(0);if(j.length>2&&(k=j[0]).type==="ID"&&c.getById&&b.nodeType===9&&p&&d.relative[j[1].type]){b=(d.find["ID"](k.matches[0].replace(cb,db),b)||[])[0];if(!b){return e}else if(n){b=b.parentNode}a=a.slice(j.shift().value.length)}i=X["needsContext"].test(a)?0:j.length;while(i--){k=j[i];if(d.relative[l=k.type]){break}if(m=d.find[l]){if(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b)){j.splice(i,1);a=f.length&&qb(j);if(!a){I.apply(e,f);return e}break}}}}(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b);return e};c.sortStable=u.split("").sort(B).join("")===u;c.detectDuplicates=!!l;m();c.sortDetached=ib(function(a){return a.compareDocumentPosition(n.createElement("div"))&1});if(!ib(function(a){a.innerHTML="";return a.firstChild.getAttribute("href")==="#"})){jb("type|href|height|width",function(a,b,c){if(!c){return a.getAttribute(b,b.toLowerCase()==="type"?1:2)}})}if(!c.attributes||!ib(function(a){a.innerHTML="";a.firstChild.setAttribute("value","");return a.firstChild.getAttribute("value")===""})){jb("value",function(a,b,c){if(!c&&a.nodeName.toLowerCase()==="input"){return a.defaultValue}})}if(!ib(function(a){return a.getAttribute("disabled")==null})){jb(L,function(a,b,c){var d;if(!c){return a[b]===true?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}})}return fb}(a);n.find=t;n.expr=t.selectors;n.expr[":"]=n.expr.pseudos;n.unique=t.uniqueSort;n.text=t.getText;n.isXMLDoc=t.isXML;n.contains=t.contains;var u=n.expr.match.needsContext;var v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/;var w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b)){return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c})}if(b.nodeType){return n.grep(a,function(a){return a===b!==c})}if(typeof b==="string"){if(w.test(b)){return n.filter(b,a,c)}b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];if(c){a=":not("+a+")"}return b.length===1&&d.nodeType===1?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return a.nodeType===1}))};n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if(typeof a!=="string"){return this.pushStack(n(a).filter(function(){for(b=0;b1?n.unique(d):d);d.selector=this.selector?this.selector+" "+a:a;return d},filter:function(a){return this.pushStack(x(this,a||[],false))},not:function(a){return this.pushStack(x(this,a||[],true))},is:function(a){return!!x(this,typeof a==="string"&&u.test(a)?n(a):a||[],false).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a){return this}if(typeof a==="string"){if(a[0]==="<"&&a[a.length-1]===">"&&a.length>=3){c=[null,a,null]}else{c=z.exec(a)}if(c&&(c[1]||!b)){if(c[1]){b=b instanceof n?b[0]:b;n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,true));if(v.test(c[1])&&n.isPlainObject(b)){for(c in b){if(n.isFunction(this[c])){this[c](b[c])}else{this.attr(c,b[c])}}}return this}else{d=l.getElementById(c[2]);if(d&&d.parentNode){this.length=1;this[0]=d}this.context=l;this.selector=a;return this}}else if(!b||b.jquery){return(b||y).find(a)}else{return this.constructor(b).find(a)}}else if(a.nodeType){this.context=this[0]=a;this.length=1;return this}else if(n.isFunction(a)){return typeof y.ready!=="undefined"?y.ready(a):a(n)}if(a.selector!==undefined){this.selector=a.selector;this.context=a.context}return n.makeArray(a,this)};A.prototype=n.fn;y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:true,contents:true,next:true,prev:true};n.extend({dir:function(a,b,c){var d=[],e=c!==undefined;while((a=a[b])&&a.nodeType!==9){if(a.nodeType===1){if(e&&n(a).is(c)){break}d.push(a)}}return d},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling){if(a.nodeType===1&&a!==b){c.push(a)}}return c}});n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){var a=0;for(;a-1:c.nodeType===1&&n.find.matchesSelector(c,a))){f.push(c);break}}}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){if(!a){return this[0]&&this[0].parentNode?this.first().prevAll().length:-1}if(typeof a==="string"){return g.call(n(a),this[0])}return g.call(this,a.jquery?a[0]:a)},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&a.nodeType!==1){}return a}n.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);if(a.slice(-5)!=="Until"){d=c}if(d&&typeof d==="string"){e=n.filter(d,e)}if(this.length>1){if(!C[a]){n.unique(e)}if(B.test(a)){e.reverse()}}return this.pushStack(e)}});var E=/\S+/g;var F={};function G(a){var b=F[a]={};n.each(a.match(E)||[],function(a,c){b[c]=true});return b}n.Callbacks=function(a){a=typeof a==="string"?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){b=a.memory&&l;c=true;g=e||0;e=0;f=h.length;d=true;for(;h&&g-1){h.splice(c,1);if(d){if(c<=f){f--}if(c<=g){g--}}}})}return this},has:function(a){return a?n.inArray(a,h)>-1:!!(h&&h.length)},empty:function(){h=[];f=0;return this},disable:function(){h=i=b=undefined;return this},disabled:function(){return!h},lock:function(){i=undefined;if(!b){k.disable()}return this},locked:function(){return!i},fireWith:function(a,b){if(h&&(!c||i)){b=b||[];b=[a,b.slice?b.slice():b];if(d){i.push(b)}else{j(b)}}return this},fire:function(){k.fireWith(this,arguments);return this},fired:function(){return!!c}};return k};n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){e.done(arguments).fail(arguments);return this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);if(a&&n.isFunction(a.promise)){a.promise().done(c.resolve).fail(c.reject).progress(c.notify)}else{c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)}})});a=null}).promise()},promise:function(a){return a!=null?n.extend(a,d):d}},e={};d.pipe=d.then;n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add;if(h){g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock)}e[f[0]]=function(){e[f[0]+"With"](this===e?d:this,arguments);return this};e[f[0]+"With"]=g.fireWith});d.promise(e);if(a){a.call(e,e)}return e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=e!==1||a&&n.isFunction(a.promise)?e:0,g=f===1?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this;c[a]=arguments.length>1?d.call(arguments):e;if(c===i){g.notifyWith(b,c)}else if(!--f){g.resolveWith(b,c)}}},i,j,k;if(e>1){i=new Array(e);j=new Array(e);k=new Array(e);for(;b0){return}H.resolveWith(l,[n]);if(n.fn.triggerHandler){n(l).triggerHandler("ready");n(l).off("ready")}}});function I(){l.removeEventListener("DOMContentLoaded",I,false);a.removeEventListener("load",I,false);n.ready()}n.ready.promise=function(b){if(!H){H=n.Deferred();if(l.readyState==="complete"){setTimeout(n.ready)}else{l.addEventListener("DOMContentLoaded",I,false);a.addEventListener("load",I,false)}}return H.promise(b)};n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=c==null;if(n.type(c)==="object"){e=true;for(h in c){n.access(a,b,h,c[h],true,f,g)}}else if(d!==undefined){e=true;if(!n.isFunction(d)){g=true}if(j){if(g){b.call(a,d);b=null}else{j=b;b=function(a,b,c){return j.call(n(a),c)}}}if(b){for(;h1,null,true)},removeData:function(a){return this.each(function(){M.remove(this,a)})}});n.extend({queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue";d=L.get(a,b);if(c){if(!d||n.isArray(c)){d=L.access(a,b,n.makeArray(c))}else{d.push(c)}}return d||[]}},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};if(e==="inprogress"){e=c.shift();d--}if(e){if(b==="fx"){c.unshift("inprogress")}delete f.stop;e.call(a,g,f)}if(!d&&f){f.empty.fire()}},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}});n.fn.extend({queue:function(a,b){var c=2;if(typeof a!=="string"){b=a;a="fx";c--}if(arguments.lengthx";k.noCloneChecked=!!b.cloneNode(true).lastChild.defaultValue})();var U=typeof undefined;k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return true}function $(){return false}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(!r){return}if(c.handler){f=c;c=f.handler;e=f.selector}if(!c.guid){c.guid=n.guid++}if(!(i=r.events)){i=r.events={}}if(!(g=r.handle)){g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):undefined}}b=(b||"").match(E)||[""];j=b.length;while(j--){h=Y.exec(b[j])||[];o=q=h[1];p=(h[2]||"").split(".").sort();if(!o){continue}l=n.event.special[o]||{};o=(e?l.delegateType:l.bindType)||o;l=n.event.special[o]||{};k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f);if(!(m=i[o])){m=i[o]=[];m.delegateCount=0;if(!l.setup||l.setup.call(a,d,p,g)===false){if(a.addEventListener){a.addEventListener(o,g,false)}}}if(l.add){l.add.call(a,k);if(!k.handler.guid){k.handler.guid=c.guid}}if(e){m.splice(m.delegateCount++,0,k)}else{m.push(k)}n.event.global[o]=true}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(!r||!(i=r.events)){return}b=(b||"").match(E)||[""];j=b.length;while(j--){h=Y.exec(b[j])||[];o=q=h[1];p=(h[2]||"").split(".").sort();if(!o){for(o in i){n.event.remove(a,o+b[j],c,d,true)}continue}l=n.event.special[o]||{};o=(d?l.delegateType:l.bindType)||o;m=i[o]||[];h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)");g=f=m.length;while(f--){k=m[f];if((e||q===k.origType)&&(!c||c.guid===k.guid)&&(!h||h.test(k.namespace))&&(!d||d===k.selector||d==="**"&&k.selector)){m.splice(f,1);if(k.selector){m.delegateCount--}if(l.remove){l.remove.call(a,k)}}}if(g&&!m.length){if(!l.teardown||l.teardown.call(a,p,r.handle)===false){n.removeEvent(a,o,r.handle)}delete i[o]}}if(n.isEmptyObject(i)){delete r.handle;L.remove(a,"events")}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];g=h=d=d||l;if(d.nodeType===3||d.nodeType===8){return }if(X.test(q+n.event.triggered)){return}if(q.indexOf(".")>=0){r=q.split(".");q=r.shift();r.sort()}k=q.indexOf(":")<0&&"on"+q;b=b[n.expando]?b:new n.Event(q,typeof b==="object"&&b);b.isTrigger=e?2:3;b.namespace=r.join(".");b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;b.result=undefined;if(!b.target){b.target=d}c=c==null?[b]:n.makeArray(c,[b]);o=n.event.special[q]||{};if(!e&&o.trigger&&o.trigger.apply(d,c)===false){return}if(!e&&!o.noBubble&&!n.isWindow(d)){i=o.delegateType||q;if(!X.test(i+q)){g=g.parentNode}for(;g;g=g.parentNode){p.push(g);h=g}if(h===(d.ownerDocument||l)){p.push(h.defaultView||h.parentWindow||a)}}f=0;while((g=p[f++])&&!b.isPropagationStopped()){b.type=f>1?i:o.bindType||q;m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle");if(m){m.apply(g,c)}m=k&&g[k];if(m&&m.apply&&n.acceptData(g)){b.result=m.apply(g,c);if(b.result===false){b.preventDefault()}}}b.type=q;if(!e&&!b.isDefaultPrevented()){if((!o._default||o._default.apply(p.pop(),c)===false)&&n.acceptData(d)){if(k&&n.isFunction(d[q])&&!n.isWindow(d)){h=d[k];if(h){d[k]=null}n.event.triggered=q;d[q]();n.event.triggered=undefined;if(h){d[k]=h}}}}return b.result},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};i[0]=a;a.delegateTarget=this;if(k.preDispatch&&k.preDispatch.call(this,a)===false){return}h=n.event.handlers.call(this,a,j);b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem;c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped()){if(!a.namespace_re||a.namespace_re.test(g.namespace)){a.handleObj=g;a.data=g.data;e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i);if(e!==undefined){if((a.result=e)===false){a.preventDefault();a.stopPropagation()}}}}}if(k.postDispatch){k.postDispatch.call(this,a)}return a.result},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||a.type!=="click")){for(;i!==this;i=i.parentNode||this){if(i.disabled!==true||a.type!=="click"){d=[];for(c=0;c=0:n.find(e,this,null,[i]).length}if(d[e]){d.push(f)}}if(d.length){g.push({elem:i,handlers:d})}}}}if(h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ib.optgroup=ib.option;ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead;ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(b.nodeType!==11?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){a.type=(a.getAttribute("type")!==null)+"/"+a.type;return a}function lb(a){var b=gb.exec(a.type);if(b){a.type=b[1]}else{a.removeAttribute("type")}return a}function mb(a,b){var c=0,d=a.length;for(;c0){mb(g,!i&&ob(a,"script"))}return h},buildFragment:function(a,b,c,d){var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;for(;m")+h[2];j=h[0];while(j--){f=f.lastChild}n.merge(l,f.childNodes);f=k.firstChild;f.textContent=""}}}k.textContent="";m=0;while(e=l[m++]){if(d&&n.inArray(e,d)!==-1){continue}i=n.contains(e.ownerDocument,e);f=ob(k.appendChild(e),"script");if(i){mb(f)}if(c){j=0;while(e=f[j++]){if(fb.test(e.type||"")){c.push(e)}}}}return k},cleanData:function(a){var b,c,d,e,f=n.event.special,g=0;for(;(c=a[g])!==undefined;g++){if(n.acceptData(c)){e=c[L.expando];if(e&&(b=L.cache[e])){if(b.events){for(d in b.events){if(f[d]){n.event.remove(c,d)}else{n.removeEvent(c,d,b.handle)}}}if(L.cache[e]){delete L.cache[e]}}}delete M.cache[c[M.expando]]}}});n.fn.extend({text:function(a){return J(this,function(a){return a===undefined?n.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=a}})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){if(this.parentNode){this.parentNode.insertBefore(a,this)}})},after:function(){return this.domManip(arguments,function(a){if(this.parentNode){this.parentNode.insertBefore(a,this.nextSibling)}})},remove:function(a,b){var c,d=a?n.filter(a,this):this,e=0;for(;(c=d[e])!=null;e++){if(!b&&c.nodeType===1){n.cleanData(ob(c))}if(c.parentNode){if(b&&n.contains(c.ownerDocument,c)){mb(ob(c,"script"))}c.parentNode.removeChild(c)}}return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){if(a.nodeType===1){n.cleanData(ob(a,false));a.textContent=""}}return this},clone:function(a,b){a=a==null?false:a;b=b==null?a:b;return this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(a===undefined&&b.nodeType===1){return b.innerHTML}if(typeof a==="string"&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;c1&&typeof p==="string"&&!k.checkClone&&eb.test(p)){return this.each(function(c){var d=m.eq(c);if(q){a[0]=p.call(this,c,d.html())}d.domManip(a,b)})}if(l){c=n.buildFragment(a,this[0].ownerDocument,false,this);d=c.firstChild;if(c.childNodes.length===1){c=d}if(d){f=n.map(ob(c,"script"),kb);g=f.length;for(;j")).appendTo(b.documentElement);b=qb[0].contentDocument;b.write();b.close();c=sb(a,b);qb.detach()}rb[a]=c}return c}var ub=/^margin/;var vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i");var wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;c=c||wb(a);if(c){g=c.getPropertyValue(b)||c[b]}if(c){if(g===""&&!n.contains(a.ownerDocument,a)){g=n.style(a,b)}if(vb.test(g)&&ub.test(b)){d=h.width;e=h.minWidth;f=h.maxWidth;h.minWidth=h.maxWidth=h.width=g;g=c.width;h.width=d;h.minWidth=e;h.maxWidth=f}}return g!==undefined?g+"":g}function yb(a,b){return{get:function(){if(a()){delete this.get;return}return(this.get=b).apply(this,arguments)}}}(function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(!f.style){return}f.style.backgroundClip="content-box";f.cloneNode(true).style.backgroundClip="";k.clearCloneStyle=f.style.backgroundClip==="content-box";e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;"+"position:absolute";e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;"+"box-sizing:border-box;display:block;margin-top:1%;top:1%;"+"border:1px;padding:1px;width:4px;position:absolute";f.innerHTML="";d.appendChild(e);var g=a.getComputedStyle(f,null);b=g.top!=="1%";c=g.width==="4px";d.removeChild(e)}if(a.getComputedStyle){n.extend(k,{pixelPosition:function(){g();return b},boxSizingReliable:function(){if(c==null){g()}return c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;"+"box-sizing:content-box;display:block;margin:0;border:0;padding:0";c.style.marginRight=c.style.width="0";f.style.width="1px";d.appendChild(e);b=!parseFloat(a.getComputedStyle(c,null).marginRight);d.removeChild(e);return b}})}})();n.swap=function(a,b,c,d){var e,f,g={};for(f in b){g[f]=a.style[f];a.style[f]=b[f]}e=c.apply(a,d||[]);for(f in b){a.style[f]=g[f]}return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a){return b}var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--){b=Eb[e]+c;if(b in a){return b}}return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){var f=c===(d?"border":"content")?4:b==="width"?1:0,g=0;for(;f<4;f+=2){if(c==="margin"){g+=n.css(a,c+R[f],true,e)}if(d){if(c==="content"){g-=n.css(a,"padding"+R[f],true,e)}if(c!=="margin"){g-=n.css(a,"border"+R[f]+"Width",true,e)}}else{g+=n.css(a,"padding"+R[f],true,e);if(c!=="padding"){g+=n.css(a,"border"+R[f]+"Width",true,e)}}}return g}function Ib(a,b,c){var d=true,e=b==="width"?a.offsetWidth:a.offsetHeight,f=wb(a),g=n.css(a,"boxSizing",false,f)==="border-box";if(e<=0||e==null){e=xb(a,b,f);if(e<0||e==null){e=a.style[b]}if(vb.test(e)){return e}d=g&&(k.boxSizingReliable()||e===a.style[b]);e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){var c,d,e,f=[],g=0,h=a.length;for(;g1)},show:function(){return Jb(this,true)},hide:function(){return Jb(this)},toggle:function(a){if(typeof a==="boolean"){return a?this.show():this.hide()}return this.each(function(){if(S(this)){n(this).show()}else{n(this).hide()}})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb;Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a;this.prop=c;this.easing=e||"swing";this.options=b;this.start=this.now=this.cur();this.end=d;this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];if(this.options.duration){this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration)}else{this.pos=b=a}this.now=(this.end-this.start)*b+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this)}if(c&&c.set){c.set(this)}else{Kb.propHooks._default.set(this)}return this}};Kb.prototype.init.prototype=Kb.prototype;Kb.propHooks={_default:{get:function(a){var b;if(a.elem[a.prop]!=null&&(!a.elem.style||a.elem.style[a.prop]==null)){return a.elem[a.prop]}b=n.css(a.elem,a.prop,"");return!b||b==="auto"?0:b},set:function(a){if(n.fx.step[a.prop]){n.fx.step[a.prop](a)}else if(a.elem.style&&(a.elem.style[n.cssProps[a.prop]]!=null||n.cssHooks[a.prop])){n.style(a.elem,a.prop,a.now+a.unit)}else{a.elem[a.prop]=a.now}}}};Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){if(a.elem.nodeType&&a.elem.parentNode){a.elem[a.prop]=a.now}}};n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}};n.fx=Kb.prototype.init;n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||f!=="px"&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3];e=e||[];g=+d||1;do{h=h||".5";g=g/h;n.style(c.elem,a,g+f)}while(h!==(h=c.cur()/d)&&h!==1&&--i)}if(e){g=c.start=+g||+d||0;c.unit=f;c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]}return c}]};function Sb(){setTimeout(function(){Lb=undefined});return Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};b=b?1:0;for(;d<4;d+=2-b){c=R[d];e["margin"+c]=e["padding"+c]=a}if(b){e.opacity=e.width=a}return e}function Ub(a,b,c){var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;for(;f1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}});n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(!a||f===3||f===8||f===2){return}if(typeof a.getAttribute===U){return n.prop(a,b,c)}if(f!==1||!n.isXMLDoc(a)){b=b.toLowerCase();d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)}if(c!==undefined){if(c===null){n.removeAttr(a,b)}else if(d&&"set"in d&&(e=d.set(a,c,b))!==undefined){return e}else{a.setAttribute(b,c+"");return c}}else if(d&&"get"in d&&(e=d.get(a,b))!==null){return e}else{e=n.find.attr(a,b);return e==null?undefined:e}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&a.nodeType===1){while(c=f[e++]){d=n.propFix[c]||c;if(n.expr.match.bool.test(c)){a[d]=false}a.removeAttribute(c)}}},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&b==="radio"&&n.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b);if(c){a.value=c}return b}}}}});Zb={set:function(a,b,c){if(b===false){n.removeAttr(a,c)}else{a.setAttribute(c,c)}return c}};n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;if(!d){f=$b[b];$b[b]=e;e=c(a,b,d)!=null?b.toLowerCase():null;$b[b]=f}return e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}});n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(!a||g===3||g===8||g===2){return}f=g!==1||!n.isXMLDoc(a);if(f){b=n.propFix[b]||b;e=n.propHooks[b]}if(c!==undefined){return e&&"set"in e&&(d=e.set(a,c,b))!==undefined?d:a[b]=c}else{return e&&"get"in e&&(d=e.get(a,b))!==null?d:a[b]}},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}});if(!k.optSelected){n.propHooks.selected={get:function(a){var b=a.parentNode;if(b&&b.parentNode){b.parentNode.selectedIndex}return null}}}n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=typeof a==="string"&&a,i=0,j=this.length;if(n.isFunction(a)){return this.each(function(b){n(this).addClass(a.call(this,b,this.className))})}if(h){b=(a||"").match(E)||[];for(;i=0){d=d.replace(" "+e+" "," ")}}g=a?n.trim(d):"";if(c.className!==g){c.className=g}}}}return this},toggleClass:function(a,b){var c=typeof a;if(typeof b==="boolean"&&c==="string"){return b?this.addClass(a):this.removeClass(a)}if(n.isFunction(a)){return this.each(function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)})}return this.each(function(){if(c==="string"){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++]){if(e.hasClass(b)){e.removeClass(b)}else{e.addClass(b)}}}else if(c===U||c==="boolean"){if(this.className){L.set(this,"__className__",this.className)}this.className=this.className||a===false?"":L.get(this,"__className__")||""}})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c=0){return true}}return false}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];if(!arguments.length){if(e){b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()];if(b&&"get"in b&&(c=b.get(e,"value"))!==undefined){return c}c=e.value;return typeof c==="string"?c.replace(bc,""):c==null?"":c -}return}d=n.isFunction(a);return this.each(function(c){var e;if(this.nodeType!==1){return}if(d){e=a.call(this,c,n(this).val())}else{e=a}if(e==null){e=""}else if(typeof e==="number"){e+=""}else if(n.isArray(e)){e=n.map(e,function(a){return a==null?"":a+""})}b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()];if(!b||!("set"in b)||b.set(this,e,"value")===undefined){this.value=e}})}});n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return b!=null?b:n.trim(n.text(a))}},select:{get:function(a){var b,c,d=a.options,e=a.selectedIndex,f=a.type==="select-one"||e<0,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;for(;i=0){c=true}}if(!c){a.selectedIndex=-1}return f}}}});n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){if(n.isArray(b)){return a.checked=n.inArray(n(a).val(),b)>=0}}};if(!k.checkOn){n.valHooks[this].get=function(a){return a.getAttribute("value")===null?"on":a.value}}});n.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}});n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length===1?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now();var dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")};n.parseXML=function(a){var b,c;if(!a||typeof a!=="string"){return null}try{c=new DOMParser;b=c.parseFromString(a,"text/xml")}catch(d){b=undefined}if(!b||b.getElementsByTagName("parsererror").length){n.error("Invalid XML: "+a)}return b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=l.createElement("a");fc.href="";fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){if(typeof b!=="string"){c=b;b="*"}var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c)){while(d=f[e++]){if(d[0]==="+"){d=d.slice(1)||"*";(a[d]=a[d]||[]).unshift(c)}else{(a[d]=a[d]||[]).push(c)}}}}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;e[h]=true;n.each(a[h]||[],function(a,h){var j=h(b,c,d);if(typeof j==="string"&&!f&&!e[j]){b.dataTypes.unshift(j);g(j);return false}else if(f){return!(i=j)}});return i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b){if(b[c]!==undefined){(e[c]?a:d||(d={}))[c]=b[c]}}if(d){n.extend(true,a,d)}return a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while(i[0]==="*"){i.shift();if(d===undefined){d=a.mimeType||b.getResponseHeader("Content-Type")}}if(d){for(e in h){if(h[e]&&h[e].test(d)){i.unshift(e);break}}}if(i[0]in c){f=i[0]}else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}if(!g){g=e}}f=f||g}if(f){if(f!==i[0]){i.unshift(f)}return c[f]}}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1]){for(g in a.converters){j[g.toLowerCase()]=a.converters[g]}}f=k.shift();while(f){if(a.responseFields[f]){c[a.responseFields[f]]=b}if(!i&&d&&a.dataFilter){b=a.dataFilter(b,a.dataType)}i=f;f=k.shift();if(f){if(f==="*"){f=i}else if(i!=="*"&&i!==f){g=j[i+" "+f]||j["* "+f];if(!g){for(e in j){h=e.split(" ");if(h[1]===f){g=j[i+" "+h[0]]||j["* "+h[0]];if(g){if(g===true){g=j[e]}else if(j[e]!==true){f=h[0];k.unshift(h[1])}break}}}}if(g!==true){if(g&&a["throws"]){b=g(b)}else{try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}}}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(a,b){return b?tc(tc(a,n.ajaxSettings),b):tc(n.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){if(typeof a==="object"){b=a;a=undefined}b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(t===2){if(!f){f={};while(b=ic.exec(e)){f[b[1].toLowerCase()]=b[2]}}b=f[a.toLowerCase()]}return b==null?null:b},getAllResponseHeaders:function(){return t===2?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();if(!t){a=s[c]=s[c]||a;r[a]=b}return this},overrideMimeType:function(a){if(!t){k.mimeType=a}return this},statusCode:function(a){var b;if(a){if(t<2){for(b in a){q[b]=[q[b],a[b]]}}else{v.always(a[v.status])}}return this},abort:function(a){var b=a||u;if(c){c.abort(b)}x(0,b);return this}};o.promise(v).complete=p.add;v.success=v.done;v.error=v.fail;k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//");k.type=b.method||b.type||k.method||k.type;k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""];if(k.crossDomain==null){h=mc.exec(k.url.toLowerCase());k.crossDomain=!!(h&&(h[1]!==ec[1]||h[2]!==ec[2]||(h[3]||(h[1]==="http:"?"80":"443"))!==(ec[3]||(ec[1]==="http:"?"80":"443"))))}if(k.data&&k.processData&&typeof k.data!=="string"){k.data=n.param(k.data,k.traditional)}sc(nc,k,b,v);if(t===2){return v}i=k.global;if(i&&n.active++===0){n.event.trigger("ajaxStart")}k.type=k.type.toUpperCase();k.hasContent=!kc.test(k.type);d=k.url;if(!k.hasContent){if(k.data){d=k.url+=(dc.test(d)?"&":"?")+k.data;delete k.data}if(k.cache===false){k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++}}if(k.ifModified){if(n.lastModified[d]){v.setRequestHeader("If-Modified-Since",n.lastModified[d])}if(n.etag[d]){v.setRequestHeader("If-None-Match",n.etag[d])}}if(k.data&&k.hasContent&&k.contentType!==false||b.contentType){v.setRequestHeader("Content-Type",k.contentType)}v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+(k.dataTypes[0]!=="*"?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers){v.setRequestHeader(j,k.headers[j])}if(k.beforeSend&&(k.beforeSend.call(l,v,k)===false||t===2)){return v.abort()}u="abort";for(j in{success:1,error:1,complete:1}){v[j](k[j])}c=sc(oc,k,b,v);if(!c){x(-1,"No Transport")}else{v.readyState=1;if(i){m.trigger("ajaxSend",[v,k])}if(k.async&&k.timeout>0){g=setTimeout(function(){v.abort("timeout")},k.timeout)}try{t=1;c.send(r,x)}catch(w){if(t<2){x(-1,w)}else{throw w}}}function x(a,b,f,h){var j,r,s,u,w,x=b;if(t===2){return}t=2;if(g){clearTimeout(g)}c=undefined;e=h||"";v.readyState=a>0?4:0;j=a>=200&&a<300||a===304;if(f){u=uc(k,v,f)}u=vc(k,u,v,j);if(j){if(k.ifModified){w=v.getResponseHeader("Last-Modified");if(w){n.lastModified[d]=w}w=v.getResponseHeader("etag");if(w){n.etag[d]=w}}if(a===204||k.type==="HEAD"){x="nocontent"}else if(a===304){x="notmodified"}else{x=u.state;r=u.data;s=u.error;j=!s}}else{s=x;if(a||!x){x="error";if(a<0){a=0}}}v.status=a;v.statusText=(b||x)+"";if(j){o.resolveWith(l,[r,x,v])}else{o.rejectWith(l,[v,x,s])}v.statusCode(q);q=undefined;if(i){m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s])}p.fireWith(l,[v,x]);if(i){m.trigger("ajaxComplete",[v,k]);if(!--n.active){n.event.trigger("ajaxStop")}}}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,undefined,b,"script")}});n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){if(n.isFunction(c)){e=e||d;d=c;c=undefined}return n.ajax({url:a,type:b,dataType:e,data:c,success:d})}});n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}});n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:false,global:false,"throws":true})};n.fn.extend({wrapAll:function(a){var b;if(n.isFunction(a)){return this.each(function(b){n(this).wrapAll(a.call(this,b))})}if(this[0]){b=n(a,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){b.insertBefore(this[0])}b.map(function(){var a=this;while(a.firstElementChild){a=a.firstElementChild}return a}).append(this)}return this},wrapInner:function(a){if(n.isFunction(a)){return this.each(function(b){n(this).wrapInner(a.call(this,b))})}return this.each(function(){var b=n(this),c=b.contents();if(c.length){c.wrapAll(a)}else{b.append(a)}})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){if(!n.nodeName(this,"body")){n(this).replaceWith(this.childNodes)}}).end()}});n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0};n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(n.isArray(b)){n.each(b,function(b,e){if(c||xc.test(a)){d(a,e)}else{Bc(a+"["+(typeof e==="object"?b:"")+"]",e,c,d)}})}else if(!c&&n.type(b)==="object"){for(e in b){Bc(a+"["+e+"]",b[e],c,d)}}else{d(a,b)}}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():b==null?"":b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(b===undefined){b=n.ajaxSettings&&n.ajaxSettings.traditional}if(n.isArray(a)||a.jquery&&!n.isPlainObject(a)){n.each(a,function(){e(this.name,this.value)})}else{for(c in a){Bc(c,a[c],b,e)}}return d.join("&").replace(wc,"+")};n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return c==null?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}});n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=n.ajaxSettings.xhr();if(a.ActiveXObject){n(a).on("unload",function(){for(var a in Dc){Dc[a]()}})}k.cors=!!Fc&&"withCredentials"in Fc;k.ajax=Fc=!!Fc;n.ajaxTransport(function(a){var b;if(k.cors||Fc&&!a.crossDomain){return{send:function(c,d){var e,f=a.xhr(),g=++Cc;f.open(a.type,a.url,a.async,a.username,a.password);if(a.xhrFields){for(e in a.xhrFields){f[e]=a.xhrFields[e]}}if(a.mimeType&&f.overrideMimeType){f.overrideMimeType(a.mimeType)}if(!a.crossDomain&&!c["X-Requested-With"]){c["X-Requested-With"]="XMLHttpRequest"}for(e in c){f.setRequestHeader(e,c[e])}b=function(a){return function(){if(b){delete Dc[g];b=f.onload=f.onerror=null;if(a==="abort"){f.abort()}else if(a==="error"){d(f.status,f.statusText)}else{d(Ec[f.status]||f.status,f.statusText,typeof f.responseText==="string"?{text:f.responseText}:undefined,f.getAllResponseHeaders())}}}};f.onload=b();f.onerror=b("error");b=Dc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b){throw h}}},abort:function(){if(b){b()}}}}});n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){n.globalEval(a);return a}}});n.ajaxPrefilter("script",function(a){if(a.cache===undefined){a.cache=false}if(a.crossDomain){a.type="GET"}});n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("