/* -------------------------------------------------------------- gm_shop_scripts.js 2008-08-10 gambio Gambio OHG http://www.gambio.de Copyright (c) 2008 Gambio OHG -------------------------------------------------------------- Released under the GNU General Public License -------------------------------------------------------------- */ //GM BOF var fb = false; if(typeof console != 'undefined') { //fb = true; } if(fb)console.log("fb1"); //GM EOF var gm_session_id = ''; var selected; var submitter = null; function submitFunction() { submitter = 1; } function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150') } function selectRowEffect(object, buttonSelect) { if (!selected) { if (document.getElementById) { selected = document.getElementById('defaultSelected'); } else { selected = document.all['defaultSelected']; } } if (selected) selected.className = 'moduleRow'; object.className = 'moduleRowSelected'; selected = object; // one button is not an array if (document.getElementById('payment'[0])) { document.getElementById('payment'[buttonSelect]).checked=true; } else { //document.getElementById('payment'[selected]).checked=true; } } function rowOverEffect(object) { if (object.className == 'moduleRow') object.className = 'moduleRowOver'; } function rowOutEffect(object) { if (object.className == 'moduleRowOver') object.className = 'moduleRow'; } function popupImageWindow(url) { window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150') } /*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under the MIT license */ if ("undefined" == typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery"); +function (a) { "use strict"; var b = a.fn.jquery.split(" ")[0].split("."); if (b[0] < 2 && b[1] < 9 || 1 == b[0] && 9 == b[1] && b[2] < 1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher") }(jQuery), +function (a) { "use strict"; function b() { var a = document.createElement("bootstrap"), b = { WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd otransitionend", transition: "transitionend" }; for (var c in b)if (void 0 !== a.style[c])return {end: b[c]}; return !1 } a.fn.emulateTransitionEnd = function (b) { var c = !1, d = this; a(this).one("bsTransitionEnd", function () { c = !0 }); var e = function () { c || a(d).trigger(a.support.transition.end) }; return setTimeout(e, b), this }, a(function () { a.support.transition = b(), a.support.transition && (a.event.special.bsTransitionEnd = { bindType: a.support.transition.end, delegateType: a.support.transition.end, handle: function (b) { return a(b.target).is(this) ? b.handleObj.handler.apply(this, arguments) : void 0 } }) }) }(jQuery), +function (a) { "use strict"; function b(b) { return this.each(function () { var c = a(this), e = c.data("bs.alert"); e || c.data("bs.alert", e = new d(this)), "string" == typeof b && e[b].call(c) }) } var c = '[data-dismiss="alert"]', d = function (b) { a(b).on("click", c, this.close) }; d.VERSION = "3.3.5", d.TRANSITION_DURATION = 150, d.prototype.close = function (b) { function c() { g.detach().trigger("closed.bs.alert").remove() } var e = a(this), f = e.attr("data-target"); f || (f = e.attr("href"), f = f && f.replace(/.*(?=#[^\s]*$)/, "")); var g = a(f); b && b.preventDefault(), g.length || (g = e.closest(".alert")), g.trigger(b = a.Event("close.bs.alert")), b.isDefaultPrevented() || (g.removeClass("in"), a.support.transition && g.hasClass("fade") ? g.one("bsTransitionEnd", c).emulateTransitionEnd(d.TRANSITION_DURATION) : c()) }; var e = a.fn.alert; a.fn.alert = b, a.fn.alert.Constructor = d, a.fn.alert.noConflict = function () { return a.fn.alert = e, this }, a(document).on("click.bs.alert.data-api", c, d.prototype.close) }(jQuery), +function (a) { "use strict"; function b(b) { return this.each(function () { var d = a(this), e = d.data("bs.button"), f = "object" == typeof b && b; e || d.data("bs.button", e = new c(this, f)), "toggle" == b ? e.toggle() : b && e.setState(b) }) } var c = function (b, d) { this.$element = a(b), this.options = a.extend({}, c.DEFAULTS, d), this.isLoading = !1 }; c.VERSION = "3.3.5", c.DEFAULTS = {loadingText: "loading..."}, c.prototype.setState = function (b) { var c = "disabled", d = this.$element, e = d.is("input") ? "val" : "html", f = d.data(); b += "Text", null == f.resetText && d.data("resetText", d[e]()), setTimeout(a.proxy(function () { d[e](null == f[b] ? this.options[b] : f[b]), "loadingText" == b ? (this.isLoading = !0, d.addClass(c).attr(c, c)) : this.isLoading && (this.isLoading = !1, d.removeClass(c).removeAttr(c)) }, this), 0) }, c.prototype.toggle = function () { var a = !0, b = this.$element.closest('[data-toggle="buttons"]'); if (b.length) { var c = this.$element.find("input"); "radio" == c.prop("type") ? (c.prop("checked") && (a = !1), b.find(".active").removeClass("active"), this.$element.addClass("active")) : "checkbox" == c.prop("type") && (c.prop("checked") !== this.$element.hasClass("active") && (a = !1), this.$element.toggleClass("active")), c.prop("checked", this.$element.hasClass("active")), a && c.trigger("change") } else this.$element.attr("aria-pressed", !this.$element.hasClass("active")), this.$element.toggleClass("active") }; var d = a.fn.button; a.fn.button = b, a.fn.button.Constructor = c, a.fn.button.noConflict = function () { return a.fn.button = d, this }, a(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function (c) { var d = a(c.target); d.hasClass("btn") || (d = d.closest(".btn")), b.call(d, "toggle"), a(c.target).is('input[type="radio"]') || a(c.target).is('input[type="checkbox"]') || c.preventDefault() }).on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function (b) { a(b.target).closest(".btn").toggleClass("focus", /^focus(in)?$/.test(b.type)) }) }(jQuery), +function (a) { "use strict"; function b(b) { return this.each(function () { var d = a(this), e = d.data("bs.carousel"), f = a.extend({}, c.DEFAULTS, d.data(), "object" == typeof b && b), g = "string" == typeof b ? b : f.slide; e || d.data("bs.carousel", e = new c(this, f)), "number" == typeof b ? e.to(b) : g ? e[g]() : f.interval && e.pause().cycle() }) } var c = function (b, c) { this.$element = a(b), this.$indicators = this.$element.find(".carousel-indicators"), this.options = c, this.paused = null, this.sliding = null, this.interval = null, this.$active = null, this.$items = null, this.options.keyboard && this.$element.on("keydown.bs.carousel", a.proxy(this.keydown, this)), "hover" == this.options.pause && !("ontouchstart"in document.documentElement) && this.$element.on("mouseenter.bs.carousel", a.proxy(this.pause, this)).on("mouseleave.bs.carousel", a.proxy(this.cycle, this)) }; c.VERSION = "3.3.5", c.TRANSITION_DURATION = 600, c.DEFAULTS = { interval: 5e3, pause: "hover", wrap: !0, keyboard: !0 }, c.prototype.keydown = function (a) { if (!/input|textarea/i.test(a.target.tagName)) { switch (a.which) { case 37: this.prev(); break; case 39: this.next(); break; default: return } a.preventDefault() } }, c.prototype.cycle = function (b) { return b || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(a.proxy(this.next, this), this.options.interval)), this }, c.prototype.getItemIndex = function (a) { return this.$items = a.parent().children(".item"), this.$items.index(a || this.$active) }, c.prototype.getItemForDirection = function (a, b) { var c = this.getItemIndex(b), d = "prev" == a && 0 === c || "next" == a && c == this.$items.length - 1; if (d && !this.options.wrap)return b; var e = "prev" == a ? -1 : 1, f = (c + e) % this.$items.length; return this.$items.eq(f) }, c.prototype.to = function (a) { var b = this, c = this.getItemIndex(this.$active = this.$element.find(".item.active")); return a > this.$items.length - 1 || 0 > a ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function () { b.to(a) }) : c == a ? this.pause().cycle() : this.slide(a > c ? "next" : "prev", this.$items.eq(a)) }, c.prototype.pause = function (b) { return b || (this.paused = !0), this.$element.find(".next, .prev").length && a.support.transition && (this.$element.trigger(a.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this }, c.prototype.next = function () { return this.sliding ? void 0 : this.slide("next") }, c.prototype.prev = function () { return this.sliding ? void 0 : this.slide("prev") }, c.prototype.slide = function (b, d) { var e = this.$element.find(".item.active"), f = d || this.getItemForDirection(b, e), g = this.interval, h = "next" == b ? "left" : "right", i = this; if (f.hasClass("active"))return this.sliding = !1; var j = f[0], k = a.Event("slide.bs.carousel", {relatedTarget: j, direction: h}); if (this.$element.trigger(k), !k.isDefaultPrevented()) { if (this.sliding = !0, g && this.pause(), this.$indicators.length) { this.$indicators.find(".active").removeClass("active"); var l = a(this.$indicators.children()[this.getItemIndex(f)]); l && l.addClass("active") } var m = a.Event("slid.bs.carousel", {relatedTarget: j, direction: h}); return a.support.transition && this.$element.hasClass("slide") ? (f.addClass(b), f[0].offsetWidth, e.addClass(h), f.addClass(h), e.one("bsTransitionEnd", function () { f.removeClass([b, h].join(" ")).addClass("active"), e.removeClass(["active", h].join(" ")), i.sliding = !1, setTimeout(function () { i.$element.trigger(m) }, 0) }).emulateTransitionEnd(c.TRANSITION_DURATION)) : (e.removeClass("active"), f.addClass("active"), this.sliding = !1, this.$element.trigger(m)), g && this.cycle(), this } }; var d = a.fn.carousel; a.fn.carousel = b, a.fn.carousel.Constructor = c, a.fn.carousel.noConflict = function () { return a.fn.carousel = d, this }; var e = function (c) { var d, e = a(this), f = a(e.attr("data-target") || (d = e.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, "")); if (f.hasClass("carousel")) { var g = a.extend({}, f.data(), e.data()), h = e.attr("data-slide-to"); h && (g.interval = !1), b.call(f, g), h && f.data("bs.carousel").to(h), c.preventDefault() } }; a(document).on("click.bs.carousel.data-api", "[data-slide]", e).on("click.bs.carousel.data-api", "[data-slide-to]", e), a(window).on("load", function () { a('[data-ride="carousel"]').each(function () { var c = a(this); b.call(c, c.data()) }) }) }(jQuery), +function (a) { "use strict"; function b(b) { var c, d = b.attr("data-target") || (c = b.attr("href")) && c.replace(/.*(?=#[^\s]+$)/, ""); return a(d) } function c(b) { return this.each(function () { var c = a(this), e = c.data("bs.collapse"), f = a.extend({}, d.DEFAULTS, c.data(), "object" == typeof b && b); !e && f.toggle && /show|hide/.test(b) && (f.toggle = !1), e || c.data("bs.collapse", e = new d(this, f)), "string" == typeof b && e[b]() }) } var d = function (b, c) { this.$element = a(b), this.options = a.extend({}, d.DEFAULTS, c), this.$trigger = a('[data-toggle="collapse"][href="#' + b.id + '"],[data-toggle="collapse"][data-target="#' + b.id + '"]'), this.transitioning = null, this.options.parent ? this.$parent = this.getParent() : this.addAriaAndCollapsedClass(this.$element, this.$trigger), this.options.toggle && this.toggle() }; d.VERSION = "3.3.5", d.TRANSITION_DURATION = 350, d.DEFAULTS = {toggle: !0}, d.prototype.dimension = function () { var a = this.$element.hasClass("width"); return a ? "width" : "height" }, d.prototype.show = function () { if (!this.transitioning && !this.$element.hasClass("in")) { var b, e = this.$parent && this.$parent.children(".panel").children(".in, .collapsing"); if (!(e && e.length && (b = e.data("bs.collapse"), b && b.transitioning))) { var f = a.Event("show.bs.collapse"); if (this.$element.trigger(f), !f.isDefaultPrevented()) { e && e.length && (c.call(e, "hide"), b || e.data("bs.collapse", null)); var g = this.dimension(); this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded", !0), this.$trigger.removeClass("collapsed").attr("aria-expanded", !0), this.transitioning = 1; var h = function () { this.$element.removeClass("collapsing").addClass("collapse in")[g](""), this.transitioning = 0, this.$element.trigger("shown.bs.collapse") }; if (!a.support.transition)return h.call(this); var i = a.camelCase(["scroll", g].join("-")); this.$element.one("bsTransitionEnd", a.proxy(h, this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i]) } } } }, d.prototype.hide = function () { if (!this.transitioning && this.$element.hasClass("in")) { var b = a.Event("hide.bs.collapse"); if (this.$element.trigger(b), !b.isDefaultPrevented()) { var c = this.dimension(); this.$element[c](this.$element[c]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", !1), this.$trigger.addClass("collapsed").attr("aria-expanded", !1), this.transitioning = 1; var e = function () { this.transitioning = 0, this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse") }; return a.support.transition ? void this.$element[c](0).one("bsTransitionEnd", a.proxy(e, this)).emulateTransitionEnd(d.TRANSITION_DURATION) : e.call(this) } } }, d.prototype.toggle = function () { this[this.$element.hasClass("in") ? "hide" : "show"]() }, d.prototype.getParent = function () { return a(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each(a.proxy(function (c, d) { var e = a(d); this.addAriaAndCollapsedClass(b(e), e) }, this)).end() }, d.prototype.addAriaAndCollapsedClass = function (a, b) { var c = a.hasClass("in"); a.attr("aria-expanded", c), b.toggleClass("collapsed", !c).attr("aria-expanded", c) }; var e = a.fn.collapse; a.fn.collapse = c, a.fn.collapse.Constructor = d, a.fn.collapse.noConflict = function () { return a.fn.collapse = e, this }, a(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function (d) { var e = a(this); e.attr("data-target") || d.preventDefault(); var f = b(e), g = f.data("bs.collapse"), h = g ? "toggle" : e.data(); c.call(f, h) }) }(jQuery), +function (a) { "use strict"; function b(b) { var c = b.attr("data-target"); c || (c = b.attr("href"), c = c && /#[A-Za-z]/.test(c) && c.replace(/.*(?=#[^\s]*$)/, "")); var d = c && a(c); return d && d.length ? d : b.parent() } function c(c) { c && 3 === c.which || (a(e).remove(), a(f).each(function () { var d = a(this), e = b(d), f = {relatedTarget: this}; e.hasClass("open") && (c && "click" == c.type && /input|textarea/i.test(c.target.tagName) && a.contains(e[0], c.target) || (e.trigger(c = a.Event("hide.bs.dropdown", f)), c.isDefaultPrevented() || (d.attr("aria-expanded", "false"), e.removeClass("open").trigger("hidden.bs.dropdown", f)))) })) } function d(b) { return this.each(function () { var c = a(this), d = c.data("bs.dropdown"); d || c.data("bs.dropdown", d = new g(this)), "string" == typeof b && d[b].call(c) }) } var e = ".dropdown-backdrop", f = '[data-toggle="dropdown"]', g = function (b) { a(b).on("click.bs.dropdown", this.toggle) }; g.VERSION = "3.3.5", g.prototype.toggle = function (d) { var e = a(this); if (!e.is(".disabled, :disabled")) { var f = b(e), g = f.hasClass("open"); if (c(), !g) { "ontouchstart"in document.documentElement && !f.closest(".navbar-nav").length && a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click", c); var h = {relatedTarget: this}; if (f.trigger(d = a.Event("show.bs.dropdown", h)), d.isDefaultPrevented())return; e.trigger("focus").attr("aria-expanded", "true"), f.toggleClass("open").trigger("shown.bs.dropdown", h) } return !1 } }, g.prototype.keydown = function (c) { if (/(38|40|27|32)/.test(c.which) && !/input|textarea/i.test(c.target.tagName)) { var d = a(this); if (c.preventDefault(), c.stopPropagation(), !d.is(".disabled, :disabled")) { var e = b(d), g = e.hasClass("open"); if (!g && 27 != c.which || g && 27 == c.which)return 27 == c.which && e.find(f).trigger("focus"), d.trigger("click"); var h = " li:not(.disabled):visible a", i = e.find(".dropdown-menu" + h); if (i.length) { var j = i.index(c.target); 38 == c.which && j > 0 && j--, 40 == c.which && j < i.length - 1 && j++, ~j || (j = 0), i.eq(j).trigger("focus") } } } }; var h = a.fn.dropdown; a.fn.dropdown = d, a.fn.dropdown.Constructor = g, a.fn.dropdown.noConflict = function () { return a.fn.dropdown = h, this }, a(document).on("click.bs.dropdown.data-api", c).on("click.bs.dropdown.data-api", ".dropdown form", function (a) { a.stopPropagation() }).on("click.bs.dropdown.data-api", f, g.prototype.toggle).on("keydown.bs.dropdown.data-api", f, g.prototype.keydown).on("keydown.bs.dropdown.data-api", ".dropdown-menu", g.prototype.keydown) }(jQuery), +function (a) { "use strict"; function b(b, d) { return this.each(function () { var e = a(this), f = e.data("bs.modal"), g = a.extend({}, c.DEFAULTS, e.data(), "object" == typeof b && b); f || e.data("bs.modal", f = new c(this, g)), "string" == typeof b ? f[b](d) : g.show && f.show(d) }) } var c = function (b, c) { this.options = c, this.$body = a(document.body), this.$element = a(b), this.$dialog = this.$element.find(".modal-dialog"), this.$backdrop = null, this.isShown = null, this.originalBodyPad = null, this.scrollbarWidth = 0, this.ignoreBackdropClick = !1, this.options.remote && this.$element.find(".modal-content").load(this.options.remote, a.proxy(function () { this.$element.trigger("loaded.bs.modal") }, this)) }; c.VERSION = "3.3.5", c.TRANSITION_DURATION = 300, c.BACKDROP_TRANSITION_DURATION = 150, c.DEFAULTS = { backdrop: !0, keyboard: !0, show: !0 }, c.prototype.toggle = function (a) { return this.isShown ? this.hide() : this.show(a) }, c.prototype.show = function (b) { var d = this, e = a.Event("show.bs.modal", {relatedTarget: b}); this.$element.trigger(e), this.isShown || e.isDefaultPrevented() || (this.isShown = !0, this.checkScrollbar(), this.setScrollbar(), this.$body.addClass("modal-open"), this.escape(), this.resize(), this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', a.proxy(this.hide, this)), this.$dialog.on("mousedown.dismiss.bs.modal", function () { d.$element.one("mouseup.dismiss.bs.modal", function (b) { a(b.target).is(d.$element) && (d.ignoreBackdropClick = !0) }) }), this.backdrop(function () { var e = a.support.transition && d.$element.hasClass("fade"); d.$element.parent().length || d.$element.appendTo(d.$body), d.$element.show().scrollTop(0), d.adjustDialog(), e && d.$element[0].offsetWidth, d.$element.addClass("in"), d.enforceFocus(); var f = a.Event("shown.bs.modal", {relatedTarget: b}); e ? d.$dialog.one("bsTransitionEnd", function () { d.$element.trigger("focus").trigger(f) }).emulateTransitionEnd(c.TRANSITION_DURATION) : d.$element.trigger("focus").trigger(f) })) }, c.prototype.hide = function (b) { b && b.preventDefault(), b = a.Event("hide.bs.modal"), this.$element.trigger(b), this.isShown && !b.isDefaultPrevented() && (this.isShown = !1, this.escape(), this.resize(), a(document).off("focusin.bs.modal"), this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"), this.$dialog.off("mousedown.dismiss.bs.modal"), a.support.transition && this.$element.hasClass("fade") ? this.$element.one("bsTransitionEnd", a.proxy(this.hideModal, this)).emulateTransitionEnd(c.TRANSITION_DURATION) : this.hideModal()) }, c.prototype.enforceFocus = function () { a(document).off("focusin.bs.modal").on("focusin.bs.modal", a.proxy(function (a) { this.$element[0] === a.target || this.$element.has(a.target).length || this.$element.trigger("focus") }, this)) }, c.prototype.escape = function () { this.isShown && this.options.keyboard ? this.$element.on("keydown.dismiss.bs.modal", a.proxy(function (a) { 27 == a.which && this.hide() }, this)) : this.isShown || this.$element.off("keydown.dismiss.bs.modal") }, c.prototype.resize = function () { this.isShown ? a(window).on("resize.bs.modal", a.proxy(this.handleUpdate, this)) : a(window).off("resize.bs.modal") }, c.prototype.hideModal = function () { var a = this; this.$element.hide(), this.backdrop(function () { a.$body.removeClass("modal-open"), a.resetAdjustments(), a.resetScrollbar(), a.$element.trigger("hidden.bs.modal") }) }, c.prototype.removeBackdrop = function () { this.$backdrop && this.$backdrop.remove(), this.$backdrop = null }, c.prototype.backdrop = function (b) { var d = this, e = this.$element.hasClass("fade") ? "fade" : ""; if (this.isShown && this.options.backdrop) { var f = a.support.transition && e; if (this.$backdrop = a(document.createElement("div")).addClass("modal-backdrop " + e).appendTo(this.$body), this.$element.on("click.dismiss.bs.modal", a.proxy(function (a) { return this.ignoreBackdropClick ? void(this.ignoreBackdropClick = !1) : void(a.target === a.currentTarget && ("static" == this.options.backdrop ? this.$element[0].focus() : this.hide())) }, this)), f && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !b)return; f ? this.$backdrop.one("bsTransitionEnd", b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION) : b() } else if (!this.isShown && this.$backdrop) { this.$backdrop.removeClass("in"); var g = function () { d.removeBackdrop(), b && b() }; a.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one("bsTransitionEnd", g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION) : g() } else b && b() }, c.prototype.handleUpdate = function () { this.adjustDialog() }, c.prototype.adjustDialog = function () { var a = this.$element[0].scrollHeight > document.documentElement.clientHeight; this.$element.css({ paddingLeft: !this.bodyIsOverflowing && a ? this.scrollbarWidth : "", paddingRight: this.bodyIsOverflowing && !a ? this.scrollbarWidth : "" }) }, c.prototype.resetAdjustments = function () { this.$element.css({paddingLeft: "", paddingRight: ""}) }, c.prototype.checkScrollbar = function () { var a = window.innerWidth; if (!a) { var b = document.documentElement.getBoundingClientRect(); a = b.right - Math.abs(b.left) } this.bodyIsOverflowing = document.body.clientWidth < a, this.scrollbarWidth = this.measureScrollbar() }, c.prototype.setScrollbar = function () { var a = parseInt(this.$body.css("padding-right") || 0, 10); this.originalBodyPad = document.body.style.paddingRight || "", this.bodyIsOverflowing && this.$body.css("padding-right", a + this.scrollbarWidth) }, c.prototype.resetScrollbar = function () { this.$body.css("padding-right", this.originalBodyPad) }, c.prototype.measureScrollbar = function () { var a = document.createElement("div"); a.className = "modal-scrollbar-measure", this.$body.append(a); var b = a.offsetWidth - a.clientWidth; return this.$body[0].removeChild(a), b }; var d = a.fn.modal; a.fn.modal = b, a.fn.modal.Constructor = c, a.fn.modal.noConflict = function () { return a.fn.modal = d, this }, a(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function (c) { var d = a(this), e = d.attr("href"), f = a(d.attr("data-target") || e && e.replace(/.*(?=#[^\s]+$)/, "")), g = f.data("bs.modal") ? "toggle" : a.extend({remote: !/#/.test(e) && e}, f.data(), d.data()); d.is("a") && c.preventDefault(), f.one("show.bs.modal", function (a) { a.isDefaultPrevented() || f.one("hidden.bs.modal", function () { d.is(":visible") && d.trigger("focus") }) }), b.call(f, g, this) }) }(jQuery), +function (a) { "use strict"; function b(b) { return this.each(function () { var d = a(this), e = d.data("bs.tooltip"), f = "object" == typeof b && b; (e || !/destroy|hide/.test(b)) && (e || d.data("bs.tooltip", e = new c(this, f)), "string" == typeof b && e[b]()) }) } var c = function (a, b) { this.type = null, this.options = null, this.enabled = null, this.timeout = null, this.hoverState = null, this.$element = null, this.inState = null, this.init("tooltip", a, b) }; c.VERSION = "3.3.5", c.TRANSITION_DURATION = 150, c.DEFAULTS = { animation: !0, placement: "top", selector: !1, template: '', trigger: "hover focus", title: "", delay: 0, html: !1, container: !1, viewport: {selector: "body", padding: 0} }, c.prototype.init = function (b, c, d) { if (this.enabled = !0, this.type = b, this.$element = a(c), this.options = this.getOptions(d), this.$viewport = this.options.viewport && a(a.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : this.options.viewport.selector || this.options.viewport), this.inState = { click: !1, hover: !1, focus: !1 }, this.$element[0]instanceof document.constructor && !this.options.selector)throw new Error("`selector` option must be specified when initializing " + this.type + " on the window.document object!"); for (var e = this.options.trigger.split(" "), f = e.length; f--;) { var g = e[f]; if ("click" == g)this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this)); else if ("manual" != g) { var h = "hover" == g ? "mouseenter" : "focusin", i = "hover" == g ? "mouseleave" : "focusout"; this.$element.on(h + "." + this.type, this.options.selector, a.proxy(this.enter, this)), this.$element.on(i + "." + this.type, this.options.selector, a.proxy(this.leave, this)) } } this.options.selector ? this._options = a.extend({}, this.options, { trigger: "manual", selector: "" }) : this.fixTitle() }, c.prototype.getDefaults = function () { return c.DEFAULTS }, c.prototype.getOptions = function (b) { return b = a.extend({}, this.getDefaults(), this.$element.data(), b), b.delay && "number" == typeof b.delay && (b.delay = { show: b.delay, hide: b.delay }), b }, c.prototype.getDelegateOptions = function () { var b = {}, c = this.getDefaults(); return this._options && a.each(this._options, function (a, d) { c[a] != d && (b[a] = d) }), b }, c.prototype.enter = function (b) { var c = b instanceof this.constructor ? b : a(b.currentTarget).data("bs." + this.type); return c || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c)), b instanceof a.Event && (c.inState["focusin" == b.type ? "focus" : "hover"] = !0), c.tip().hasClass("in") || "in" == c.hoverState ? void(c.hoverState = "in") : (clearTimeout(c.timeout), c.hoverState = "in", c.options.delay && c.options.delay.show ? void(c.timeout = setTimeout(function () { "in" == c.hoverState && c.show() }, c.options.delay.show)) : c.show()) }, c.prototype.isInStateTrue = function () { for (var a in this.inState)if (this.inState[a])return !0; return !1 }, c.prototype.leave = function (b) { var c = b instanceof this.constructor ? b : a(b.currentTarget).data("bs." + this.type); return c || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c)), b instanceof a.Event && (c.inState["focusout" == b.type ? "focus" : "hover"] = !1), c.isInStateTrue() ? void 0 : (clearTimeout(c.timeout), c.hoverState = "out", c.options.delay && c.options.delay.hide ? void(c.timeout = setTimeout(function () { "out" == c.hoverState && c.hide() }, c.options.delay.hide)) : c.hide()) }, c.prototype.show = function () { var b = a.Event("show.bs." + this.type); if (this.hasContent() && this.enabled) { this.$element.trigger(b); var d = a.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]); if (b.isDefaultPrevented() || !d)return; var e = this, f = this.tip(), g = this.getUID(this.type); this.setContent(), f.attr("id", g), this.$element.attr("aria-describedby", g), this.options.animation && f.addClass("fade"); var h = "function" == typeof this.options.placement ? this.options.placement.call(this, f[0], this.$element[0]) : this.options.placement, i = /\s?auto?\s?/i, j = i.test(h); j && (h = h.replace(i, "") || "top"), f.detach().css({ top: 0, left: 0, display: "block" }).addClass(h).data("bs." + this.type, this), this.options.container ? f.appendTo(this.options.container) : f.insertAfter(this.$element), this.$element.trigger("inserted.bs." + this.type); var k = this.getPosition(), l = f[0].offsetWidth, m = f[0].offsetHeight; if (j) { var n = h, o = this.getPosition(this.$viewport); h = "bottom" == h && k.bottom + m > o.bottom ? "top" : "top" == h && k.top - m < o.top ? "bottom" : "right" == h && k.right + l > o.width ? "left" : "left" == h && k.left - l < o.left ? "right" : h, f.removeClass(n).addClass(h) } var p = this.getCalculatedOffset(h, k, l, m); this.applyPlacement(p, h); var q = function () { var a = e.hoverState; e.$element.trigger("shown.bs." + e.type), e.hoverState = null, "out" == a && e.leave(e) }; a.support.transition && this.$tip.hasClass("fade") ? f.one("bsTransitionEnd", q).emulateTransitionEnd(c.TRANSITION_DURATION) : q() } }, c.prototype.applyPlacement = function (b, c) { var d = this.tip(), e = d[0].offsetWidth, f = d[0].offsetHeight, g = parseInt(d.css("margin-top"), 10), h = parseInt(d.css("margin-left"), 10); isNaN(g) && (g = 0), isNaN(h) && (h = 0), b.top += g, b.left += h, a.offset.setOffset(d[0], a.extend({ using: function (a) { d.css({top: Math.round(a.top), left: Math.round(a.left)}) } }, b), 0), d.addClass("in"); var i = d[0].offsetWidth, j = d[0].offsetHeight; "top" == c && j != f && (b.top = b.top + f - j); var k = this.getViewportAdjustedDelta(c, b, i, j); k.left ? b.left += k.left : b.top += k.top; var l = /top|bottom/.test(c), m = l ? 2 * k.left - e + i : 2 * k.top - f + j, n = l ? "offsetWidth" : "offsetHeight"; d.offset(b), this.replaceArrow(m, d[0][n], l) }, c.prototype.replaceArrow = function (a, b, c) { this.arrow().css(c ? "left" : "top", 50 * (1 - a / b) + "%").css(c ? "top" : "left", "") }, c.prototype.setContent = function () { var a = this.tip(), b = this.getTitle(); a.find(".tooltip-inner")[this.options.html ? "html" : "text"](b), a.removeClass("fade in top bottom left right") }, c.prototype.hide = function (b) { function d() { "in" != e.hoverState && f.detach(), e.$element.removeAttr("aria-describedby").trigger("hidden.bs." + e.type), b && b() } var e = this, f = a(this.$tip), g = a.Event("hide.bs." + this.type); return this.$element.trigger(g), g.isDefaultPrevented() ? void 0 : (f.removeClass("in"), a.support.transition && f.hasClass("fade") ? f.one("bsTransitionEnd", d).emulateTransitionEnd(c.TRANSITION_DURATION) : d(), this.hoverState = null, this) }, c.prototype.fixTitle = function () { var a = this.$element; (a.attr("title") || "string" != typeof a.attr("data-original-title")) && a.attr("data-original-title", a.attr("title") || "").attr("title", "") }, c.prototype.hasContent = function () { return this.getTitle() }, c.prototype.getPosition = function (b) { b = b || this.$element; var c = b[0], d = "BODY" == c.tagName, e = c.getBoundingClientRect(); null == e.width && (e = a.extend({}, e, {width: e.right - e.left, height: e.bottom - e.top})); var f = d ? { top: 0, left: 0 } : b.offset(), g = {scroll: d ? document.documentElement.scrollTop || document.body.scrollTop : b.scrollTop()}, h = d ? { width: a(window).width(), height: a(window).height() } : null; return a.extend({}, e, g, h, f) }, c.prototype.getCalculatedOffset = function (a, b, c, d) { return "bottom" == a ? { top: b.top + b.height, left: b.left + b.width / 2 - c / 2 } : "top" == a ? { top: b.top - d, left: b.left + b.width / 2 - c / 2 } : "left" == a ? {top: b.top + b.height / 2 - d / 2, left: b.left - c} : { top: b.top + b.height / 2 - d / 2, left: b.left + b.width } }, c.prototype.getViewportAdjustedDelta = function (a, b, c, d) { var e = {top: 0, left: 0}; if (!this.$viewport)return e; var f = this.options.viewport && this.options.viewport.padding || 0, g = this.getPosition(this.$viewport); if (/right|left/.test(a)) { var h = b.top - f - g.scroll, i = b.top + f - g.scroll + d; h < g.top ? e.top = g.top - h : i > g.top + g.height && (e.top = g.top + g.height - i) } else { var j = b.left - f, k = b.left + f + c; j < g.left ? e.left = g.left - j : k > g.right && (e.left = g.left + g.width - k) } return e }, c.prototype.getTitle = function () { var a, b = this.$element, c = this.options; return a = b.attr("data-original-title") || ("function" == typeof c.title ? c.title.call(b[0]) : c.title) }, c.prototype.getUID = function (a) { do a += ~~(1e6 * Math.random()); while (document.getElementById(a)); return a }, c.prototype.tip = function () { if (!this.$tip && (this.$tip = a(this.options.template), 1 != this.$tip.length))throw new Error(this.type + " `template` option must consist of exactly 1 top-level element!"); return this.$tip }, c.prototype.arrow = function () { return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") }, c.prototype.enable = function () { this.enabled = !0 }, c.prototype.disable = function () { this.enabled = !1 }, c.prototype.toggleEnabled = function () { this.enabled = !this.enabled }, c.prototype.toggle = function (b) { var c = this; b && (c = a(b.currentTarget).data("bs." + this.type), c || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c))), b ? (c.inState.click = !c.inState.click, c.isInStateTrue() ? c.enter(c) : c.leave(c)) : c.tip().hasClass("in") ? c.leave(c) : c.enter(c) }, c.prototype.destroy = function () { var a = this; clearTimeout(this.timeout), this.hide(function () { a.$element.off("." + a.type).removeData("bs." + a.type), a.$tip && a.$tip.detach(), a.$tip = null, a.$arrow = null, a.$viewport = null }) }; var d = a.fn.tooltip; a.fn.tooltip = b, a.fn.tooltip.Constructor = c, a.fn.tooltip.noConflict = function () { return a.fn.tooltip = d, this } }(jQuery), +function (a) { "use strict"; function b(b) { return this.each(function () { var d = a(this), e = d.data("bs.popover"), f = "object" == typeof b && b; (e || !/destroy|hide/.test(b)) && (e || d.data("bs.popover", e = new c(this, f)), "string" == typeof b && e[b]()) }) } var c = function (a, b) { this.init("popover", a, b) }; if (!a.fn.tooltip)throw new Error("Popover requires tooltip.js"); c.VERSION = "3.3.5", c.DEFAULTS = a.extend({}, a.fn.tooltip.Constructor.DEFAULTS, { placement: "right", trigger: "click", content: "", template: '' }), c.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype), c.prototype.constructor = c, c.prototype.getDefaults = function () { return c.DEFAULTS }, c.prototype.setContent = function () { var a = this.tip(), b = this.getTitle(), c = this.getContent(); a.find(".popover-title")[this.options.html ? "html" : "text"](b), a.find(".popover-content").children().detach().end()[this.options.html ? "string" == typeof c ? "html" : "append" : "text"](c), a.removeClass("fade top bottom left right in"), a.find(".popover-title").html() || a.find(".popover-title").hide() }, c.prototype.hasContent = function () { return this.getTitle() || this.getContent() }, c.prototype.getContent = function () { var a = this.$element, b = this.options; return a.attr("data-content") || ("function" == typeof b.content ? b.content.call(a[0]) : b.content) }, c.prototype.arrow = function () { return this.$arrow = this.$arrow || this.tip().find(".arrow") }; var d = a.fn.popover; a.fn.popover = b, a.fn.popover.Constructor = c, a.fn.popover.noConflict = function () { return a.fn.popover = d, this } }(jQuery), +function (a) { "use strict"; function b(c, d) { this.$body = a(document.body), this.$scrollElement = a(a(c).is(document.body) ? window : c), this.options = a.extend({}, b.DEFAULTS, d), this.selector = (this.options.target || "") + " .nav li > a", this.offsets = [], this.targets = [], this.activeTarget = null, this.scrollHeight = 0, this.$scrollElement.on("scroll.bs.scrollspy", a.proxy(this.process, this)), this.refresh(), this.process() } function c(c) { return this.each(function () { var d = a(this), e = d.data("bs.scrollspy"), f = "object" == typeof c && c; e || d.data("bs.scrollspy", e = new b(this, f)), "string" == typeof c && e[c]() }) } b.VERSION = "3.3.5", b.DEFAULTS = {offset: 10}, b.prototype.getScrollHeight = function () { return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) }, b.prototype.refresh = function () { var b = this, c = "offset", d = 0; this.offsets = [], this.targets = [], this.scrollHeight = this.getScrollHeight(), a.isWindow(this.$scrollElement[0]) || (c = "position", d = this.$scrollElement.scrollTop()), this.$body.find(this.selector).map(function () { var b = a(this), e = b.data("target") || b.attr("href"), f = /^#./.test(e) && a(e); return f && f.length && f.is(":visible") && [[f[c]().top + d, e]] || null }).sort(function (a, b) { return a[0] - b[0] }).each(function () { b.offsets.push(this[0]), b.targets.push(this[1]) }) }, b.prototype.process = function () { var a, b = this.$scrollElement.scrollTop() + this.options.offset, c = this.getScrollHeight(), d = this.options.offset + c - this.$scrollElement.height(), e = this.offsets, f = this.targets, g = this.activeTarget; if (this.scrollHeight != c && this.refresh(), b >= d)return g != (a = f[f.length - 1]) && this.activate(a); if (g && b < e[0])return this.activeTarget = null, this.clear(); for (a = e.length; a--;)g != f[a] && b >= e[a] && (void 0 === e[a + 1] || b < e[a + 1]) && this.activate(f[a]) }, b.prototype.activate = function (b) { this.activeTarget = b, this.clear(); var c = this.selector + '[data-target="' + b + '"],' + this.selector + '[href="' + b + '"]', d = a(c).parents("li").addClass("active"); d.parent(".dropdown-menu").length && (d = d.closest("li.dropdown").addClass("active")), d.trigger("activate.bs.scrollspy") }, b.prototype.clear = function () { a(this.selector).parentsUntil(this.options.target, ".active").removeClass("active") }; var d = a.fn.scrollspy; a.fn.scrollspy = c, a.fn.scrollspy.Constructor = b, a.fn.scrollspy.noConflict = function () { return a.fn.scrollspy = d, this }, a(window).on("load.bs.scrollspy.data-api", function () { a('[data-spy="scroll"]').each(function () { var b = a(this); c.call(b, b.data()) }) }) }(jQuery), +function (a) { "use strict"; function b(b) { return this.each(function () { var d = a(this), e = d.data("bs.tab"); e || d.data("bs.tab", e = new c(this)), "string" == typeof b && e[b]() }) } var c = function (b) { this.element = a(b) }; c.VERSION = "3.3.5", c.TRANSITION_DURATION = 150, c.prototype.show = function () { var b = this.element, c = b.closest("ul:not(.dropdown-menu)"), d = b.data("target"); if (d || (d = b.attr("href"), d = d && d.replace(/.*(?=#[^\s]*$)/, "")), !b.parent("li").hasClass("active")) { var e = c.find(".active:last a"), f = a.Event("hide.bs.tab", {relatedTarget: b[0]}), g = a.Event("show.bs.tab", {relatedTarget: e[0]}); if (e.trigger(f), b.trigger(g), !g.isDefaultPrevented() && !f.isDefaultPrevented()) { var h = a(d); this.activate(b.closest("li"), c), this.activate(h, h.parent(), function () { e.trigger({type: "hidden.bs.tab", relatedTarget: b[0]}), b.trigger({ type: "shown.bs.tab", relatedTarget: e[0] }) }) } } }, c.prototype.activate = function (b, d, e) { function f() { g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !1), b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded", !0), h ? (b[0].offsetWidth, b.addClass("in")) : b.removeClass("fade"), b.parent(".dropdown-menu").length && b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !0), e && e() } var g = d.find("> .active"), h = e && a.support.transition && (g.length && g.hasClass("fade") || !!d.find("> .fade").length); g.length && h ? g.one("bsTransitionEnd", f).emulateTransitionEnd(c.TRANSITION_DURATION) : f(), g.removeClass("in") }; var d = a.fn.tab; a.fn.tab = b, a.fn.tab.Constructor = c, a.fn.tab.noConflict = function () { return a.fn.tab = d, this }; var e = function (c) { c.preventDefault(), b.call(a(this), "show") }; a(document).on("click.bs.tab.data-api", '[data-toggle="tab"]', e).on("click.bs.tab.data-api", '[data-toggle="pill"]', e) }(jQuery), +function (a) { "use strict"; function b(b) { return this.each(function () { var d = a(this), e = d.data("bs.affix"), f = "object" == typeof b && b; e || d.data("bs.affix", e = new c(this, f)), "string" == typeof b && e[b]() }) } var c = function (b, d) { this.options = a.extend({}, c.DEFAULTS, d), this.$target = a(this.options.target).on("scroll.bs.affix.data-api", a.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", a.proxy(this.checkPositionWithEventLoop, this)), this.$element = a(b), this.affixed = null, this.unpin = null, this.pinnedOffset = null, this.checkPosition() }; c.VERSION = "3.3.5", c.RESET = "affix affix-top affix-bottom", c.DEFAULTS = { offset: 0, target: window }, c.prototype.getState = function (a, b, c, d) { var e = this.$target.scrollTop(), f = this.$element.offset(), g = this.$target.height(); if (null != c && "top" == this.affixed)return c > e ? "top" : !1; if ("bottom" == this.affixed)return null != c ? e + this.unpin <= f.top ? !1 : "bottom" : a - d >= e + g ? !1 : "bottom"; var h = null == this.affixed, i = h ? e : f.top, j = h ? g : b; return null != c && c >= e ? "top" : null != d && i + j >= a - d ? "bottom" : !1 }, c.prototype.getPinnedOffset = function () { if (this.pinnedOffset)return this.pinnedOffset; this.$element.removeClass(c.RESET).addClass("affix"); var a = this.$target.scrollTop(), b = this.$element.offset(); return this.pinnedOffset = b.top - a }, c.prototype.checkPositionWithEventLoop = function () { setTimeout(a.proxy(this.checkPosition, this), 1) }, c.prototype.checkPosition = function () { if (this.$element.is(":visible")) { var b = this.$element.height(), d = this.options.offset, e = d.top, f = d.bottom, g = Math.max(a(document).height(), a(document.body).height()); "object" != typeof d && (f = e = d), "function" == typeof e && (e = d.top(this.$element)), "function" == typeof f && (f = d.bottom(this.$element)); var h = this.getState(g, b, e, f); if (this.affixed != h) { null != this.unpin && this.$element.css("top", ""); var i = "affix" + (h ? "-" + h : ""), j = a.Event(i + ".bs.affix"); if (this.$element.trigger(j), j.isDefaultPrevented())return; this.affixed = h, this.unpin = "bottom" == h ? this.getPinnedOffset() : null, this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix", "affixed") + ".bs.affix") } "bottom" == h && this.$element.offset({top: g - b - f}) } }; var d = a.fn.affix; a.fn.affix = b, a.fn.affix.Constructor = c, a.fn.affix.noConflict = function () { return a.fn.affix = d, this }, a(window).on("load", function () { a('[data-spy="affix"]').each(function () { var c = a(this), d = c.data(); d.offset = d.offset || {}, null != d.offsetBottom && (d.offset.bottom = d.offsetBottom), null != d.offsetTop && (d.offset.top = d.offsetTop), b.call(c, d) }) }) }(jQuery); /* * Swiper 2.1 - Mobile Touch Slider * http://www.idangero.us/sliders/swiper/ * * Copyright 2012-2013, Vladimir Kharlampidi * The iDangero.us * http://www.idangero.us/ * * Licensed under GPL & MIT * * Updated on: August 22, 2013 */ var Swiper = function (f, b) { function g(a) { return document.querySelectorAll ? document.querySelectorAll(a) : jQuery(a) } function h() { var c = y - l; b.freeMode && (c = y - l); b.slidesPerView > a.slides.length && (c = 0); 0 > c && (c = 0); return c } function n() { function c(c) { var d = new Image; d.onload = function () { a.imagesLoaded++; if (a.imagesLoaded == a.imagesToLoad.length && (a.reInit(), b.onImagesReady))b.onImagesReady(a) }; d.src = c } a.browser.ie10 ? (a.h.addEventListener(a.wrapper, a.touchEvents.touchStart, z, !1), a.h.addEventListener(document, a.touchEvents.touchMove, A, !1), a.h.addEventListener(document, a.touchEvents.touchEnd, B, !1)) : (a.support.touch && (a.h.addEventListener(a.wrapper, "touchstart", z, !1), a.h.addEventListener(a.wrapper, "touchmove", A, !1), a.h.addEventListener(a.wrapper, "touchend", B, !1)), b.simulateTouch && (a.h.addEventListener(a.wrapper, "mousedown", z, !1), a.h.addEventListener(document, "mousemove", A, !1), a.h.addEventListener(document, "mouseup", B, !1))); b.autoResize && a.h.addEventListener(window, "resize", a.resizeFix, !1); t(); a._wheelEvent = !1; if (b.mousewheelControl) { void 0 !== document.onmousewheel && (a._wheelEvent = "mousewheel"); try { WheelEvent("wheel"), a._wheelEvent = "wheel" } catch (d) { } a._wheelEvent || (a._wheelEvent = "DOMMouseScroll"); a._wheelEvent && a.h.addEventListener(a.container, a._wheelEvent, N, !1) } b.keyboardControl && a.h.addEventListener(document, "keydown", O, !1); if (b.updateOnImagesReady) { document.querySelectorAll ? a.imagesToLoad = a.container.querySelectorAll("img") : window.jQuery && (a.imagesToLoad = g(a.container).find("img")); for (var e = 0; e < a.imagesToLoad.length; e++)c(a.imagesToLoad[e].getAttribute("src")) } } function t() { if (b.preventLinks) { var c = []; document.querySelectorAll ? c = a.container.querySelectorAll("a") : window.jQuery && (c = g(a.container).find("a")); for (var d = 0; d < c.length; d++)a.h.addEventListener(c[d], "click", P, !1) } if (b.releaseFormElements)for (c = document.querySelectorAll ? a.container.querySelectorAll("input, textarea, select") : g(a.container).find("input, textarea, select"), d = 0; d < c.length; d++)a.h.addEventListener(c[d], a.touchEvents.touchStart, Q, !0); if (b.onSlideClick)for (d = 0; d < a.slides.length; d++)a.h.addEventListener(a.slides[d], "click", R, !1); if (b.onSlideTouch)for (d = 0; d < a.slides.length; d++)a.h.addEventListener(a.slides[d], a.touchEvents.touchStart, S, !1) } function v() { if (b.onSlideClick)for (var c = 0; c < a.slides.length; c++)a.h.removeEventListener(a.slides[c], "click", R, !1); if (b.onSlideTouch)for (c = 0; c < a.slides.length; c++)a.h.removeEventListener(a.slides[c], a.touchEvents.touchStart, S, !1); if (b.releaseFormElements)for (var d = document.querySelectorAll ? a.container.querySelectorAll("input, textarea, select") : g(a.container).find("input, textarea, select"), c = 0; c < d.length; c++)a.h.removeEventListener(d[c], a.touchEvents.touchStart, Q, !0); if (b.preventLinks)for (d = [], document.querySelectorAll ? d = a.container.querySelectorAll("a") : window.jQuery && (d = g(a.container).find("a")), c = 0; c < d.length; c++)a.h.removeEventListener(d[c], "click", P, !1) } function O(c) { var b = c.keyCode || c.charCode; if (37 == b || 39 == b || 38 == b || 40 == b) { for (var e = !1, f = a.h.getOffset(a.container), h = a.h.windowScroll().left, g = a.h.windowScroll().top, m = a.h.windowWidth(), l = a.h.windowHeight(), f = [[f.left, f.top], [f.left + a.width, f.top], [f.left, f.top + a.height], [f.left + a.width, f.top + a.height]], p = 0; p < f.length; p++) { var r = f[p]; r[0] >= h && (r[0] <= h + m && r[1] >= g && r[1] <= g + l) && (e = !0) } if (!e)return } if (k) { if (37 == b || 39 == b)c.preventDefault ? c.preventDefault() : c.returnValue = !1; 39 == b && a.swipeNext(); 37 == b && a.swipePrev() } else { if (38 == b || 40 == b)c.preventDefault ? c.preventDefault() : c.returnValue = !1; 40 == b && a.swipeNext(); 38 == b && a.swipePrev() } } function N(c) { var d = a._wheelEvent, e; c.detail ? e = -c.detail : "mousewheel" == d ? e = c.wheelDelta : "DOMMouseScroll" == d ? e = -c.detail : "wheel" == d && (e = Math.abs(c.deltaX) > Math.abs(c.deltaY) ? -c.deltaX : -c.deltaY); b.freeMode ? (k ? a.getWrapperTranslate("x") : a.getWrapperTranslate("y"), k ? (d = a.getWrapperTranslate("x") + e, e = a.getWrapperTranslate("y"), 0 < d && (d = 0), d < -h() && (d = -h())) : (d = a.getWrapperTranslate("x"), e = a.getWrapperTranslate("y") + e, 0 < e && (e = 0), e < -h() && (e = -h())), a.setWrapperTransition(0), a.setWrapperTranslate(d, e, 0), k ? a.updateActiveSlide(d) : a.updateActiveSlide(e)) : 0 > e ? a.swipeNext() : a.swipePrev(); b.autoplay && a.stopAutoplay(); c.preventDefault ? c.preventDefault() : c.returnValue = !1; return !1 } function T(a) { for (var d = !1; !d;)-1 < a.className.indexOf(b.slideClass) && (d = a), a = a.parentElement; return d } function R(c) { a.allowSlideClick && (c.target ? (a.clickedSlide = this, a.clickedSlideIndex = a.slides.indexOf(this)) : (a.clickedSlide = T(c.srcElement), a.clickedSlideIndex = a.slides.indexOf(a.clickedSlide)), b.onSlideClick(a)) } function S(c) { a.clickedSlide = c.target ? this : T(c.srcElement); a.clickedSlideIndex = a.slides.indexOf(a.clickedSlide); b.onSlideTouch(a) } function P(b) { if (!a.allowLinks)return b.preventDefault ? b.preventDefault() : b.returnValue = !1, !1 } function Q(a) { a.stopPropagation ? a.stopPropagation() : a.returnValue = !1; return !1 } function z(c) { b.preventLinks && (a.allowLinks = !0); if (a.isTouched || b.onlyExternal)return !1; var d; if (d = b.noSwiping)if (d = c.target || c.srcElement) { d = c.target || c.srcElement; var e = !1; do-1 < d.className.indexOf(b.noSwipingClass) && (e = !0), d = d.parentElement; while (!e && d.parentElement && -1 == d.className.indexOf(b.wrapperClass)); !e && (-1 < d.className.indexOf(b.wrapperClass) && -1 < d.className.indexOf(b.noSwipingClass)) && (e = !0); d = e } if (d)return !1; G = !1; a.isTouched = !0; u = "touchstart" == c.type; if (!u || 1 == c.targetTouches.length) { b.loop && a.fixLoop(); a.callPlugins("onTouchStartBegin"); u || (c.preventDefault ? c.preventDefault() : c.returnValue = !1); d = u ? c.targetTouches[0].pageX : c.pageX || c.clientX; c = u ? c.targetTouches[0].pageY : c.pageY || c.clientY; a.touches.startX = a.touches.currentX = d; a.touches.startY = a.touches.currentY = c; a.touches.start = a.touches.current = k ? d : c; a.setWrapperTransition(0); a.positions.start = a.positions.current = k ? a.getWrapperTranslate("x") : a.getWrapperTranslate("y"); k ? a.setWrapperTranslate(a.positions.start, 0, 0) : a.setWrapperTranslate(0, a.positions.start, 0); a.times.start = (new Date).getTime(); x = void 0; 0 < b.moveStartThreshold && (M = !1); if (b.onTouchStart)b.onTouchStart(a); a.callPlugins("onTouchStartEnd") } } function A(c) { if (a.isTouched && !b.onlyExternal && (!u || "mousemove" != c.type)) { var d = u ? c.targetTouches[0].pageX : c.pageX || c.clientX, e = u ? c.targetTouches[0].pageY : c.pageY || c.clientY; "undefined" === typeof x && k && (x = !!(x || Math.abs(e - a.touches.startY) > Math.abs(d - a.touches.startX))); "undefined" !== typeof x || k || (x = !!(x || Math.abs(e - a.touches.startY) < Math.abs(d - a.touches.startX))); if (x)a.isTouched = !1; else if (c.assignedToSwiper)a.isTouched = !1; else if (c.assignedToSwiper = !0, a.isMoved = !0, b.preventLinks && (a.allowLinks = !1), b.onSlideClick && (a.allowSlideClick = !1), b.autoplay && a.stopAutoplay(), !u || 1 == c.touches.length) { a.callPlugins("onTouchMoveStart"); c.preventDefault ? c.preventDefault() : c.returnValue = !1; a.touches.current = k ? d : e; a.positions.current = (a.touches.current - a.touches.start) * b.touchRatio + a.positions.start; if (0 < a.positions.current && b.onResistanceBefore)b.onResistanceBefore(a, a.positions.current); if (a.positions.current < -h() && b.onResistanceAfter)b.onResistanceAfter(a, Math.abs(a.positions.current + h())); b.resistance && "100%" != b.resistance && (0 < a.positions.current && (c = 1 - a.positions.current / l / 2, a.positions.current = 0.5 > c ? l / 2 : a.positions.current * c), a.positions.current < -h() && (d = (a.touches.current - a.touches.start) * b.touchRatio + (h() + a.positions.start), c = (l + d) / l, d = a.positions.current - d * (1 - c) / 2, e = -h() - l / 2, a.positions.current = d < e || 0 >= c ? e : d)); b.resistance && "100%" == b.resistance && (0 < a.positions.current && (!b.freeMode || b.freeModeFluid) && (a.positions.current = 0), a.positions.current < -h() && (!b.freeMode || b.freeModeFluid) && (a.positions.current = -h())); if (b.followFinger) { b.moveStartThreshold ? Math.abs(a.touches.current - a.touches.start) > b.moveStartThreshold || M ? (M = !0, k ? a.setWrapperTranslate(a.positions.current, 0, 0) : a.setWrapperTranslate(0, a.positions.current, 0)) : a.positions.current = a.positions.start : k ? a.setWrapperTranslate(a.positions.current, 0, 0) : a.setWrapperTranslate(0, a.positions.current, 0); (b.freeMode || b.watchActiveIndex) && a.updateActiveSlide(a.positions.current); b.grabCursor && (a.container.style.cursor = "move", a.container.style.cursor = "grabbing", a.container.style.cursor = "-moz-grabbin", a.container.style.cursor = "-webkit-grabbing"); D || (D = a.touches.current); H || (H = (new Date).getTime()); a.velocity = (a.touches.current - D) / ((new Date).getTime() - H) / 2; 2 > Math.abs(a.touches.current - D) && (a.velocity = 0); D = a.touches.current; H = (new Date).getTime(); a.callPlugins("onTouchMoveEnd"); if (b.onTouchMove)b.onTouchMove(a); return !1 } } } } function B(c) { x && a.swipeReset(); if (!b.onlyExternal && a.isTouched) { a.isTouched = !1; b.grabCursor && (a.container.style.cursor = "move", a.container.style.cursor = "grab", a.container.style.cursor = "-moz-grab", a.container.style.cursor = "-webkit-grab"); a.positions.current || 0 === a.positions.current || (a.positions.current = a.positions.start); b.followFinger && (k ? a.setWrapperTranslate(a.positions.current, 0, 0) : a.setWrapperTranslate(0, a.positions.current, 0)); a.times.end = (new Date).getTime(); a.touches.diff = a.touches.current - a.touches.start; a.touches.abs = Math.abs(a.touches.diff); a.positions.diff = a.positions.current - a.positions.start; a.positions.abs = Math.abs(a.positions.diff); var d = a.positions.diff, e = a.positions.abs; c = a.times.end - a.times.start; 5 > e && (300 > c && !1 == a.allowLinks) && (b.freeMode || 0 == e || a.swipeReset(), b.preventLinks && (a.allowLinks = !0), b.onSlideClick && (a.allowSlideClick = !0)); setTimeout(function () { b.preventLinks && (a.allowLinks = !0); b.onSlideClick && (a.allowSlideClick = !0) }, 100); if (a.isMoved) { a.isMoved = !1; var f = h(); if (0 < a.positions.current)a.swipeReset(); else if (a.positions.current < -f)a.swipeReset(); else if (b.freeMode) { if (b.freeModeFluid) { var e = 1E3 * b.momentumRatio, d = a.positions.current + a.velocity * e, g = !1, F, m = 20 * Math.abs(a.velocity) * b.momentumBounceRatio; d < -f && (b.momentumBounce && a.support.transitions ? (d + f < -m && (d = -f - m), F = -f, G = g = !0) : d = -f); 0 < d && (b.momentumBounce && a.support.transitions ? (d > m && (d = m), F = 0, G = g = !0) : d = 0); 0 != a.velocity && (e = Math.abs((d - a.positions.current) / a.velocity)); k ? a.setWrapperTranslate(d, 0, 0) : a.setWrapperTranslate(0, d, 0); a.setWrapperTransition(e); b.momentumBounce && g && a.wrapperTransitionEnd(function () { if (G) { if (b.onMomentumBounce)b.onMomentumBounce(a); k ? a.setWrapperTranslate(F, 0, 0) : a.setWrapperTranslate(0, F, 0); a.setWrapperTransition(300) } }); a.updateActiveSlide(d) } (!b.freeModeFluid || 300 <= c) && a.updateActiveSlide(a.positions.current) } else { E = 0 > d ? "toNext" : "toPrev"; "toNext" == E && 300 >= c && (30 > e || !b.shortSwipes ? a.swipeReset() : a.swipeNext(!0)); "toPrev" == E && 300 >= c && (30 > e || !b.shortSwipes ? a.swipeReset() : a.swipePrev(!0)); f = 0; if ("auto" == b.slidesPerView) { for (var d = Math.abs(k ? a.getWrapperTranslate("x") : a.getWrapperTranslate("y")), q = g = 0; q < a.slides.length; q++)if (m = k ? a.slides[q].getWidth(!0) : a.slides[q].getHeight(!0), g += m, g > d) { f = m; break } f > l && (f = l) } else f = p * b.slidesPerView; "toNext" == E && 300 < c && (e >= 0.5 * f ? a.swipeNext(!0) : a.swipeReset()); "toPrev" == E && 300 < c && (e >= 0.5 * f ? a.swipePrev(!0) : a.swipeReset()) } if (b.onTouchEnd)b.onTouchEnd(a); a.callPlugins("onTouchEnd") } else { a.isMoved = !1; if (b.onTouchEnd)b.onTouchEnd(a); a.callPlugins("onTouchEnd"); a.swipeReset() } } } function I(c, d, e) { function f() { g += m; if (p = "toNext" == l ? g > c : g < c)k ? a.setWrapperTranslate(Math.round(g), 0) : a.setWrapperTranslate(0, Math.round(g)), a._DOMAnimating = !0, window.setTimeout(function () { f() }, 1E3 / 60); else { if (b.onSlideChangeEnd)b.onSlideChangeEnd(a); k ? a.setWrapperTranslate(c, 0) : a.setWrapperTranslate(0, c); a._DOMAnimating = !1 } } if (a.support.transitions || !b.DOMAnimation) { k ? a.setWrapperTranslate(c, 0, 0) : a.setWrapperTranslate(0, c, 0); var h = "to" == d && 0 <= e.speed ? e.speed : b.speed; a.setWrapperTransition(h) } else { var g = k ? a.getWrapperTranslate("x") : a.getWrapperTranslate("y"), h = "to" == d && 0 <= e.speed ? e.speed : b.speed, m = Math.ceil((c - g) / h * (1E3 / 60)), l = g > c ? "toNext" : "toPrev", p = "toNext" == l ? g > c : g < c; if (a._DOMAnimating)return; f() } a.updateActiveSlide(c); if (b.onSlideNext && "next" == d)b.onSlideNext(a, c); if (b.onSlidePrev && "prev" == d)b.onSlidePrev(a, c); if (b.onSlideReset && "reset" == d)b.onSlideReset(a, c); ("next" == d || "prev" == d || "to" == d && !0 == e.runCallbacks) && W() } function W() { a.callPlugins("onSlideChangeStart"); if (b.onSlideChangeStart)if (b.queueStartCallbacks && a.support.transitions) { if (a._queueStartCallbacks)return; a._queueStartCallbacks = !0; b.onSlideChangeStart(a); a.wrapperTransitionEnd(function () { a._queueStartCallbacks = !1 }) } else b.onSlideChangeStart(a); b.onSlideChangeEnd && (a.support.transitions ? b.queueEndCallbacks ? a._queueEndCallbacks || (a._queueEndCallbacks = !0, a.wrapperTransitionEnd(b.onSlideChangeEnd)) : a.wrapperTransitionEnd(b.onSlideChangeEnd) : b.DOMAnimation || setTimeout(function () { b.onSlideChangeEnd(a) }, 10)) } function U() { for (var b = a.paginationButtons, d = 0; d < b.length; d++)a.h.removeEventListener(b[d], "click", V, !1) } function V(b) { var d; b = b.target || b.srcElement; for (var e = a.paginationButtons, f = 0; f < e.length; f++)b === e[f] && (d = f); a.swipeTo(d) } if (document.body.__defineGetter__ && HTMLElement) { var s = HTMLElement.prototype; s.__defineGetter__ && s.__defineGetter__("outerHTML", function () { return (new XMLSerializer).serializeToString(this) }) } window.getComputedStyle || (window.getComputedStyle = function (a, b) { this.el = a; this.getPropertyValue = function (b) { var d = /(\-([a-z]){1})/g; "float" === b && (b = "styleFloat"); d.test(b) && (b = b.replace(d, function (a, b, c) { return c.toUpperCase() })); return a.currentStyle[b] ? a.currentStyle[b] : null }; return this }); Array.prototype.indexOf || (Array.prototype.indexOf = function (a, b) { for (var e = b || 0, f = this.length; e < f; e++)if (this[e] === a)return e; return -1 }); if ((document.querySelectorAll || window.jQuery) && "undefined" !== typeof f && (f.nodeType || 0 !== g(f).length)) { var a = this; a.touches = {start: 0, startX: 0, startY: 0, current: 0, currentX: 0, currentY: 0, diff: 0, abs: 0}; a.positions = {start: 0, abs: 0, diff: 0, current: 0}; a.times = {start: 0, end: 0}; a.id = (new Date).getTime(); a.container = f.nodeType ? f : g(f)[0]; a.isTouched = !1; a.isMoved = !1; a.activeIndex = 0; a.activeLoaderIndex = 0; a.activeLoopIndex = 0; a.previousIndex = null; a.velocity = 0; a.snapGrid = []; a.slidesGrid = []; a.imagesToLoad = []; a.imagesLoaded = 0; a.wrapperLeft = 0; a.wrapperRight = 0; a.wrapperTop = 0; a.wrapperBottom = 0; var J, p, y, E, x, l, s = { mode: "horizontal", touchRatio: 1, speed: 300, freeMode: !1, freeModeFluid: !1, momentumRatio: 1, momentumBounce: !0, momentumBounceRatio: 1, slidesPerView: 1, slidesPerGroup: 1, simulateTouch: !0, followFinger: !0, shortSwipes: !0, moveStartThreshold: !1, autoplay: !1, onlyExternal: !1, createPagination: !0, pagination: !1, paginationElement: "span", paginationClickable: !1, paginationAsRange: !0, resistance: !0, scrollContainer: !1, preventLinks: !0, noSwiping: !1, noSwipingClass: "swiper-no-swiping", initialSlide: 0, keyboardControl: !1, mousewheelControl: !1, mousewheelDebounce: 600, useCSS3Transforms: !0, loop: !1, loopAdditionalSlides: 0, calculateHeight: !1, updateOnImagesReady: !0, releaseFormElements: !0, watchActiveIndex: !1, visibilityFullFit: !1, offsetPxBefore: 0, offsetPxAfter: 0, offsetSlidesBefore: 0, offsetSlidesAfter: 0, centeredSlides: !1, queueStartCallbacks: !1, queueEndCallbacks: !1, autoResize: !0, resizeReInit: !1, DOMAnimation: !0, loader: {slides: [], slidesHTMLType: "inner", surroundGroups: 1, logic: "reload", loadAllSlides: !1}, slideElement: "div", slideClass: "swiper-slide", slideActiveClass: "swiper-slide-active", slideVisibleClass: "swiper-slide-visible", wrapperClass: "swiper-wrapper", paginationElementClass: "swiper-pagination-switch", paginationActiveClass: "swiper-active-switch", paginationVisibleClass: "swiper-visible-switch" }; b = b || {}; for (var q in s)if (q in b && "object" === typeof b[q])for (var C in s[q])C in b[q] || (b[q][C] = s[q][C]); else q in b || (b[q] = s[q]); a.params = b; b.scrollContainer && (b.freeMode = !0, b.freeModeFluid = !0); b.loop && (b.resistance = "100%"); var k = "horizontal" === b.mode; a.touchEvents = { touchStart: a.support.touch || !b.simulateTouch ? "touchstart" : a.browser.ie10 ? "MSPointerDown" : "mousedown", touchMove: a.support.touch || !b.simulateTouch ? "touchmove" : a.browser.ie10 ? "MSPointerMove" : "mousemove", touchEnd: a.support.touch || !b.simulateTouch ? "touchend" : a.browser.ie10 ? "MSPointerUp" : "mouseup" }; for (q = a.container.childNodes.length - 1; 0 <= q; q--)if (a.container.childNodes[q].className)for (C = a.container.childNodes[q].className.split(" "), s = 0; s < C.length; s++)C[s] === b.wrapperClass && (J = a.container.childNodes[q]); a.wrapper = J; a._extendSwiperSlide = function (c) { c.append = function () { b.loop ? (c.insertAfter(a.slides.length - a.loopedSlides), a.removeLoopedSlides(), a.calcSlides(), a.createLoop()) : a.wrapper.appendChild(c); a.reInit(); return c }; c.prepend = function () { b.loop ? (a.wrapper.insertBefore(c, a.slides[a.loopedSlides]), a.removeLoopedSlides(), a.calcSlides(), a.createLoop()) : a.wrapper.insertBefore(c, a.wrapper.firstChild); a.reInit(); return c }; c.insertAfter = function (d) { if ("undefined" === typeof d)return !1; b.loop ? (d = a.slides[d + 1 + a.loopedSlides], a.wrapper.insertBefore(c, d), a.removeLoopedSlides(), a.calcSlides(), a.createLoop()) : (d = a.slides[d + 1], a.wrapper.insertBefore(c, d)); a.reInit(); return c }; c.clone = function () { return a._extendSwiperSlide(c.cloneNode(!0)) }; c.remove = function () { a.wrapper.removeChild(c); a.reInit() }; c.html = function (a) { if ("undefined" === typeof a)return c.innerHTML; c.innerHTML = a; return c }; c.index = function () { for (var b, e = a.slides.length - 1; 0 <= e; e--)c === a.slides[e] && (b = e); return b }; c.isActive = function () { return c.index() === a.activeIndex ? !0 : !1 }; c.swiperSlideDataStorage || (c.swiperSlideDataStorage = {}); c.getData = function (a) { return c.swiperSlideDataStorage[a] }; c.setData = function (a, b) { c.swiperSlideDataStorage[a] = b; return c }; c.data = function (a, b) { return b ? (c.setAttribute("data-" + a, b), c) : c.getAttribute("data-" + a) }; c.getWidth = function (b) { return a.h.getWidth(c, b) }; c.getHeight = function (b) { return a.h.getHeight(c, b) }; c.getOffset = function () { return a.h.getOffset(c) }; return c }; a.calcSlides = function (c) { var d = a.slides ? a.slides.length : !1; a.slides = []; a.displaySlides = []; for (var e = 0; e < a.wrapper.childNodes.length; e++)if (a.wrapper.childNodes[e].className)for (var f = a.wrapper.childNodes[e].className.split(" "), g = 0; g < f.length; g++)f[g] === b.slideClass && a.slides.push(a.wrapper.childNodes[e]); for (e = a.slides.length - 1; 0 <= e; e--)a._extendSwiperSlide(a.slides[e]); d && (d !== a.slides.length || c) && (v(), t(), a.updateActiveSlide(), b.createPagination && a.params.pagination && a.createPagination(), a.callPlugins("numberOfSlidesChanged")) }; a.createSlide = function (c, d, e) { d = d || a.params.slideClass; e = e || b.slideElement; e = document.createElement(e); e.innerHTML = c || ""; e.className = d; return a._extendSwiperSlide(e) }; a.appendSlide = function (b, d, e) { if (b)return b.nodeType ? a._extendSwiperSlide(b).append() : a.createSlide(b, d, e).append() }; a.prependSlide = function (b, d, e) { if (b)return b.nodeType ? a._extendSwiperSlide(b).prepend() : a.createSlide(b, d, e).prepend() }; a.insertSlideAfter = function (b, d, e, f) { return "undefined" === typeof b ? !1 : d.nodeType ? a._extendSwiperSlide(d).insertAfter(b) : a.createSlide(d, e, f).insertAfter(b) }; a.removeSlide = function (c) { if (a.slides[c]) { if (b.loop) { if (!a.slides[c + a.loopedSlides])return !1; a.slides[c + a.loopedSlides].remove(); a.removeLoopedSlides(); a.calcSlides(); a.createLoop() } else a.slides[c].remove(); return !0 } return !1 }; a.removeLastSlide = function () { return 0 < a.slides.length ? (b.loop ? (a.slides[a.slides.length - 1 - a.loopedSlides].remove(), a.removeLoopedSlides(), a.calcSlides(), a.createLoop()) : a.slides[a.slides.length - 1].remove(), !0) : !1 }; a.removeAllSlides = function () { for (var b = a.slides.length - 1; 0 <= b; b--)a.slides[b].remove() }; a.getSlide = function (b) { return a.slides[b] }; a.getLastSlide = function () { return a.slides[a.slides.length - 1] }; a.getFirstSlide = function () { return a.slides[0] }; a.activeSlide = function () { return a.slides[a.activeIndex] }; var K = [], L; for (L in a.plugins)b[L] && (q = a.plugins[L](a, b[L])) && K.push(q); a.callPlugins = function (a, b) { b || (b = {}); for (var e = 0; e < K.length; e++)if (a in K[e])K[e][a](b) }; a.browser.ie10 && !b.onlyExternal && (k ? a.wrapper.classList.add("swiper-wp8-horizontal") : a.wrapper.classList.add("swiper-wp8-vertical")); b.freeMode && (a.container.className += " swiper-free-mode"); a.initialized = !1; a.init = function (c, d) { var e = a.h.getWidth(a.container), f = a.h.getHeight(a.container); if (e !== a.width || f !== a.height || c) { a.width = e; a.height = f; l = k ? e : f; e = a.wrapper; c && a.calcSlides(d); if ("auto" === b.slidesPerView) { var g = 0, h = 0; 0 < b.slidesOffset && (e.style.paddingLeft = "", e.style.paddingRight = "", e.style.paddingTop = "", e.style.paddingBottom = ""); e.style.width = ""; e.style.height = ""; 0 < b.offsetPxBefore && (k ? a.wrapperLeft = b.offsetPxBefore : a.wrapperTop = b.offsetPxBefore); 0 < b.offsetPxAfter && (k ? a.wrapperRight = b.offsetPxAfter : a.wrapperBottom = b.offsetPxAfter); b.centeredSlides && (k ? (a.wrapperLeft = (l - this.slides[0].getWidth(!0)) / 2, a.wrapperRight = (l - a.slides[a.slides.length - 1].getWidth(!0)) / 2) : (a.wrapperTop = (l - a.slides[0].getHeight(!0)) / 2, a.wrapperBottom = (l - a.slides[a.slides.length - 1].getHeight(!0)) / 2)); k ? (0 <= a.wrapperLeft && (e.style.paddingLeft = a.wrapperLeft + "px"), 0 <= a.wrapperRight && (e.style.paddingRight = a.wrapperRight + "px")) : (0 <= a.wrapperTop && (e.style.paddingTop = a.wrapperTop + "px"), 0 <= a.wrapperBottom && (e.style.paddingBottom = a.wrapperBottom + "px")); var m = 0, q = 0; a.snapGrid = []; a.slidesGrid = []; for (var n = 0, r = 0; r < a.slides.length; r++) { var f = a.slides[r].getWidth(!0), s = a.slides[r].getHeight(!0); b.calculateHeight && (n = Math.max(n, s)); var t = k ? f : s; if (b.centeredSlides) { var u = r === a.slides.length - 1 ? 0 : a.slides[r + 1].getWidth(!0), w = r === a.slides.length - 1 ? 0 : a.slides[r + 1].getHeight(!0), u = k ? u : w; if (t > l) { for (w = 0; w <= Math.floor(t / (l + a.wrapperLeft)); w++)0 === w ? a.snapGrid.push(m + a.wrapperLeft) : a.snapGrid.push(m + a.wrapperLeft + l * w); a.slidesGrid.push(m + a.wrapperLeft) } else a.snapGrid.push(q), a.slidesGrid.push(q); q += t / 2 + u / 2 } else { if (t > l)for (w = 0; w <= Math.floor(t / l); w++)a.snapGrid.push(m + l * w); else a.snapGrid.push(m); a.slidesGrid.push(m) } m += t; g += f; h += s } b.calculateHeight && (a.height = n); k ? (y = g + a.wrapperRight + a.wrapperLeft, e.style.width = g + "px", e.style.height = a.height + "px") : (y = h + a.wrapperTop + a.wrapperBottom, e.style.width = a.width + "px", e.style.height = h + "px") } else if (b.scrollContainer)e.style.width = "", e.style.height = "", n = a.slides[0].getWidth(!0), g = a.slides[0].getHeight(!0), y = k ? n : g, e.style.width = n + "px", e.style.height = g + "px", p = k ? n : g; else { if (b.calculateHeight) { g = n = 0; k || (a.container.style.height = ""); e.style.height = ""; for (r = 0; r < a.slides.length; r++)a.slides[r].style.height = "", n = Math.max(a.slides[r].getHeight(!0), n), k || (g += a.slides[r].getHeight(!0)); s = n; a.height = s; k ? g = s : (l = s, a.container.style.height = l + "px") } else s = k ? a.height : a.height / b.slidesPerView, g = k ? a.height : a.slides.length * s; f = k ? a.width / b.slidesPerView : a.width; n = k ? a.slides.length * f : a.width; p = k ? f : s; 0 < b.offsetSlidesBefore && (k ? a.wrapperLeft = p * b.offsetSlidesBefore : a.wrapperTop = p * b.offsetSlidesBefore); 0 < b.offsetSlidesAfter && (k ? a.wrapperRight = p * b.offsetSlidesAfter : a.wrapperBottom = p * b.offsetSlidesAfter); 0 < b.offsetPxBefore && (k ? a.wrapperLeft = b.offsetPxBefore : a.wrapperTop = b.offsetPxBefore); 0 < b.offsetPxAfter && (k ? a.wrapperRight = b.offsetPxAfter : a.wrapperBottom = b.offsetPxAfter); b.centeredSlides && (k ? (a.wrapperLeft = (l - p) / 2, a.wrapperRight = (l - p) / 2) : (a.wrapperTop = (l - p) / 2, a.wrapperBottom = (l - p) / 2)); k ? (0 < a.wrapperLeft && (e.style.paddingLeft = a.wrapperLeft + "px"), 0 < a.wrapperRight && (e.style.paddingRight = a.wrapperRight + "px")) : (0 < a.wrapperTop && (e.style.paddingTop = a.wrapperTop + "px"), 0 < a.wrapperBottom && (e.style.paddingBottom = a.wrapperBottom + "px")); y = k ? n + a.wrapperRight + a.wrapperLeft : g + a.wrapperTop + a.wrapperBottom; e.style.width = n + "px"; e.style.height = g + "px"; m = 0; a.snapGrid = []; a.slidesGrid = []; for (r = 0; r < a.slides.length; r++)a.snapGrid.push(m), a.slidesGrid.push(m), m += p, a.slides[r].style.width = f + "px", a.slides[r].style.height = s + "px" } if (a.initialized) { if (a.callPlugins("onInit"), b.onFirstInit)b.onInit(a) } else if (a.callPlugins("onFirstInit"), b.onFirstInit)b.onFirstInit(a); a.initialized = !0 } }; a.reInit = function (b) { a.init(!0, b) }; a.resizeFix = function (c) { a.callPlugins("beforeResizeFix"); a.init(b.resizeReInit || c); if (!b.freeMode)b.loop ? a.swipeTo(a.activeLoopIndex, 0, !1) : a.swipeTo(a.activeIndex, 0, !1); else if ((k ? a.getWrapperTranslate("x") : a.getWrapperTranslate("y")) < -h()) { c = k ? -h() : 0; var d = k ? 0 : -h(); a.setWrapperTransition(0); a.setWrapperTranslate(c, d, 0) } a.callPlugins("afterResizeFix") }; a.destroy = function (c) { a.browser.ie10 ? (a.h.removeEventListener(a.wrapper, a.touchEvents.touchStart, z, !1), a.h.removeEventListener(document, a.touchEvents.touchMove, A, !1), a.h.removeEventListener(document, a.touchEvents.touchEnd, B, !1)) : (a.support.touch && (a.h.removeEventListener(a.wrapper, "touchstart", z, !1), a.h.removeEventListener(a.wrapper, "touchmove", A, !1), a.h.removeEventListener(a.wrapper, "touchend", B, !1)), b.simulateTouch && (a.h.removeEventListener(a.wrapper, "mousedown", z, !1), a.h.removeEventListener(document, "mousemove", A, !1), a.h.removeEventListener(document, "mouseup", B, !1))); b.autoResize && a.h.removeEventListener(window, "resize", a.resizeFix, !1); v(); b.paginationClickable && U(); b.mousewheelControl && a._wheelEvent && a.h.removeEventListener(a.container, a._wheelEvent, N, !1); b.keyboardControl && a.h.removeEventListener(document, "keydown", O, !1); b.autoplay && a.stopAutoplay(); a.callPlugins("onDestroy"); a = null }; b.grabCursor && (a.container.style.cursor = "move", a.container.style.cursor = "grab", a.container.style.cursor = "-moz-grab", a.container.style.cursor = "-webkit-grab"); a.allowSlideClick = !0; a.allowLinks = !0; var u = !1, M, G = !0, D, H; a.swipeNext = function (c) { !c && b.loop && a.fixLoop(); a.callPlugins("onSwipeNext"); var d = c = k ? a.getWrapperTranslate("x") : a.getWrapperTranslate("y"); if ("auto" == b.slidesPerView)for (var e = 0; e < a.snapGrid.length; e++) { if (-c >= a.snapGrid[e] && -c < a.snapGrid[e + 1]) { d = -a.snapGrid[e + 1]; break } } else d = p * b.slidesPerGroup, d = -(Math.floor(Math.abs(c) / Math.floor(d)) * d + d); d < -h() && (d = -h()); if (d == c)return !1; I(d, "next"); return !0 }; a.swipePrev = function (c) { !c && b.loop && a.fixLoop(); !c && b.autoplay && a.stopAutoplay(); a.callPlugins("onSwipePrev"); c = Math.ceil(k ? a.getWrapperTranslate("x") : a.getWrapperTranslate("y")); var d; if ("auto" == b.slidesPerView) { d = 0; for (var e = 1; e < a.snapGrid.length; e++) { if (-c == a.snapGrid[e]) { d = -a.snapGrid[e - 1]; break } if (-c > a.snapGrid[e] && -c < a.snapGrid[e + 1]) { d = -a.snapGrid[e]; break } } } else d = p * b.slidesPerGroup, d *= -(Math.ceil(-c / d) - 1); 0 < d && (d = 0); if (d == c)return !1; I(d, "prev"); return !0 }; a.swipeReset = function () { a.callPlugins("onSwipeReset"); var c = k ? a.getWrapperTranslate("x") : a.getWrapperTranslate("y"), d = p * b.slidesPerGroup; h(); if ("auto" == b.slidesPerView) { for (var e = d = 0; e < a.snapGrid.length; e++) { if (-c === a.snapGrid[e])return; if (-c >= a.snapGrid[e] && -c < a.snapGrid[e + 1]) { d = 0 < a.positions.diff ? -a.snapGrid[e + 1] : -a.snapGrid[e]; break } } -c >= a.snapGrid[a.snapGrid.length - 1] && (d = -a.snapGrid[a.snapGrid.length - 1]); c <= -h() && (d = -h()) } else d = 0 > c ? Math.round(c / d) * d : 0; b.scrollContainer && (d = 0 > c ? c : 0); d < -h() && (d = -h()); b.scrollContainer && l > p && (d = 0); if (d == c)return !1; I(d, "reset"); return !0 }; a.swipeTo = function (c, d, e) { c = parseInt(c, 10); a.callPlugins("onSwipeTo", {index: c, speed: d}); b.loop && (c += a.loopedSlides); var f = k ? a.getWrapperTranslate("x") : a.getWrapperTranslate("y"); if (!(c > a.slides.length - 1 || 0 > c)) { var g; g = "auto" == b.slidesPerView ? -a.slidesGrid[c] : -c * p; g < -h() && (g = -h()); if (g == f)return !1; I(g, "to", {index: c, speed: d, runCallbacks: !1 === e ? !1 : !0}); return !0 } }; a._queueStartCallbacks = !1; a._queueEndCallbacks = !1; a.updateActiveSlide = function (c) { if (a.initialized && 0 != a.slides.length) { a.previousIndex = a.activeIndex; 0 < c && (c = 0); "undefined" == typeof c && (c = k ? a.getWrapperTranslate("x") : a.getWrapperTranslate("y")); if ("auto" == b.slidesPerView) { if (a.activeIndex = a.slidesGrid.indexOf(-c), 0 > a.activeIndex) { for (var d = 0; d < a.slidesGrid.length - 1 && !(-c > a.slidesGrid[d] && -c < a.slidesGrid[d + 1]); d++); var e = Math.abs(a.slidesGrid[d] + c), f = Math.abs(a.slidesGrid[d + 1] + c); a.activeIndex = e <= f ? d : d + 1 } } else a.activeIndex = b.visibilityFullFit ? Math.ceil(-c / p) : Math.round(-c / p); a.activeIndex == a.slides.length && (a.activeIndex = a.slides.length - 1); 0 > a.activeIndex && (a.activeIndex = 0); if (a.slides[a.activeIndex]) { a.calcVisibleSlides(c); e = RegExp("\\s*" + b.slideActiveClass); f = RegExp("\\s*" + b.slideVisibleClass); for (d = 0; d < a.slides.length; d++)a.slides[d].className = a.slides[d].className.replace(e, "").replace(f, ""), 0 <= a.visibleSlides.indexOf(a.slides[d]) && (a.slides[d].className += " " + b.slideVisibleClass); a.slides[a.activeIndex].className += " " + b.slideActiveClass; b.loop ? (d = a.loopedSlides, a.activeLoopIndex = a.activeIndex - d, a.activeLoopIndex >= a.slides.length - 2 * d && (a.activeLoopIndex = a.slides.length - 2 * d - a.activeLoopIndex), 0 > a.activeLoopIndex && (a.activeLoopIndex = a.slides.length - 2 * d + a.activeLoopIndex)) : a.activeLoopIndex = a.activeIndex; b.pagination && a.updatePagination(c) } } }; a.createPagination = function (c) { b.paginationClickable && a.paginationButtons && U(); var d = "", e = a.slides.length; b.loop && (e -= 2 * a.loopedSlides); for (var f = 0; f < e; f++)d += "<" + b.paginationElement + ' class="' + b.paginationElementClass + '">"; a.paginationContainer = b.pagination.nodeType ? b.pagination : g(b.pagination)[0]; a.paginationContainer.innerHTML = d; a.paginationButtons = []; document.querySelectorAll ? a.paginationButtons = a.paginationContainer.querySelectorAll("." + b.paginationElementClass) : window.jQuery && (a.paginationButtons = g(a.paginationContainer).find("." + b.paginationElementClass)); c || a.updatePagination(); a.callPlugins("onCreatePagination"); if (b.paginationClickable)for (c = a.paginationButtons, d = 0; d < c.length; d++)a.h.addEventListener(c[d], "click", V, !1) }; a.updatePagination = function (c) { if (b.pagination && !(1 > a.slides.length)) { if (document.querySelectorAll)var d = a.paginationContainer.querySelectorAll("." + b.paginationActiveClass); else window.jQuery && (d = g(a.paginationContainer).find("." + b.paginationActiveClass)); if (d && (d = a.paginationButtons, 0 != d.length)) { for (var e = 0; e < d.length; e++)d[e].className = b.paginationElementClass; var f = b.loop ? a.loopedSlides : 0; if (b.paginationAsRange) { a.visibleSlides || a.calcVisibleSlides(c); c = []; for (e = 0; e < a.visibleSlides.length; e++) { var h = a.slides.indexOf(a.visibleSlides[e]) - f; b.loop && 0 > h && (h = a.slides.length - 2 * a.loopedSlides + h); b.loop && h >= a.slides.length - 2 * a.loopedSlides && (h = a.slides.length - 2 * a.loopedSlides - h, h = Math.abs(h)); c.push(h) } for (e = 0; e < c.length; e++)d[c[e]] && (d[c[e]].className += " " + b.paginationVisibleClass); b.loop ? d[a.activeLoopIndex].className += " " + b.paginationActiveClass : d[a.activeIndex].className += " " + b.paginationActiveClass } else b.loop ? d[a.activeLoopIndex].className += " " + b.paginationActiveClass + " " + b.paginationVisibleClass : d[a.activeIndex].className += " " + b.paginationActiveClass + " " + b.paginationVisibleClass } } }; a.calcVisibleSlides = function (c) { var d = [], e = 0, f = 0, g = 0; k && 0 < a.wrapperLeft && (c += a.wrapperLeft); !k && 0 < a.wrapperTop && (c += a.wrapperTop); for (var h = 0; h < a.slides.length; h++) { var e = e + f, f = "auto" == b.slidesPerView ? k ? a.h.getWidth(a.slides[h], !0) : a.h.getHeight(a.slides[h], !0) : p, g = e + f, m = !1; b.visibilityFullFit ? (e >= -c && g <= -c + l && (m = !0), e <= -c && g >= -c + l && (m = !0)) : (g > -c && g <= -c + l && (m = !0), e >= -c && e < -c + l && (m = !0), e < -c && g > -c + l && (m = !0)); m && d.push(a.slides[h]) } 0 == d.length && (d = [a.slides[a.activeIndex]]); a.visibleSlides = d }; a.autoPlayIntervalId = void 0; a.startAutoplay = function () { if ("undefined" !== typeof a.autoPlayIntervalId)return !1; b.autoplay && !b.loop && (a.autoPlayIntervalId = setInterval(function () { a.swipeNext(!0) || a.swipeTo(0) }, b.autoplay)); b.autoplay && b.loop && (a.autoPlayIntervalId = setInterval(function () { a.swipeNext() }, b.autoplay)); a.callPlugins("onAutoplayStart") }; a.stopAutoplay = function () { a.autoPlayIntervalId && clearInterval(a.autoPlayIntervalId); a.autoPlayIntervalId = void 0; a.callPlugins("onAutoplayStop") }; a.loopCreated = !1; a.removeLoopedSlides = function () { if (a.loopCreated)for (var b = 0; b < a.slides.length; b++)!0 === a.slides[b].getData("looped") && a.wrapper.removeChild(a.slides[b]) }; a.createLoop = function () { if (0 != a.slides.length) { a.loopedSlides = b.slidesPerView + b.loopAdditionalSlides; for (var c = "", d = "", e = 0; e < a.loopedSlides; e++)c += a.slides[e].outerHTML; for (e = a.slides.length - a.loopedSlides; e < a.slides.length; e++)d += a.slides[e].outerHTML; J.innerHTML = d + J.innerHTML + c; a.loopCreated = !0; a.calcSlides(); for (e = 0; e < a.slides.length; e++)(e < a.loopedSlides || e >= a.slides.length - a.loopedSlides) && a.slides[e].setData("looped", !0); a.callPlugins("onCreateLoop") } }; a.fixLoop = function () { if (a.activeIndex < a.loopedSlides) { var c = a.slides.length - 3 * a.loopedSlides + a.activeIndex; a.swipeTo(c, 0, !1) } else a.activeIndex > a.slides.length - 2 * b.slidesPerView && (c = -a.slides.length + a.activeIndex + a.loopedSlides, a.swipeTo(c, 0, !1)) }; a.loadSlides = function () { var c = ""; a.activeLoaderIndex = 0; for (var d = b.loader.slides, e = b.loader.loadAllSlides ? d.length : b.slidesPerView * (1 + b.loader.surroundGroups), f = 0; f < e; f++)c = "outer" == b.loader.slidesHTMLType ? c + d[f] : c + ("<" + b.slideElement + ' class="' + b.slideClass + '" data-swiperindex="' + f + '">' + d[f] + ""); a.wrapper.innerHTML = c; a.calcSlides(!0); b.loader.loadAllSlides || a.wrapperTransitionEnd(a.reloadSlides, !0) }; a.reloadSlides = function () { var c = b.loader.slides, d = parseInt(a.activeSlide().data("swiperindex"), 10); if (!(0 > d || d > c.length - 1)) { a.activeLoaderIndex = d; var e = Math.max(0, d - b.slidesPerView * b.loader.surroundGroups), f = Math.min(d + b.slidesPerView * (1 + b.loader.surroundGroups) - 1, c.length - 1); 0 < d && (d = -p * (d - e), k ? a.setWrapperTranslate(d, 0, 0) : a.setWrapperTranslate(0, d, 0), a.setWrapperTransition(0)); if ("reload" === b.loader.logic) { for (var g = a.wrapper.innerHTML = "", d = e; d <= f; d++)g += "outer" == b.loader.slidesHTMLType ? c[d] : "<" + b.slideElement + ' class="' + b.slideClass + '" data-swiperindex="' + d + '">' + c[d] + ""; a.wrapper.innerHTML = g } else { for (var g = 1E3, h = 0, d = 0; d < a.slides.length; d++) { var l = a.slides[d].data("swiperindex"); l < e || l > f ? a.wrapper.removeChild(a.slides[d]) : (g = Math.min(l, g), h = Math.max(l, h)) } for (d = e; d <= f; d++)d < g && (e = document.createElement(b.slideElement), e.className = b.slideClass, e.setAttribute("data-swiperindex", d), e.innerHTML = c[d], a.wrapper.insertBefore(e, a.wrapper.firstChild)), d > h && (e = document.createElement(b.slideElement), e.className = b.slideClass, e.setAttribute("data-swiperindex", d), e.innerHTML = c[d], a.wrapper.appendChild(e)) } a.reInit(!0) } }; a.calcSlides(); 0 < b.loader.slides.length && 0 == a.slides.length && a.loadSlides(); b.loop && a.createLoop(); a.init(); n(); b.pagination && b.createPagination && a.createPagination(!0); b.loop || 0 < b.initialSlide ? a.swipeTo(b.initialSlide, 0, !1) : a.updateActiveSlide(0); b.autoplay && a.startAutoplay() } }; Swiper.prototype = { plugins: {}, wrapperTransitionEnd: function (f, b) { function g() { f(h); h.params.queueEndCallbacks && (h._queueEndCallbacks = !1); if (!b)for (var v = 0; v < t.length; v++)h.h.removeEventListener(n, t[v], g, !1) } var h = this, n = h.wrapper, t = ["webkitTransitionEnd", "transitionend", "oTransitionEnd", "MSTransitionEnd", "msTransitionEnd"]; if (f)for (var v = 0; v < t.length; v++)h.h.addEventListener(n, t[v], g, !1) }, getWrapperTranslate: function (f) { var b = this.wrapper, g, h, n = window.WebKitCSSMatrix ? new WebKitCSSMatrix(window.getComputedStyle(b, null).webkitTransform) : window.getComputedStyle(b, null).MozTransform || window.getComputedStyle(b, null).OTransform || window.getComputedStyle(b, null).MsTransform || window.getComputedStyle(b, null).msTransform || window.getComputedStyle(b, null).transform || window.getComputedStyle(b, null).getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,"); g = n.toString().split(","); this.params.useCSS3Transforms ? ("x" == f && (h = 16 == g.length ? parseFloat(g[12]) : window.WebKitCSSMatrix ? n.m41 : parseFloat(g[4])), "y" == f && (h = 16 == g.length ? parseFloat(g[13]) : window.WebKitCSSMatrix ? n.m42 : parseFloat(g[5]))) : ("x" == f && (h = parseFloat(b.style.left, 10) || 0), "y" == f && (h = parseFloat(b.style.top, 10) || 0)); return h || 0 }, setWrapperTranslate: function (f, b, g) { var h = this.wrapper.style; f = f || 0; b = b || 0; g = g || 0; this.params.useCSS3Transforms ? this.support.transforms3d ? h.webkitTransform = h.MsTransform = h.msTransform = h.MozTransform = h.OTransform = h.transform = "translate3d(" + f + "px, " + b + "px, " + g + "px)" : (h.webkitTransform = h.MsTransform = h.msTransform = h.MozTransform = h.OTransform = h.transform = "translate(" + f + "px, " + b + "px)", this.support.transforms || (h.left = f + "px", h.top = b + "px")) : (h.left = f + "px", h.top = b + "px"); this.callPlugins("onSetWrapperTransform", {x: f, y: b, z: g}) }, setWrapperTransition: function (f) { var b = this.wrapper.style; b.webkitTransitionDuration = b.MsTransitionDuration = b.msTransitionDuration = b.MozTransitionDuration = b.OTransitionDuration = b.transitionDuration = f / 1E3 + "s"; this.callPlugins("onSetWrapperTransition", {duration: f}) }, h: { getWidth: function (f, b) { var g = window.getComputedStyle(f, null).getPropertyValue("width"), h = parseFloat(g); if (isNaN(h) || 0 < g.indexOf("%"))h = f.offsetWidth - parseFloat(window.getComputedStyle(f, null).getPropertyValue("padding-left")) - parseFloat(window.getComputedStyle(f, null).getPropertyValue("padding-right")); b && (h += parseFloat(window.getComputedStyle(f, null).getPropertyValue("padding-left")) + parseFloat(window.getComputedStyle(f, null).getPropertyValue("padding-right"))); return h }, getHeight: function (f, b) { if (b)return f.offsetHeight; var g = window.getComputedStyle(f, null).getPropertyValue("height"), h = parseFloat(g); if (isNaN(h) || 0 < g.indexOf("%"))h = f.offsetHeight - parseFloat(window.getComputedStyle(f, null).getPropertyValue("padding-top")) - parseFloat(window.getComputedStyle(f, null).getPropertyValue("padding-bottom")); b && (h += parseFloat(window.getComputedStyle(f, null).getPropertyValue("padding-top")) + parseFloat(window.getComputedStyle(f, null).getPropertyValue("padding-bottom"))); return h }, getOffset: function (f) { var b = f.getBoundingClientRect(), g = document.body, h = f.clientTop || g.clientTop || 0, g = f.clientLeft || g.clientLeft || 0, n = window.pageYOffset || f.scrollTop; f = window.pageXOffset || f.scrollLeft; document.documentElement && !window.pageYOffset && (n = document.documentElement.scrollTop, f = document.documentElement.scrollLeft); return {top: b.top + n - h, left: b.left + f - g} }, windowWidth: function () { if (window.innerWidth)return window.innerWidth; if (document.documentElement && document.documentElement.clientWidth)return document.documentElement.clientWidth }, windowHeight: function () { if (window.innerHeight)return window.innerHeight; if (document.documentElement && document.documentElement.clientHeight)return document.documentElement.clientHeight }, windowScroll: function () { if ("undefined" != typeof pageYOffset)return {left: window.pageXOffset, top: window.pageYOffset}; if (document.documentElement)return { left: document.documentElement.scrollLeft, top: document.documentElement.scrollTop } }, addEventListener: function (f, b, g, h) { f.addEventListener ? f.addEventListener(b, g, h) : f.attachEvent && f.attachEvent("on" + b, g) }, removeEventListener: function (f, b, g, h) { f.removeEventListener ? f.removeEventListener(b, g, h) : f.detachEvent && f.detachEvent("on" + b, g) } }, setTransform: function (f, b) { var g = f.style; g.webkitTransform = g.MsTransform = g.msTransform = g.MozTransform = g.OTransform = g.transform = b }, setTranslate: function (f, b) { var g = f.style, h = b.x || 0, n = b.y || 0, t = b.z || 0; g.webkitTransform = g.MsTransform = g.msTransform = g.MozTransform = g.OTransform = g.transform = this.support.transforms3d ? "translate3d(" + h + "px," + n + "px," + t + "px)" : "translate(" + h + "px," + n + "px)"; this.support.transforms || (g.left = h + "px", g.top = n + "px") }, setTransition: function (f, b) { var g = f.style; g.webkitTransitionDuration = g.MsTransitionDuration = g.msTransitionDuration = g.MozTransitionDuration = g.OTransitionDuration = g.transitionDuration = b + "ms" }, support: { touch: window.Modernizr && !0 === Modernizr.touch || function () { return !!("ontouchstart"in window || window.DocumentTouch && document instanceof DocumentTouch) }(), transforms3d: window.Modernizr && !0 === Modernizr.csstransforms3d || function () { var f = document.createElement("div"); return "webkitPerspective"in f.style || "MozPerspective"in f.style || "OPerspective"in f.style || "MsPerspective"in f.style || "perspective"in f.style }(), transforms: window.Modernizr && !0 === Modernizr.csstransforms || function () { var f = document.createElement("div").style; return "transform"in f || "WebkitTransform"in f || "MozTransform"in f || "msTransform"in f || "MsTransform"in f || "OTransform"in f }(), transitions: window.Modernizr && !0 === Modernizr.csstransitions || function () { var f = document.createElement("div").style; return "transition"in f || "WebkitTransition"in f || "MozTransition"in f || "msTransition"in f || "MsTransition"in f || "OTransition"in f }() }, browser: { ie8: function () { var f = -1; "Microsoft Internet Explorer" == navigator.appName && null != /MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent) && (f = parseFloat(RegExp.$1)); return -1 != f && 9 > f }(), ie10: window.navigator.msPointerEnabled } }; (window.jQuery || window.Zepto) && function (f) { f.fn.swiper = function (b) { b = new Swiper(f(this)[0], b); f(this).data("swiper", b); return b } }(window.jQuery || window.Zepto); "undefined" !== typeof module && (module.exports = Swiper); /*! * jQuery Cycle2; version: 2.1.2 build: 20140216 * http://jquery.malsup.com/cycle2/ * Copyright (c) 2014 M. Alsup; Dual licensed: MIT/GPL */ (function (e) { "use strict"; function t(e) { return (e || "").toLowerCase() } var i = "2.1.2"; e.fn.cycle = function (i) { var n; return 0 !== this.length || e.isReady ? this.each(function () { var n, s, o, c, l = e(this), r = e.fn.cycle.log; if (!l.data("cycle.opts")) { (l.data("cycle-log") === !1 || i && i.log === !1 || s && s.log === !1) && (r = e.noop), r("--c2 init--"), n = l.data(); for (var a in n)n.hasOwnProperty(a) && /^cycle[A-Z]+/.test(a) && (c = n[a], o = a.match(/^cycle(.*)/)[1].replace(/^[A-Z]/, t), r(o + ":", c, "(" + typeof c + ")"), n[o] = c); s = e.extend({}, e.fn.cycle.defaults, n, i || {}), s.timeoutId = 0, s.paused = s.paused || !1, s.container = l, s._maxZ = s.maxZ, s.API = e.extend({_container: l}, e.fn.cycle.API), s.API.log = r, s.API.trigger = function (e, t) { return s.container.trigger(e, t), s.API }, l.data("cycle.opts", s), l.data("cycle.API", s.API), s.API.trigger("cycle-bootstrap", [s, s.API]), s.API.addInitialSlides(), s.API.preInitSlideshow(), s.slides.length && s.API.initSlideshow() } }) : (n = { s: this.selector, c: this.context }, e.fn.cycle.log("requeuing slideshow (dom not ready)"), e(function () { e(n.s, n.c).cycle(i) }), this) }, e.fn.cycle.API = { opts: function () { return this._container.data("cycle.opts") }, addInitialSlides: function () { var t = this.opts(), i = t.slides; t.slideCount = 0, t.slides = e(), i = i.jquery ? i : t.container.find(i), t.random && i.sort(function () { return Math.random() - .5 }), t.API.add(i) }, preInitSlideshow: function () { var t = this.opts(); t.API.trigger("cycle-pre-initialize", [t]); var i = e.fn.cycle.transitions[t.fx]; i && e.isFunction(i.preInit) && i.preInit(t), t._preInitialized = !0 }, postInitSlideshow: function () { var t = this.opts(); t.API.trigger("cycle-post-initialize", [t]); var i = e.fn.cycle.transitions[t.fx]; i && e.isFunction(i.postInit) && i.postInit(t) }, initSlideshow: function () { var t, i = this.opts(), n = i.container; i.API.calcFirstSlide(), "static" == i.container.css("position") && i.container.css("position", "relative"), e(i.slides[i.currSlide]).css({ opacity: 1, display: "block", visibility: "visible" }), i.API.stackSlides(i.slides[i.currSlide], i.slides[i.nextSlide], !i.reverse), i.pauseOnHover && (i.pauseOnHover !== !0 && (n = e(i.pauseOnHover)), n.hover(function () { i.API.pause(!0) }, function () { i.API.resume(!0) })), i.timeout && (t = i.API.getSlideOpts(i.currSlide), i.API.queueTransition(t, t.timeout + i.delay)), i._initialized = !0, i.API.updateView(!0), i.API.trigger("cycle-initialized", [i]), i.API.postInitSlideshow() }, pause: function (t) { var i = this.opts(), n = i.API.getSlideOpts(), s = i.hoverPaused || i.paused; t ? i.hoverPaused = !0 : i.paused = !0, s || (i.container.addClass("cycle-paused"), i.API.trigger("cycle-paused", [i]).log("cycle-paused"), n.timeout && (clearTimeout(i.timeoutId), i.timeoutId = 0, i._remainingTimeout -= e.now() - i._lastQueue, (0 > i._remainingTimeout || isNaN(i._remainingTimeout)) && (i._remainingTimeout = void 0))) }, resume: function (e) { var t = this.opts(), i = !t.hoverPaused && !t.paused; e ? t.hoverPaused = !1 : t.paused = !1, i || (t.container.removeClass("cycle-paused"), 0 === t.slides.filter(":animated").length && t.API.queueTransition(t.API.getSlideOpts(), t._remainingTimeout), t.API.trigger("cycle-resumed", [t, t._remainingTimeout]).log("cycle-resumed")) }, add: function (t, i) { var n, s = this.opts(), o = s.slideCount, c = !1; "string" == e.type(t) && (t = e.trim(t)), e(t).each(function () { var t, n = e(this); i ? s.container.prepend(n) : s.container.append(n), s.slideCount++, t = s.API.buildSlideOpts(n), s.slides = i ? e(n).add(s.slides) : s.slides.add(n), s.API.initSlide(t, n, --s._maxZ), n.data("cycle.opts", t), s.API.trigger("cycle-slide-added", [s, t, n]) }), s.API.updateView(!0), c = s._preInitialized && 2 > o && s.slideCount >= 1, c && (s._initialized ? s.timeout && (n = s.slides.length, s.nextSlide = s.reverse ? n - 1 : 1, s.timeoutId || s.API.queueTransition(s)) : s.API.initSlideshow()) }, calcFirstSlide: function () { var e, t = this.opts(); e = parseInt(t.startingSlide || 0, 10), (e >= t.slides.length || 0 > e) && (e = 0), t.currSlide = e, t.reverse ? (t.nextSlide = e - 1, 0 > t.nextSlide && (t.nextSlide = t.slides.length - 1)) : (t.nextSlide = e + 1, t.nextSlide == t.slides.length && (t.nextSlide = 0)) }, calcNextSlide: function () { var e, t = this.opts(); t.reverse ? (e = 0 > t.nextSlide - 1, t.nextSlide = e ? t.slideCount - 1 : t.nextSlide - 1, t.currSlide = e ? 0 : t.nextSlide + 1) : (e = t.nextSlide + 1 == t.slides.length, t.nextSlide = e ? 0 : t.nextSlide + 1, t.currSlide = e ? t.slides.length - 1 : t.nextSlide - 1) }, calcTx: function (t, i) { var n, s = t; return i && s.manualFx && (n = e.fn.cycle.transitions[s.manualFx]), n || (n = e.fn.cycle.transitions[s.fx]), n || (n = e.fn.cycle.transitions.fade, s.API.log('Transition "' + s.fx + '" not found. Using fade.')), n }, prepareTx: function (e, t) { var i, n, s, o, c, l = this.opts(); return 2 > l.slideCount ? (l.timeoutId = 0, void 0) : (!e || l.busy && !l.manualTrump || (l.API.stopTransition(), l.busy = !1, clearTimeout(l.timeoutId), l.timeoutId = 0), l.busy || (0 !== l.timeoutId || e) && (n = l.slides[l.currSlide], s = l.slides[l.nextSlide], o = l.API.getSlideOpts(l.nextSlide), c = l.API.calcTx(o, e), l._tx = c, e && void 0 !== o.manualSpeed && (o.speed = o.manualSpeed), l.nextSlide != l.currSlide && (e || !l.paused && !l.hoverPaused && l.timeout) ? (l.API.trigger("cycle-before", [o, n, s, t]), c.before && c.before(o, n, s, t), i = function () { l.busy = !1, l.container.data("cycle.opts") && (c.after && c.after(o, n, s, t), l.API.trigger("cycle-after", [o, n, s, t]), l.API.queueTransition(o), l.API.updateView(!0)) }, l.busy = !0, c.transition ? c.transition(o, n, s, t, i) : l.API.doTransition(o, n, s, t, i), l.API.calcNextSlide(), l.API.updateView()) : l.API.queueTransition(o)), void 0) }, doTransition: function (t, i, n, s, o) { var c = t, l = e(i), r = e(n), a = function () { r.animate(c.animIn || {opacity: 1}, c.speed, c.easeIn || c.easing, o) }; r.css(c.cssBefore || {}), l.animate(c.animOut || {}, c.speed, c.easeOut || c.easing, function () { l.css(c.cssAfter || {}), c.sync || a() }), c.sync && a() }, queueTransition: function (t, i) { var n = this.opts(), s = void 0 !== i ? i : t.timeout; return 0 === n.nextSlide && 0 === --n.loop ? (n.API.log("terminating; loop=0"), n.timeout = 0, s ? setTimeout(function () { n.API.trigger("cycle-finished", [n]) }, s) : n.API.trigger("cycle-finished", [n]), n.nextSlide = n.currSlide, void 0) : void 0 !== n.continueAuto && (n.continueAuto === !1 || e.isFunction(n.continueAuto) && n.continueAuto() === !1) ? (n.API.log("terminating automatic transitions"), n.timeout = 0, n.timeoutId && clearTimeout(n.timeoutId), void 0) : (s && (n._lastQueue = e.now(), void 0 === i && (n._remainingTimeout = t.timeout), n.paused || n.hoverPaused || (n.timeoutId = setTimeout(function () { n.API.prepareTx(!1, !n.reverse) }, s))), void 0) }, stopTransition: function () { var e = this.opts(); e.slides.filter(":animated").length && (e.slides.stop(!1, !0), e.API.trigger("cycle-transition-stopped", [e])), e._tx && e._tx.stopTransition && e._tx.stopTransition(e) }, advanceSlide: function (e) { var t = this.opts(); return clearTimeout(t.timeoutId), t.timeoutId = 0, t.nextSlide = t.currSlide + e, 0 > t.nextSlide ? t.nextSlide = t.slides.length - 1 : t.nextSlide >= t.slides.length && (t.nextSlide = 0), t.API.prepareTx(!0, e >= 0), !1 }, buildSlideOpts: function (i) { var n, s, o = this.opts(), c = i.data() || {}; for (var l in c)c.hasOwnProperty(l) && /^cycle[A-Z]+/.test(l) && (n = c[l], s = l.match(/^cycle(.*)/)[1].replace(/^[A-Z]/, t), o.API.log("[" + (o.slideCount - 1) + "]", s + ":", n, "(" + typeof n + ")"), c[s] = n); c = e.extend({}, e.fn.cycle.defaults, o, c), c.slideNum = o.slideCount; try { delete c.API, delete c.slideCount, delete c.currSlide, delete c.nextSlide, delete c.slides } catch (r) { } return c }, getSlideOpts: function (t) { var i = this.opts(); void 0 === t && (t = i.currSlide); var n = i.slides[t], s = e(n).data("cycle.opts"); return e.extend({}, i, s) }, initSlide: function (t, i, n) { var s = this.opts(); i.css(t.slideCss || {}), n > 0 && i.css("zIndex", n), isNaN(t.speed) && (t.speed = e.fx.speeds[t.speed] || e.fx.speeds._default), t.sync || (t.speed = t.speed / 2), i.addClass(s.slideClass) }, updateView: function (e, t) { var i = this.opts(); if (i._initialized) { var n = i.API.getSlideOpts(), s = i.slides[i.currSlide]; !e && t !== !0 && (i.API.trigger("cycle-update-view-before", [i, n, s]), 0 > i.updateView) || (i.slideActiveClass && i.slides.removeClass(i.slideActiveClass).eq(i.currSlide).addClass(i.slideActiveClass), e && i.hideNonActive && i.slides.filter(":not(." + i.slideActiveClass + ")").css("visibility", "hidden"), 0 === i.updateView && setTimeout(function () { i.API.trigger("cycle-update-view", [i, n, s, e]) }, n.speed / (i.sync ? 2 : 1)), 0 !== i.updateView && i.API.trigger("cycle-update-view", [i, n, s, e]), e && i.API.trigger("cycle-update-view-after", [i, n, s])) } }, getComponent: function (t) { var i = this.opts(), n = i[t]; return "string" == typeof n ? /^\s*[\>|\+|~]/.test(n) ? i.container.find(n) : e(n) : n.jquery ? n : e(n) }, stackSlides: function (t, i, n) { var s = this.opts(); t || (t = s.slides[s.currSlide], i = s.slides[s.nextSlide], n = !s.reverse), e(t).css("zIndex", s.maxZ); var o, c = s.maxZ - 2, l = s.slideCount; if (n) { for (o = s.currSlide + 1; l > o; o++)e(s.slides[o]).css("zIndex", c--); for (o = 0; s.currSlide > o; o++)e(s.slides[o]).css("zIndex", c--) } else { for (o = s.currSlide - 1; o >= 0; o--)e(s.slides[o]).css("zIndex", c--); for (o = l - 1; o > s.currSlide; o--)e(s.slides[o]).css("zIndex", c--) } e(i).css("zIndex", s.maxZ - 1) }, getSlideIndex: function (e) { return this.opts().slides.index(e) } }, e.fn.cycle.log = function () { window.console && console.log && console.log("[cycle2] " + Array.prototype.join.call(arguments, " ")) }, e.fn.cycle.version = function () { return "Cycle2: " + i }, e.fn.cycle.transitions = { custom: {}, none: { before: function (e, t, i, n) { e.API.stackSlides(i, t, n), e.cssBefore = {opacity: 1, visibility: "visible", display: "block"} } }, fade: { before: function (t, i, n, s) { var o = t.API.getSlideOpts(t.nextSlide).slideCss || {}; t.API.stackSlides(i, n, s), t.cssBefore = e.extend(o, { opacity: 0, visibility: "visible", display: "block" }), t.animIn = {opacity: 1}, t.animOut = {opacity: 0} } }, fadeout: { before: function (t, i, n, s) { var o = t.API.getSlideOpts(t.nextSlide).slideCss || {}; t.API.stackSlides(i, n, s), t.cssBefore = e.extend(o, { opacity: 1, visibility: "visible", display: "block" }), t.animOut = {opacity: 0} } }, scrollHorz: { before: function (e, t, i, n) { e.API.stackSlides(t, i, n); var s = e.container.css("overflow", "hidden").width(); e.cssBefore = { left: n ? s : -s, top: 0, opacity: 1, visibility: "visible", display: "block" }, e.cssAfter = {zIndex: e._maxZ - 2, left: 0}, e.animIn = {left: 0}, e.animOut = {left: n ? -s : s} } } }, e.fn.cycle.defaults = { allowWrap: !0, autoSelector: ".cycle-slideshow[data-cycle-auto-init!=false]", delay: 0, easing: null, fx: "fade", hideNonActive: !0, loop: 0, manualFx: void 0, manualSpeed: void 0, manualTrump: !0, maxZ: 100, pauseOnHover: !1, reverse: !1, slideActiveClass: "cycle-slide-active", slideClass: "cycle-slide", slideCss: {position: "absolute", top: 0, left: 0}, slides: "> img", speed: 500, startingSlide: 0, sync: !0, timeout: 4e3, updateView: 0 }, e(document).ready(function () { e(e.fn.cycle.defaults.autoSelector).cycle() }) })(jQuery), /*! Cycle2 autoheight plugin; Copyright (c) M.Alsup, 2012; version: 20130913 */ function (e) { "use strict"; function t(t, n) { var s, o, c, l = n.autoHeight; if ("container" == l)o = e(n.slides[n.currSlide]).outerHeight(), n.container.height(o); else if (n._autoHeightRatio)n.container.height(n.container.width() / n._autoHeightRatio); else if ("calc" === l || "number" == e.type(l) && l >= 0) { if (c = "calc" === l ? i(t, n) : l >= n.slides.length ? 0 : l, c == n._sentinelIndex)return; n._sentinelIndex = c, n._sentinel && n._sentinel.remove(), s = e(n.slides[c].cloneNode(!0)), s.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"), s.css({ position: "static", visibility: "hidden", display: "block" }).prependTo(n.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active"), s.find("*").css("visibility", "hidden"), n._sentinel = s } } function i(t, i) { var n = 0, s = -1; return i.slides.each(function (t) { var i = e(this).height(); i > s && (s = i, n = t) }), n } function n(t, i, n, s) { var o = e(s).outerHeight(); i.container.animate({height: o}, i.autoHeightSpeed, i.autoHeightEasing) } function s(i, o) { o._autoHeightOnResize && (e(window).off("resize orientationchange", o._autoHeightOnResize), o._autoHeightOnResize = null), o.container.off("cycle-slide-added cycle-slide-removed", t), o.container.off("cycle-destroyed", s), o.container.off("cycle-before", n), o._sentinel && (o._sentinel.remove(), o._sentinel = null) } e.extend(e.fn.cycle.defaults, { autoHeight: 0, autoHeightSpeed: 250, autoHeightEasing: null }), e(document).on("cycle-initialized", function (i, o) { function c() { t(i, o) } var l, r = o.autoHeight, a = e.type(r), d = null; ("string" === a || "number" === a) && (o.container.on("cycle-slide-added cycle-slide-removed", t), o.container.on("cycle-destroyed", s), "container" == r ? o.container.on("cycle-before", n) : "string" === a && /\d+\:\d+/.test(r) && (l = r.match(/(\d+)\:(\d+)/), l = l[1] / l[2], o._autoHeightRatio = l), "number" !== a && (o._autoHeightOnResize = function () { clearTimeout(d), d = setTimeout(c, 50) }, e(window).on("resize orientationchange", o._autoHeightOnResize)), setTimeout(c, 30)) }) }(jQuery), /*! caption plugin for Cycle2; version: 20130306 */ function (e) { "use strict"; e.extend(e.fn.cycle.defaults, { caption: "> .cycle-caption", captionTemplate: "{{slideNum}} / {{slideCount}}", overlay: "> .cycle-overlay", overlayTemplate: "
{{title}}
{{desc}}
", captionModule: "caption" }), e(document).on("cycle-update-view", function (t, i, n, s) { "caption" === i.captionModule && e.each(["caption", "overlay"], function () { var e = this, t = n[e + "Template"], o = i.API.getComponent(e); o.length && t ? (o.html(i.API.tmpl(t, n, i, s)), o.show()) : o.hide() }) }), e(document).on("cycle-destroyed", function (t, i) { var n; e.each(["caption", "overlay"], function () { var e = this, t = i[e + "Template"]; i[e] && t && (n = i.API.getComponent("caption"), n.empty()) }) }) }(jQuery), /*! command plugin for Cycle2; version: 20130707 */ function (e) { "use strict"; var t = e.fn.cycle; e.fn.cycle = function (i) { var n, s, o, c = e.makeArray(arguments); return "number" == e.type(i) ? this.cycle("goto", i) : "string" == e.type(i) ? this.each(function () { var l; return n = i, o = e(this).data("cycle.opts"), void 0 === o ? (t.log('slideshow must be initialized before sending commands; "' + n + '" ignored'), void 0) : (n = "goto" == n ? "jump" : n, s = o.API[n], e.isFunction(s) ? (l = e.makeArray(c), l.shift(), s.apply(o.API, l)) : (t.log("unknown command: ", n), void 0)) }) : t.apply(this, arguments) }, e.extend(e.fn.cycle, t), e.extend(t.API, { next: function () { var e = this.opts(); if (!e.busy || e.manualTrump) { var t = e.reverse ? -1 : 1; e.allowWrap === !1 && e.currSlide + t >= e.slideCount || (e.API.advanceSlide(t), e.API.trigger("cycle-next", [e]).log("cycle-next")) } }, prev: function () { var e = this.opts(); if (!e.busy || e.manualTrump) { var t = e.reverse ? 1 : -1; e.allowWrap === !1 && 0 > e.currSlide + t || (e.API.advanceSlide(t), e.API.trigger("cycle-prev", [e]).log("cycle-prev")) } }, destroy: function () { this.stop(); var t = this.opts(), i = e.isFunction(e._data) ? e._data : e.noop; clearTimeout(t.timeoutId), t.timeoutId = 0, t.API.stop(), t.API.trigger("cycle-destroyed", [t]).log("cycle-destroyed"), t.container.removeData(), i(t.container[0], "parsedAttrs", !1), t.retainStylesOnDestroy || (t.container.removeAttr("style"), t.slides.removeAttr("style"), t.slides.removeClass(t.slideActiveClass)), t.slides.each(function () { e(this).removeData(), i(this, "parsedAttrs", !1) }) }, jump: function (e) { var t, i = this.opts(); if (!i.busy || i.manualTrump) { var n = parseInt(e, 10); if (isNaN(n) || 0 > n || n >= i.slides.length)return i.API.log("goto: invalid slide index: " + n), void 0; if (n == i.currSlide)return i.API.log("goto: skipping, already on slide", n), void 0; i.nextSlide = n, clearTimeout(i.timeoutId), i.timeoutId = 0, i.API.log("goto: ", n, " (zero-index)"), t = i.currSlide < i.nextSlide, i.API.prepareTx(!0, t) } }, stop: function () { var t = this.opts(), i = t.container; clearTimeout(t.timeoutId), t.timeoutId = 0, t.API.stopTransition(), t.pauseOnHover && (t.pauseOnHover !== !0 && (i = e(t.pauseOnHover)), i.off("mouseenter mouseleave")), t.API.trigger("cycle-stopped", [t]).log("cycle-stopped") }, reinit: function () { var e = this.opts(); e.API.destroy(), e.container.cycle() }, remove: function (t) { for (var i, n, s = this.opts(), o = [], c = 1, l = 0; s.slides.length > l; l++)i = s.slides[l], l == t ? n = i : (o.push(i), e(i).data("cycle.opts").slideNum = c, c++); n && (s.slides = e(o), s.slideCount--, e(n).remove(), t == s.currSlide ? s.API.advanceSlide(1) : s.currSlide > t ? s.currSlide-- : s.currSlide++, s.API.trigger("cycle-slide-removed", [s, t, n]).log("cycle-slide-removed"), s.API.updateView()) } }), e(document).on("click.cycle", "[data-cycle-cmd]", function (t) { t.preventDefault(); var i = e(this), n = i.data("cycle-cmd"), s = i.data("cycle-context") || ".cycle-slideshow"; e(s).cycle(n, i.data("cycle-arg")) }) }(jQuery), /*! hash plugin for Cycle2; version: 20130905 */ function (e) { "use strict"; function t(t, i) { var n; return t._hashFence ? (t._hashFence = !1, void 0) : (n = window.location.hash.substring(1), t.slides.each(function (s) { if (e(this).data("cycle-hash") == n) { if (i === !0)t.startingSlide = s; else { var o = s > t.currSlide; t.nextSlide = s, t.API.prepareTx(!0, o) } return !1 } }), void 0) } e(document).on("cycle-pre-initialize", function (i, n) { t(n, !0), n._onHashChange = function () { t(n, !1) }, e(window).on("hashchange", n._onHashChange) }), e(document).on("cycle-update-view", function (e, t, i) { i.hash && "#" + i.hash != window.location.hash && (t._hashFence = !0, window.location.hash = i.hash) }), e(document).on("cycle-destroyed", function (t, i) { i._onHashChange && e(window).off("hashchange", i._onHashChange) }) }(jQuery), /*! loader plugin for Cycle2; version: 20131121 */ function (e) { "use strict"; e.extend(e.fn.cycle.defaults, {loader: !1}), e(document).on("cycle-bootstrap", function (t, i) { function n(t, n) { function o(t) { var o; "wait" == i.loader ? (l.push(t), 0 === a && (l.sort(c), s.apply(i.API, [l, n]), i.container.removeClass("cycle-loading"))) : (o = e(i.slides[i.currSlide]), s.apply(i.API, [t, n]), o.show(), i.container.removeClass("cycle-loading")) } function c(e, t) { return e.data("index") - t.data("index") } var l = []; if ("string" == e.type(t))t = e.trim(t); else if ("array" === e.type(t))for (var r = 0; t.length > r; r++)t[r] = e(t[r])[0]; t = e(t); var a = t.length; a && (t.css("visibility", "hidden").appendTo("body").each(function (t) { function c() { 0 === --r && (--a, o(d)) } var r = 0, d = e(this), u = d.is("img") ? d : d.find("img"); return d.data("index", t), u = u.filter(":not(.cycle-loader-ignore)").filter(':not([src=""])'), u.length ? (r = u.length, u.each(function () { this.complete ? c() : e(this).load(function () { c() }).on("error", function () { 0 === --r && (i.API.log("slide skipped; img not loaded:", this.src), 0 === --a && "wait" == i.loader && s.apply(i.API, [l, n])) }) }), void 0) : (--a, l.push(d), void 0) }), a && i.container.addClass("cycle-loading")) } var s; i.loader && (s = i.API.add, i.API.add = n) }) }(jQuery), /*! pager plugin for Cycle2; version: 20130525 */ function (e) { "use strict"; function t(t, i, n) { var s, o = t.API.getComponent("pager"); o.each(function () { var o = e(this); if (i.pagerTemplate) { var c = t.API.tmpl(i.pagerTemplate, i, t, n[0]); s = e(c).appendTo(o) } else s = o.children().eq(t.slideCount - 1); s.on(t.pagerEvent, function (e) { e.preventDefault(), t.API.page(o, e.currentTarget) }) }) } function i(e, t) { var i = this.opts(); if (!i.busy || i.manualTrump) { var n = e.children().index(t), s = n, o = s > i.currSlide; i.currSlide != s && (i.nextSlide = s, i.API.prepareTx(!0, o), i.API.trigger("cycle-pager-activated", [i, e, t])) } } e.extend(e.fn.cycle.defaults, { pager: "> .cycle-pager", pagerActiveClass: "cycle-pager-active", pagerEvent: "click.cycle", pagerTemplate: "" }), e(document).on("cycle-bootstrap", function (e, i, n) { n.buildPagerLink = t }), e(document).on("cycle-slide-added", function (e, t, n, s) { t.pager && (t.API.buildPagerLink(t, n, s), t.API.page = i) }), e(document).on("cycle-slide-removed", function (t, i, n) { if (i.pager) { var s = i.API.getComponent("pager"); s.each(function () { var t = e(this); e(t.children()[n]).remove() }) } }), e(document).on("cycle-update-view", function (t, i) { var n; i.pager && (n = i.API.getComponent("pager"), n.each(function () { e(this).children().removeClass(i.pagerActiveClass).eq(i.currSlide).addClass(i.pagerActiveClass) })) }), e(document).on("cycle-destroyed", function (e, t) { var i = t.API.getComponent("pager"); i && (i.children().off(t.pagerEvent), t.pagerTemplate && i.empty()) }) }(jQuery), /*! prevnext plugin for Cycle2; version: 20130709 */ function (e) { "use strict"; e.extend(e.fn.cycle.defaults, { next: "> .cycle-next", nextEvent: "click.cycle", disabledClass: "disabled", prev: "> .cycle-prev", prevEvent: "click.cycle", swipe: !1 }), e(document).on("cycle-initialized", function (e, t) { if (t.API.getComponent("next").on(t.nextEvent, function (e) { e.preventDefault(), t.API.next() }), t.API.getComponent("prev").on(t.prevEvent, function (e) { e.preventDefault(), t.API.prev() }), t.swipe) { var i = t.swipeVert ? "swipeUp.cycle" : "swipeLeft.cycle swipeleft.cycle", n = t.swipeVert ? "swipeDown.cycle" : "swipeRight.cycle swiperight.cycle"; t.container.on(i, function () { t.API.next() }), t.container.on(n, function () { t.API.prev() }) } }), e(document).on("cycle-update-view", function (e, t) { if (!t.allowWrap) { var i = t.disabledClass, n = t.API.getComponent("next"), s = t.API.getComponent("prev"), o = t._prevBoundry || 0, c = void 0 !== t._nextBoundry ? t._nextBoundry : t.slideCount - 1; t.currSlide == c ? n.addClass(i).prop("disabled", !0) : n.removeClass(i).prop("disabled", !1), t.currSlide === o ? s.addClass(i).prop("disabled", !0) : s.removeClass(i).prop("disabled", !1) } }), e(document).on("cycle-destroyed", function (e, t) { t.API.getComponent("prev").off(t.nextEvent), t.API.getComponent("next").off(t.prevEvent), t.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle") }) }(jQuery), /*! progressive loader plugin for Cycle2; version: 20130315 */ function (e) { "use strict"; e.extend(e.fn.cycle.defaults, {progressive: !1}), e(document).on("cycle-pre-initialize", function (t, i) { if (i.progressive) { var n, s, o = i.API, c = o.next, l = o.prev, r = o.prepareTx, a = e.type(i.progressive); if ("array" == a)n = i.progressive; else if (e.isFunction(i.progressive))n = i.progressive(i); else if ("string" == a) { if (s = e(i.progressive), n = e.trim(s.html()), !n)return; if (/^(\[)/.test(n))try { n = e.parseJSON(n) } catch (d) { return o.log("error parsing progressive slides", d), void 0 } else n = n.split(RegExp(s.data("cycle-split") || "\n")), n[n.length - 1] || n.pop() } r && (o.prepareTx = function (e, t) { var s, o; return e || 0 === n.length ? (r.apply(i.API, [e, t]), void 0) : (t && i.currSlide == i.slideCount - 1 ? (o = n[0], n = n.slice(1), i.container.one("cycle-slide-added", function (e, t) { setTimeout(function () { t.API.advanceSlide(1) }, 50) }), i.API.add(o)) : t || 0 !== i.currSlide ? r.apply(i.API, [e, t]) : (s = n.length - 1, o = n[s], n = n.slice(0, s), i.container.one("cycle-slide-added", function (e, t) { setTimeout(function () { t.currSlide = 1, t.API.advanceSlide(-1) }, 50) }), i.API.add(o, !0)), void 0) }), c && (o.next = function () { var e = this.opts(); if (n.length && e.currSlide == e.slideCount - 1) { var t = n[0]; n = n.slice(1), e.container.one("cycle-slide-added", function (e, t) { c.apply(t.API), t.container.removeClass("cycle-loading") }), e.container.addClass("cycle-loading"), e.API.add(t) } else c.apply(e.API) }), l && (o.prev = function () { var e = this.opts(); if (n.length && 0 === e.currSlide) { var t = n.length - 1, i = n[t]; n = n.slice(0, t), e.container.one("cycle-slide-added", function (e, t) { t.currSlide = 1, t.API.advanceSlide(-1), t.container.removeClass("cycle-loading") }), e.container.addClass("cycle-loading"), e.API.add(i, !0) } else l.apply(e.API) }) } }) }(jQuery), /*! tmpl plugin for Cycle2; version: 20121227 */ function (e) { "use strict"; e.extend(e.fn.cycle.defaults, {tmplRegex: "{{((.)?.*?)}}"}), e.extend(e.fn.cycle.API, { tmpl: function (t, i) { var n = RegExp(i.tmplRegex || e.fn.cycle.defaults.tmplRegex, "g"), s = e.makeArray(arguments); return s.shift(), t.replace(n, function (t, i) { var n, o, c, l, r = i.split("."); for (n = 0; s.length > n; n++)if (c = s[n]) { if (r.length > 1)for (l = c, o = 0; r.length > o; o++)c = l, l = l[r[o]] || i; else l = c[i]; if (e.isFunction(l))return l.apply(c, s); if (void 0 !== l && null !== l && l != i)return l } return i }) } }) }(jQuery); //@ sourceMappingURL=jquery.cycle2.js.map /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // t: current time, b: begInnIng value, c: change In value, d: duration jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend(jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { //alert(jQuery.easing.default); return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c * (t /= d) * t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c * (t /= d) * (t - 2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t + b; return -c / 2 * ((--t) * (t - 2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c * (t /= d) * t * t + b; }, easeOutCubic: function (x, t, b, c, d) { return c * ((t = t / d - 1) * t * t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t + b; return c / 2 * ((t -= 2) * t * t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c * (t /= d) * t * t * t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t = t / d - 1) * t * t * t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b; return -c / 2 * ((t -= 2) * t * t * t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c * (t /= d) * t * t * t * t + b; }, easeOutQuint: function (x, t, b, c, d) { return c * ((t = t / d - 1) * t * t * t * t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b; return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t / d * (Math.PI / 2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t == 0) return b; if (t == d) return b + c; if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b; return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3; if (a < Math.abs(c)) { a = c; var s = p / 4; } else var s = p / (2 * Math.PI) * Math.asin(c / a); return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; }, easeOutElastic: function (x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3; if (a < Math.abs(c)) { a = c; var s = p / 4; } else var s = p / (2 * Math.PI) * Math.asin(c / a); return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5); if (a < Math.abs(c)) { a = c; var s = p / 4; } else var s = p / (2 * Math.PI) * Math.asin(c / a); if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c * (t /= d) * t * ((s + 1) * t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t /= d) < (1 / 2.75)) { return c * (7.5625 * t * t) + b; } else if (t < (2 / 2.75)) { return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b; } else if (t < (2.5 / 2.75)) { return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b; } else { return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b; } }); /* * * TERMS OF USE - EASING EQUATIONS * * Open source under the BSD License. * * Copyright © 2001 Robert Penner * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* Plugin: jQuery Parallax Version 1.1 Author: Ian Lunn Author URL: http://www.ianlunn.co.uk/ Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/ Dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl.html */ //function that places the navigation in the center of the window function RepositionNav() { var windowHeight = $(window).height(); //get the height of the window var navHeight = $('#nav').height() / 2; var windowCenter = (windowHeight / 2); var newtop = windowCenter - navHeight; $('#nav').css({"top": newtop}); //set the new top position of the navigation list } (function ($) { $.fn.parallax = function (xpos, adjuster, inertia, outerHeight) { function inView(pos, element) { element.each(function () { //for each selector, determine whether it's inview and run the move() function var element = $(this); var top = element.offset().top; if (outerHeight == true) { var height = element.outerHeight(true); } else { var height = element.height(); } //above & in view if (top + height >= pos && top + height - windowHeight < pos) { move(pos, height); } //full view if (top <= pos && (top + height) >= pos && (top - windowHeight) < pos && top + height - windowHeight > pos) { move(pos, height); } //below & in view if (top + height > pos && top - windowHeight < pos && top > pos) { move(pos, height); } }); } var $window = $(window); var windowHeight = $(window).height(); var pos = $window.scrollTop(); //position of the scrollbar var $this = $(this); //setup defaults if arguments aren't specified if (xpos == null) { xpos = "50%" } if (adjuster == null) { adjuster = 0 } if (inertia == null) { inertia = 0.1 } if (outerHeight == null) { outerHeight = true } height = $this.height(); $this.css({'backgroundPosition': newPos(xpos, outerHeight, adjuster, inertia)}); function newPos(xpos, windowHeight, pos, adjuster, inertia) { return xpos + " " + Math.round((-((windowHeight + pos) - adjuster) * inertia)) + "px"; } //function to be called whenever the window is scrolled or resized function move(pos, height) { $this.css({'backgroundPosition': newPos(xpos, height, pos, adjuster, inertia)}); } $window.bind('scroll', function () { //when the user is scrolling... var pos = $window.scrollTop(); //position of the scrollbar inView(pos, $this); $('#pixels').html(pos); }) } })(jQuery); /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.0.6 * * Requires: 1.2.2+ */ (function (a) { function d(b) { var c = b || window.event, d = [].slice.call(arguments, 1), e = 0, f = !0, g = 0, h = 0; return b = a.event.fix(c), b.type = "mousewheel", c.wheelDelta && (e = c.wheelDelta / 120), c.detail && (e = -c.detail / 3), h = e, c.axis !== undefined && c.axis === c.HORIZONTAL_AXIS && (h = 0, g = -1 * e), c.wheelDeltaY !== undefined && (h = c.wheelDeltaY / 120), c.wheelDeltaX !== undefined && (g = -1 * c.wheelDeltaX / 120), d.unshift(b, e, g, h), (a.event.dispatch || a.event.handle).apply(this, d) } var b = ["DOMMouseScroll", "mousewheel"]; if (a.event.fixHooks)for (var c = b.length; c;)a.event.fixHooks[b[--c]] = a.event.mouseHooks; a.event.special.mousewheel = { setup: function () { if (this.addEventListener)for (var a = b.length; a;)this.addEventListener(b[--a], d, !1); else this.onmousewheel = d }, teardown: function () { if (this.removeEventListener)for (var a = b.length; a;)this.removeEventListener(b[--a], d, !1); else this.onmousewheel = null } }, a.fn.extend({ mousewheel: function (a) { return a ? this.bind("mousewheel", a) : this.trigger("mousewheel") }, unmousewheel: function (a) { return this.unbind("mousewheel", a) } }) })(jQuery); /* == malihu jquery custom scrollbars plugin == version: 2.8.2 author: malihu (http://manos.malihu.gr) plugin home: http://manos.malihu.gr/jquery-custom-content-scroller */ /* Copyright 2010-2013 Manos Malihutsakis This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/lgpl.html. */ (function ($) { /*plugin script*/ var methods = { init: function (options) { var defaults = { set_width: false, /*optional element width: boolean, pixels, percentage*/ set_height: false, /*optional element height: boolean, pixels, percentage*/ horizontalScroll: false, /*scroll horizontally: boolean*/ scrollInertia: 950, /*scrolling inertia: integer (milliseconds)*/ mouseWheel: true, /*mousewheel support: boolean*/ mouseWheelPixels: "auto", /*mousewheel pixels amount: integer, "auto"*/ autoDraggerLength: true, /*auto-adjust scrollbar dragger length: boolean*/ autoHideScrollbar: false, /*auto-hide scrollbar when idle*/ snapAmount: null, /* optional element always snaps to a multiple of this number in pixels */ snapOffset: 0, /* when snapping, snap with this number in pixels as an offset */ scrollButtons: { /*scroll buttons*/ enable: false, /*scroll buttons support: boolean*/ scrollType: "continuous", /*scroll buttons scrolling type: "continuous", "pixels"*/ scrollSpeed: "auto", /*scroll buttons continuous scrolling speed: integer, "auto"*/ scrollAmount: 40 /*scroll buttons pixels scroll amount: integer (pixels)*/ }, advanced: { updateOnBrowserResize: true, /*update scrollbars on browser resize (for layouts based on percentages): boolean*/ updateOnContentResize: false, /*auto-update scrollbars on content resize (for dynamic content): boolean*/ autoExpandHorizontalScroll: false, /*auto-expand width for horizontal scrolling: boolean*/ autoScrollOnFocus: true, /*auto-scroll on focused elements: boolean*/ normalizeMouseWheelDelta: false /*normalize mouse-wheel delta (-1/1)*/ }, contentTouchScroll: true, /*scrolling by touch-swipe content: boolean*/ callbacks: { onScrollStart: function () { }, /*user custom callback function on scroll start event*/ onScroll: function () { }, /*user custom callback function on scroll event*/ onTotalScroll: function () { }, /*user custom callback function on scroll end reached event*/ onTotalScrollBack: function () { }, /*user custom callback function on scroll begin reached event*/ onTotalScrollOffset: 0, /*scroll end reached offset: integer (pixels)*/ onTotalScrollBackOffset: 0, /*scroll begin reached offset: integer (pixels)*/ whileScrolling: function () { } /*user custom callback function on scrolling event*/ }, theme: "light" /*"light", "dark", "light-2", "dark-2", "light-thick", "dark-thick", "light-thin", "dark-thin"*/ }, options = $.extend(true, defaults, options); return this.each(function () { var $this = $(this); /*set element width/height, create markup for custom scrollbars, add classes*/ if (options.set_width) { $this.css("width", options.set_width); } if (options.set_height) { $this.css("height", options.set_height); } if (!$(document).data("mCustomScrollbar-index")) { $(document).data("mCustomScrollbar-index", "1"); } else { var mCustomScrollbarIndex = parseInt($(document).data("mCustomScrollbar-index")); $(document).data("mCustomScrollbar-index", mCustomScrollbarIndex + 1); } $this.wrapInner("
").addClass("mCustomScrollbar _mCS_" + $(document).data("mCustomScrollbar-index")); var mCustomScrollBox = $this.children(".mCustomScrollBox"); if (options.horizontalScroll) { mCustomScrollBox.addClass("mCSB_horizontal").wrapInner("
"); var mCSB_h_wrapper = mCustomScrollBox.children(".mCSB_h_wrapper"); mCSB_h_wrapper.wrapInner("
").children(".mCSB_container").css({ "width": mCSB_h_wrapper.children().outerWidth(), "position": "relative" }).unwrap(); } else { mCustomScrollBox.wrapInner("
"); } var mCSB_container = mCustomScrollBox.children(".mCSB_container"); if ($.support.touch) { mCSB_container.addClass("mCS_touch"); } mCSB_container.after("
"); var mCSB_scrollTools = mCustomScrollBox.children(".mCSB_scrollTools"), mCSB_draggerContainer = mCSB_scrollTools.children(".mCSB_draggerContainer"), mCSB_dragger = mCSB_draggerContainer.children(".mCSB_dragger"); if (options.horizontalScroll) { mCSB_dragger.data("minDraggerWidth", mCSB_dragger.width()); } else { mCSB_dragger.data("minDraggerHeight", mCSB_dragger.height()); } if (options.scrollButtons.enable) { if (options.horizontalScroll) { mCSB_scrollTools.prepend("").append(""); } else { mCSB_scrollTools.prepend("").append(""); } } /*mCustomScrollBox scrollTop and scrollLeft is always 0 to prevent browser focus scrolling*/ mCustomScrollBox.bind("scroll", function () { if (!$this.is(".mCS_disabled")) { /*native focus scrolling for disabled scrollbars*/ mCustomScrollBox.scrollTop(0).scrollLeft(0); } }); /*store options, global vars/states, intervals*/ $this.data({ /*init state*/ "mCS_Init": true, /*instance index*/ "mCustomScrollbarIndex": $(document).data("mCustomScrollbar-index"), /*option parameters*/ "horizontalScroll": options.horizontalScroll, "scrollInertia": options.scrollInertia, "scrollEasing": "mcsEaseOut", "mouseWheel": options.mouseWheel, "mouseWheelPixels": options.mouseWheelPixels, "autoDraggerLength": options.autoDraggerLength, "autoHideScrollbar": options.autoHideScrollbar, "snapAmount": options.snapAmount, "snapOffset": options.snapOffset, "scrollButtons_enable": options.scrollButtons.enable, "scrollButtons_scrollType": options.scrollButtons.scrollType, "scrollButtons_scrollSpeed": options.scrollButtons.scrollSpeed, "scrollButtons_scrollAmount": options.scrollButtons.scrollAmount, "autoExpandHorizontalScroll": options.advanced.autoExpandHorizontalScroll, "autoScrollOnFocus": options.advanced.autoScrollOnFocus, "normalizeMouseWheelDelta": options.advanced.normalizeMouseWheelDelta, "contentTouchScroll": options.contentTouchScroll, "onScrollStart_Callback": options.callbacks.onScrollStart, "onScroll_Callback": options.callbacks.onScroll, "onTotalScroll_Callback": options.callbacks.onTotalScroll, "onTotalScrollBack_Callback": options.callbacks.onTotalScrollBack, "onTotalScroll_Offset": options.callbacks.onTotalScrollOffset, "onTotalScrollBack_Offset": options.callbacks.onTotalScrollBackOffset, "whileScrolling_Callback": options.callbacks.whileScrolling, /*events binding state*/ "bindEvent_scrollbar_drag": false, "bindEvent_content_touch": false, "bindEvent_scrollbar_click": false, "bindEvent_mousewheel": false, "bindEvent_buttonsContinuous_y": false, "bindEvent_buttonsContinuous_x": false, "bindEvent_buttonsPixels_y": false, "bindEvent_buttonsPixels_x": false, "bindEvent_focusin": false, "bindEvent_autoHideScrollbar": false, /*buttons intervals*/ "mCSB_buttonScrollRight": false, "mCSB_buttonScrollLeft": false, "mCSB_buttonScrollDown": false, "mCSB_buttonScrollUp": false }); /*max-width/max-height*/ if (options.horizontalScroll) { if ($this.css("max-width") !== "none") { if (!options.advanced.updateOnContentResize) { /*needs updateOnContentResize*/ options.advanced.updateOnContentResize = true; } } } else { if ($this.css("max-height") !== "none") { var percentage = false, maxHeight = parseInt($this.css("max-height")); if ($this.css("max-height").indexOf("%") >= 0) { percentage = maxHeight, maxHeight = $this.parent().height() * percentage / 100; } $this.css("overflow", "hidden"); mCustomScrollBox.css("max-height", maxHeight); } } $this.mCustomScrollbar("update"); /*window resize fn (for layouts based on percentages)*/ if (options.advanced.updateOnBrowserResize) { var mCSB_resizeTimeout, currWinWidth = $(window).width(), currWinHeight = $(window).height(); $(window).bind("resize." + $this.data("mCustomScrollbarIndex"), function () { if (mCSB_resizeTimeout) { clearTimeout(mCSB_resizeTimeout); } mCSB_resizeTimeout = setTimeout(function () { if (!$this.is(".mCS_disabled") && !$this.is(".mCS_destroyed")) { var winWidth = $(window).width(), winHeight = $(window).height(); if (currWinWidth !== winWidth || currWinHeight !== winHeight) { /*ie8 fix*/ if ($this.css("max-height") !== "none" && percentage) { mCustomScrollBox.css("max-height", $this.parent().height() * percentage / 100); } $this.mCustomScrollbar("update"); currWinWidth = winWidth; currWinHeight = winHeight; } } }, 150); }); } /*content resize fn (for dynamically generated content)*/ if (options.advanced.updateOnContentResize) { var mCSB_onContentResize; if (options.horizontalScroll) { var mCSB_containerOldSize = mCSB_container.outerWidth(); } else { var mCSB_containerOldSize = mCSB_container.outerHeight(); } mCSB_onContentResize = setInterval(function () { if (options.horizontalScroll) { if (options.advanced.autoExpandHorizontalScroll) { mCSB_container.css({ "position": "absolute", "width": "auto" }).wrap("
").css({ "width": mCSB_container.outerWidth(), "position": "relative" }).unwrap(); } var mCSB_containerNewSize = mCSB_container.outerWidth(); } else { var mCSB_containerNewSize = mCSB_container.outerHeight(); } if (mCSB_containerNewSize != mCSB_containerOldSize) { $this.mCustomScrollbar("update"); mCSB_containerOldSize = mCSB_containerNewSize; } }, 300); } }); }, update: function () { var $this = $(this), mCustomScrollBox = $this.children(".mCustomScrollBox"), mCSB_container = mCustomScrollBox.children(".mCSB_container"); mCSB_container.removeClass("mCS_no_scrollbar"); $this.removeClass("mCS_disabled mCS_destroyed"); mCustomScrollBox.scrollTop(0).scrollLeft(0); /*reset scrollTop/scrollLeft to prevent browser focus scrolling*/ var mCSB_scrollTools = mCustomScrollBox.children(".mCSB_scrollTools"), mCSB_draggerContainer = mCSB_scrollTools.children(".mCSB_draggerContainer"), mCSB_dragger = mCSB_draggerContainer.children(".mCSB_dragger"); if ($this.data("horizontalScroll")) { var mCSB_buttonLeft = mCSB_scrollTools.children(".mCSB_buttonLeft"), mCSB_buttonRight = mCSB_scrollTools.children(".mCSB_buttonRight"), mCustomScrollBoxW = mCustomScrollBox.width(); if ($this.data("autoExpandHorizontalScroll")) { mCSB_container.css({ "position": "absolute", "width": "auto" }).wrap("
").css({ "width": mCSB_container.outerWidth(), "position": "relative" }).unwrap(); } var mCSB_containerW = mCSB_container.outerWidth(); } else { var mCSB_buttonUp = mCSB_scrollTools.children(".mCSB_buttonUp"), mCSB_buttonDown = mCSB_scrollTools.children(".mCSB_buttonDown"), mCustomScrollBoxH = mCustomScrollBox.height(), mCSB_containerH = mCSB_container.outerHeight(); } if (mCSB_containerH > mCustomScrollBoxH && !$this.data("horizontalScroll")) { /*content needs vertical scrolling*/ mCSB_scrollTools.css("display", "block"); var mCSB_draggerContainerH = mCSB_draggerContainer.height(); /*auto adjust scrollbar dragger length analogous to content*/ if ($this.data("autoDraggerLength")) { var draggerH = Math.round(mCustomScrollBoxH / mCSB_containerH * mCSB_draggerContainerH), minDraggerH = mCSB_dragger.data("minDraggerHeight"); if (draggerH <= minDraggerH) { /*min dragger height*/ mCSB_dragger.css({"height": minDraggerH}); } else if (draggerH >= mCSB_draggerContainerH - 10) { /*max dragger height*/ var mCSB_draggerContainerMaxH = mCSB_draggerContainerH - 10; mCSB_dragger.css({"height": mCSB_draggerContainerMaxH}); } else { mCSB_dragger.css({"height": draggerH}); } mCSB_dragger.children(".mCSB_dragger_bar").css({"line-height": mCSB_dragger.height() + "px"}); } var mCSB_draggerH = mCSB_dragger.height(), /*calculate and store scroll amount, add scrolling*/ scrollAmount = (mCSB_containerH - mCustomScrollBoxH) / (mCSB_draggerContainerH - mCSB_draggerH); $this.data("scrollAmount", scrollAmount).mCustomScrollbar("scrolling", mCustomScrollBox, mCSB_container, mCSB_draggerContainer, mCSB_dragger, mCSB_buttonUp, mCSB_buttonDown, mCSB_buttonLeft, mCSB_buttonRight); /*scroll*/ var mCSB_containerP = Math.abs(mCSB_container.position().top); $this.mCustomScrollbar("scrollTo", mCSB_containerP, {scrollInertia: 0, trigger: "internal"}); } else if (mCSB_containerW > mCustomScrollBoxW && $this.data("horizontalScroll")) { /*content needs horizontal scrolling*/ mCSB_scrollTools.css("display", "block"); var mCSB_draggerContainerW = mCSB_draggerContainer.width(); /*auto adjust scrollbar dragger length analogous to content*/ if ($this.data("autoDraggerLength")) { var draggerW = Math.round(mCustomScrollBoxW / mCSB_containerW * mCSB_draggerContainerW), minDraggerW = mCSB_dragger.data("minDraggerWidth"); if (draggerW <= minDraggerW) { /*min dragger height*/ mCSB_dragger.css({"width": minDraggerW}); } else if (draggerW >= mCSB_draggerContainerW - 10) { /*max dragger height*/ var mCSB_draggerContainerMaxW = mCSB_draggerContainerW - 10; mCSB_dragger.css({"width": mCSB_draggerContainerMaxW}); } else { mCSB_dragger.css({"width": draggerW}); } } var mCSB_draggerW = mCSB_dragger.width(), /*calculate and store scroll amount, add scrolling*/ scrollAmount = (mCSB_containerW - mCustomScrollBoxW) / (mCSB_draggerContainerW - mCSB_draggerW); $this.data("scrollAmount", scrollAmount).mCustomScrollbar("scrolling", mCustomScrollBox, mCSB_container, mCSB_draggerContainer, mCSB_dragger, mCSB_buttonUp, mCSB_buttonDown, mCSB_buttonLeft, mCSB_buttonRight); /*scroll*/ var mCSB_containerP = Math.abs(mCSB_container.position().left); $this.mCustomScrollbar("scrollTo", mCSB_containerP, {scrollInertia: 0, trigger: "internal"}); } else { /*content does not need scrolling*/ /*unbind events, reset content position, hide scrollbars, remove classes*/ mCustomScrollBox.unbind("mousewheel focusin"); if ($this.data("horizontalScroll")) { mCSB_dragger.add(mCSB_container).css("left", 0); } else { mCSB_dragger.add(mCSB_container).css("top", 0); } mCSB_scrollTools.css("display", "none"); mCSB_container.addClass("mCS_no_scrollbar"); $this.data({"bindEvent_mousewheel": false, "bindEvent_focusin": false}); } }, scrolling: function (mCustomScrollBox, mCSB_container, mCSB_draggerContainer, mCSB_dragger, mCSB_buttonUp, mCSB_buttonDown, mCSB_buttonLeft, mCSB_buttonRight) { var $this = $(this); /*scrollbar drag scrolling*/ if (!$this.data("bindEvent_scrollbar_drag")) { var mCSB_draggerDragY, mCSB_draggerDragX; if ($.support.msPointer) { /*MSPointer*/ mCSB_dragger.bind("MSPointerDown", function (e) { e.preventDefault(); $this.data({"on_drag": true}); mCSB_dragger.addClass("mCSB_dragger_onDrag"); var elem = $(this), elemOffset = elem.offset(), x = e.originalEvent.pageX - elemOffset.left, y = e.originalEvent.pageY - elemOffset.top; if (x < elem.width() && x > 0 && y < elem.height() && y > 0) { mCSB_draggerDragY = y; mCSB_draggerDragX = x; } }); $(document).bind("MSPointerMove." + $this.data("mCustomScrollbarIndex"), function (e) { e.preventDefault(); if ($this.data("on_drag")) { var elem = mCSB_dragger, elemOffset = elem.offset(), x = e.originalEvent.pageX - elemOffset.left, y = e.originalEvent.pageY - elemOffset.top; scrollbarDrag(mCSB_draggerDragY, mCSB_draggerDragX, y, x); } }).bind("MSPointerUp." + $this.data("mCustomScrollbarIndex"), function (e) { $this.data({"on_drag": false}); mCSB_dragger.removeClass("mCSB_dragger_onDrag"); }); } else { /*mouse/touch*/ mCSB_dragger.bind("mousedown touchstart", function (e) { e.preventDefault(); e.stopImmediatePropagation(); var elem = $(this), elemOffset = elem.offset(), x, y; if (e.type === "touchstart") { var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; x = touch.pageX - elemOffset.left; y = touch.pageY - elemOffset.top; } else { $this.data({"on_drag": true}); mCSB_dragger.addClass("mCSB_dragger_onDrag"); x = e.pageX - elemOffset.left; y = e.pageY - elemOffset.top; } if (x < elem.width() && x > 0 && y < elem.height() && y > 0) { mCSB_draggerDragY = y; mCSB_draggerDragX = x; } }).bind("touchmove", function (e) { e.preventDefault(); e.stopImmediatePropagation(); var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0], elem = $(this), elemOffset = elem.offset(), x = touch.pageX - elemOffset.left, y = touch.pageY - elemOffset.top; scrollbarDrag(mCSB_draggerDragY, mCSB_draggerDragX, y, x); }); $(document).bind("mousemove." + $this.data("mCustomScrollbarIndex"), function (e) { if ($this.data("on_drag")) { var elem = mCSB_dragger, elemOffset = elem.offset(), x = e.pageX - elemOffset.left, y = e.pageY - elemOffset.top; scrollbarDrag(mCSB_draggerDragY, mCSB_draggerDragX, y, x); } }).bind("mouseup." + $this.data("mCustomScrollbarIndex"), function (e) { $this.data({"on_drag": false}); mCSB_dragger.removeClass("mCSB_dragger_onDrag"); }); } $this.data({"bindEvent_scrollbar_drag": true}); } function scrollbarDrag(mCSB_draggerDragY, mCSB_draggerDragX, y, x) { if ($this.data("horizontalScroll")) { $this.mCustomScrollbar("scrollTo", (mCSB_dragger.position().left - (mCSB_draggerDragX)) + x, { moveDragger: true, trigger: "internal" }); } else { $this.mCustomScrollbar("scrollTo", (mCSB_dragger.position().top - (mCSB_draggerDragY)) + y, { moveDragger: true, trigger: "internal" }); } } /*content touch-drag*/ if ($.support.touch && $this.data("contentTouchScroll")) { if (!$this.data("bindEvent_content_touch")) { var touch, elem, elemOffset, y, x, mCSB_containerTouchY, mCSB_containerTouchX; mCSB_container.bind("touchstart", function (e) { e.stopImmediatePropagation(); touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; elem = $(this); elemOffset = elem.offset(); x = touch.pageX - elemOffset.left; y = touch.pageY - elemOffset.top; mCSB_containerTouchY = y; mCSB_containerTouchX = x; }); mCSB_container.bind("touchmove", function (e) { e.preventDefault(); e.stopImmediatePropagation(); touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; elem = $(this).parent(); elemOffset = elem.offset(); x = touch.pageX - elemOffset.left; y = touch.pageY - elemOffset.top; if ($this.data("horizontalScroll")) { $this.mCustomScrollbar("scrollTo", mCSB_containerTouchX - x, {trigger: "internal"}); } else { $this.mCustomScrollbar("scrollTo", mCSB_containerTouchY - y, {trigger: "internal"}); } }); } } /*dragger rail click scrolling*/ if (!$this.data("bindEvent_scrollbar_click")) { mCSB_draggerContainer.bind("click", function (e) { var scrollToPos = (e.pageY - mCSB_draggerContainer.offset().top) * $this.data("scrollAmount"), target = $(e.target); if ($this.data("horizontalScroll")) { scrollToPos = (e.pageX - mCSB_draggerContainer.offset().left) * $this.data("scrollAmount"); } if (target.hasClass("mCSB_draggerContainer") || target.hasClass("mCSB_draggerRail")) { $this.mCustomScrollbar("scrollTo", scrollToPos, { trigger: "internal", scrollEasing: "draggerRailEase" }); } }); $this.data({"bindEvent_scrollbar_click": true}); } /*mousewheel scrolling*/ if ($this.data("mouseWheel")) { if (!$this.data("bindEvent_mousewheel")) { mCustomScrollBox.bind("mousewheel", function (e, delta) { var scrollTo, mouseWheelPixels = $this.data("mouseWheelPixels"), absPos = Math.abs(mCSB_container.position().top), draggerPos = mCSB_dragger.position().top, limit = mCSB_draggerContainer.height() - mCSB_dragger.height(); if ($this.data("normalizeMouseWheelDelta")) { if (delta < 0) { delta = -1; } else { delta = 1; } } if (mouseWheelPixels === "auto") { mouseWheelPixels = 100 + Math.round($this.data("scrollAmount") / 2); } if ($this.data("horizontalScroll")) { draggerPos = mCSB_dragger.position().left; limit = mCSB_draggerContainer.width() - mCSB_dragger.width(); absPos = Math.abs(mCSB_container.position().left); } if ((delta > 0 && draggerPos !== 0) || (delta < 0 && draggerPos !== limit)) { e.preventDefault(); e.stopImmediatePropagation(); } scrollTo = absPos - (delta * mouseWheelPixels); $this.mCustomScrollbar("scrollTo", scrollTo, {trigger: "internal"}); }); $this.data({"bindEvent_mousewheel": true}); } } /*buttons scrolling*/ if ($this.data("scrollButtons_enable")) { if ($this.data("scrollButtons_scrollType") === "pixels") { /*scroll by pixels*/ if ($this.data("horizontalScroll")) { mCSB_buttonRight.add(mCSB_buttonLeft).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend", mCSB_buttonRight_stop, mCSB_buttonLeft_stop); $this.data({"bindEvent_buttonsContinuous_x": false}); if (!$this.data("bindEvent_buttonsPixels_x")) { /*scroll right*/ mCSB_buttonRight.bind("click", function (e) { e.preventDefault(); PixelsScrollTo(Math.abs(mCSB_container.position().left) + $this.data("scrollButtons_scrollAmount")); }); /*scroll left*/ mCSB_buttonLeft.bind("click", function (e) { e.preventDefault(); PixelsScrollTo(Math.abs(mCSB_container.position().left) - $this.data("scrollButtons_scrollAmount")); }); $this.data({"bindEvent_buttonsPixels_x": true}); } } else { mCSB_buttonDown.add(mCSB_buttonUp).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend", mCSB_buttonRight_stop, mCSB_buttonLeft_stop); $this.data({"bindEvent_buttonsContinuous_y": false}); if (!$this.data("bindEvent_buttonsPixels_y")) { /*scroll down*/ mCSB_buttonDown.bind("click", function (e) { e.preventDefault(); PixelsScrollTo(Math.abs(mCSB_container.position().top) + $this.data("scrollButtons_scrollAmount")); }); /*scroll up*/ mCSB_buttonUp.bind("click", function (e) { e.preventDefault(); PixelsScrollTo(Math.abs(mCSB_container.position().top) - $this.data("scrollButtons_scrollAmount")); }); $this.data({"bindEvent_buttonsPixels_y": true}); } } function PixelsScrollTo(to) { if (!mCSB_dragger.data("preventAction")) { mCSB_dragger.data("preventAction", true); $this.mCustomScrollbar("scrollTo", to, {trigger: "internal"}); } } } else { /*continuous scrolling*/ if ($this.data("horizontalScroll")) { mCSB_buttonRight.add(mCSB_buttonLeft).unbind("click"); $this.data({"bindEvent_buttonsPixels_x": false}); if (!$this.data("bindEvent_buttonsContinuous_x")) { /*scroll right*/ mCSB_buttonRight.bind("mousedown touchstart MSPointerDown", function (e) { e.preventDefault(); var scrollButtonsSpeed = ScrollButtonsSpeed(); $this.data({ "mCSB_buttonScrollRight": setInterval(function () { $this.mCustomScrollbar("scrollTo", Math.abs(mCSB_container.position().left) + scrollButtonsSpeed, { trigger: "internal", scrollEasing: "easeOutCirc" }); }, 17) }); }); var mCSB_buttonRight_stop = function (e) { e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollRight")); } mCSB_buttonRight.bind("mouseup touchend MSPointerUp mouseout MSPointerOut", mCSB_buttonRight_stop); /*scroll left*/ mCSB_buttonLeft.bind("mousedown touchstart MSPointerDown", function (e) { e.preventDefault(); var scrollButtonsSpeed = ScrollButtonsSpeed(); $this.data({ "mCSB_buttonScrollLeft": setInterval(function () { $this.mCustomScrollbar("scrollTo", Math.abs(mCSB_container.position().left) - scrollButtonsSpeed, { trigger: "internal", scrollEasing: "easeOutCirc" }); }, 17) }); }); var mCSB_buttonLeft_stop = function (e) { e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollLeft")); } mCSB_buttonLeft.bind("mouseup touchend MSPointerUp mouseout MSPointerOut", mCSB_buttonLeft_stop); $this.data({"bindEvent_buttonsContinuous_x": true}); } } else { mCSB_buttonDown.add(mCSB_buttonUp).unbind("click"); $this.data({"bindEvent_buttonsPixels_y": false}); if (!$this.data("bindEvent_buttonsContinuous_y")) { /*scroll down*/ mCSB_buttonDown.bind("mousedown touchstart MSPointerDown", function (e) { e.preventDefault(); var scrollButtonsSpeed = ScrollButtonsSpeed(); $this.data({ "mCSB_buttonScrollDown": setInterval(function () { $this.mCustomScrollbar("scrollTo", Math.abs(mCSB_container.position().top) + scrollButtonsSpeed, { trigger: "internal", scrollEasing: "easeOutCirc" }); }, 17) }); }); var mCSB_buttonDown_stop = function (e) { e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollDown")); } mCSB_buttonDown.bind("mouseup touchend MSPointerUp mouseout MSPointerOut", mCSB_buttonDown_stop); /*scroll up*/ mCSB_buttonUp.bind("mousedown touchstart MSPointerDown", function (e) { e.preventDefault(); var scrollButtonsSpeed = ScrollButtonsSpeed(); $this.data({ "mCSB_buttonScrollUp": setInterval(function () { $this.mCustomScrollbar("scrollTo", Math.abs(mCSB_container.position().top) - scrollButtonsSpeed, { trigger: "internal", scrollEasing: "easeOutCirc" }); }, 17) }); }); var mCSB_buttonUp_stop = function (e) { e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollUp")); } mCSB_buttonUp.bind("mouseup touchend MSPointerUp mouseout MSPointerOut", mCSB_buttonUp_stop); $this.data({"bindEvent_buttonsContinuous_y": true}); } } function ScrollButtonsSpeed() { var speed = $this.data("scrollButtons_scrollSpeed"); if ($this.data("scrollButtons_scrollSpeed") === "auto") { speed = Math.round(($this.data("scrollInertia") + 100) / 40); } return speed; } } } /*scrolling on element focus (e.g. via TAB key)*/ if ($this.data("autoScrollOnFocus")) { if (!$this.data("bindEvent_focusin")) { mCustomScrollBox.bind("focusin", function () { mCustomScrollBox.scrollTop(0).scrollLeft(0); var focusedElem = $(document.activeElement); if (focusedElem.is("input,textarea,select,button,a[tabindex],area,object")) { var mCSB_containerPos = mCSB_container.position().top, focusedElemPos = focusedElem.position().top, visibleLimit = mCustomScrollBox.height() - focusedElem.outerHeight(); if ($this.data("horizontalScroll")) { mCSB_containerPos = mCSB_container.position().left; focusedElemPos = focusedElem.position().left; visibleLimit = mCustomScrollBox.width() - focusedElem.outerWidth(); } if (mCSB_containerPos + focusedElemPos < 0 || mCSB_containerPos + focusedElemPos > visibleLimit) { $this.mCustomScrollbar("scrollTo", focusedElemPos, {trigger: "internal"}); } } }); $this.data({"bindEvent_focusin": true}); } } /*auto-hide scrollbar*/ if ($this.data("autoHideScrollbar")) { if (!$this.data("bindEvent_autoHideScrollbar")) { mCustomScrollBox.bind("mouseenter", function (e) { mCustomScrollBox.addClass("mCS-mouse-over"); functions.showScrollbar.call(mCustomScrollBox.children(".mCSB_scrollTools")); }).bind("mouseleave touchend", function (e) { mCustomScrollBox.removeClass("mCS-mouse-over"); if (e.type === "mouseleave") { functions.hideScrollbar.call(mCustomScrollBox.children(".mCSB_scrollTools")); } }); $this.data({"bindEvent_autoHideScrollbar": true}); } } }, scrollTo: function (scrollTo, options) { var $this = $(this), defaults = { moveDragger: false, trigger: "external", callbacks: true, scrollInertia: $this.data("scrollInertia"), scrollEasing: $this.data("scrollEasing") }, options = $.extend(defaults, options), draggerScrollTo, mCustomScrollBox = $this.children(".mCustomScrollBox"), mCSB_container = mCustomScrollBox.children(".mCSB_container"), mCSB_scrollTools = mCustomScrollBox.children(".mCSB_scrollTools"), mCSB_draggerContainer = mCSB_scrollTools.children(".mCSB_draggerContainer"), mCSB_dragger = mCSB_draggerContainer.children(".mCSB_dragger"), contentSpeed = draggerSpeed = options.scrollInertia, scrollBeginning, scrollBeginningOffset, totalScroll, totalScrollOffset; if (!mCSB_container.hasClass("mCS_no_scrollbar")) { $this.data({"mCS_trigger": options.trigger}); if ($this.data("mCS_Init")) { options.callbacks = false; } if (scrollTo || scrollTo === 0) { if (typeof(scrollTo) === "number") { /*if integer, scroll by number of pixels*/ if (options.moveDragger) { /*scroll dragger*/ draggerScrollTo = scrollTo; if ($this.data("horizontalScroll")) { scrollTo = mCSB_dragger.position().left * $this.data("scrollAmount"); } else { scrollTo = mCSB_dragger.position().top * $this.data("scrollAmount"); } draggerSpeed = 0; } else { /*scroll content by default*/ draggerScrollTo = scrollTo / $this.data("scrollAmount"); } } else if (typeof(scrollTo) === "string") { /*if string, scroll by element position*/ var target; if (scrollTo === "top") { /*scroll to top*/ target = 0; } else if (scrollTo === "bottom" && !$this.data("horizontalScroll")) { /*scroll to bottom*/ target = mCSB_container.outerHeight() - mCustomScrollBox.height(); } else if (scrollTo === "left") { /*scroll to left*/ target = 0; } else if (scrollTo === "right" && $this.data("horizontalScroll")) { /*scroll to right*/ target = mCSB_container.outerWidth() - mCustomScrollBox.width(); } else if (scrollTo === "first") { /*scroll to first element position*/ target = $this.find(".mCSB_container").find(":first"); } else if (scrollTo === "last") { /*scroll to last element position*/ target = $this.find(".mCSB_container").find(":last"); } else { /*scroll to element position*/ target = $this.find(scrollTo); } if (target.length === 1) { /*if such unique element exists, scroll to it*/ if ($this.data("horizontalScroll")) { scrollTo = target.position().left; } else { scrollTo = target.position().top; } draggerScrollTo = scrollTo / $this.data("scrollAmount"); } else { draggerScrollTo = scrollTo = target; } } /*scroll to*/ if ($this.data("horizontalScroll")) { if ($this.data("onTotalScrollBack_Offset")) { /*scroll beginning offset*/ scrollBeginningOffset = -$this.data("onTotalScrollBack_Offset"); } if ($this.data("onTotalScroll_Offset")) { /*total scroll offset*/ totalScrollOffset = mCustomScrollBox.width() - mCSB_container.outerWidth() + $this.data("onTotalScroll_Offset"); } if (draggerScrollTo < 0) { /*scroll start position*/ draggerScrollTo = scrollTo = 0; clearInterval($this.data("mCSB_buttonScrollLeft")); if (!scrollBeginningOffset) { scrollBeginning = true; } } else if (draggerScrollTo >= mCSB_draggerContainer.width() - mCSB_dragger.width()) { /*scroll end position*/ draggerScrollTo = mCSB_draggerContainer.width() - mCSB_dragger.width(); scrollTo = mCustomScrollBox.width() - mCSB_container.outerWidth(); clearInterval($this.data("mCSB_buttonScrollRight")); if (!totalScrollOffset) { totalScroll = true; } } else { scrollTo = -scrollTo; } var snapAmount = $this.data("snapAmount"); if (snapAmount) { scrollTo = Math.round(scrollTo / snapAmount) * snapAmount - $this.data("snapOffset"); } /*scrolling animation*/ functions.mTweenAxis.call(this, mCSB_dragger[0], "left", Math.round(draggerScrollTo), draggerSpeed, options.scrollEasing); functions.mTweenAxis.call(this, mCSB_container[0], "left", Math.round(scrollTo), contentSpeed, options.scrollEasing, { onStart: function () { if (options.callbacks && !$this.data("mCS_tweenRunning")) { callbacks("onScrollStart"); } if ($this.data("autoHideScrollbar")) { functions.showScrollbar.call(mCSB_scrollTools); } }, onUpdate: function () { if (options.callbacks) { callbacks("whileScrolling"); } }, onComplete: function () { if (options.callbacks) { callbacks("onScroll"); if (scrollBeginning || (scrollBeginningOffset && mCSB_container.position().left >= scrollBeginningOffset)) { callbacks("onTotalScrollBack"); } if (totalScroll || (totalScrollOffset && mCSB_container.position().left <= totalScrollOffset)) { callbacks("onTotalScroll"); } } mCSB_dragger.data("preventAction", false); $this.data("mCS_tweenRunning", false); if ($this.data("autoHideScrollbar")) { if (!mCustomScrollBox.hasClass("mCS-mouse-over")) { functions.hideScrollbar.call(mCSB_scrollTools); } } } }); } else { if ($this.data("onTotalScrollBack_Offset")) { /*scroll beginning offset*/ scrollBeginningOffset = -$this.data("onTotalScrollBack_Offset"); } if ($this.data("onTotalScroll_Offset")) { /*total scroll offset*/ totalScrollOffset = mCustomScrollBox.height() - mCSB_container.outerHeight() + $this.data("onTotalScroll_Offset"); } if (draggerScrollTo < 0) { /*scroll start position*/ draggerScrollTo = scrollTo = 0; clearInterval($this.data("mCSB_buttonScrollUp")); if (!scrollBeginningOffset) { scrollBeginning = true; } } else if (draggerScrollTo >= mCSB_draggerContainer.height() - mCSB_dragger.height()) { /*scroll end position*/ draggerScrollTo = mCSB_draggerContainer.height() - mCSB_dragger.height(); scrollTo = mCustomScrollBox.height() - mCSB_container.outerHeight(); clearInterval($this.data("mCSB_buttonScrollDown")); if (!totalScrollOffset) { totalScroll = true; } } else { scrollTo = -scrollTo; } var snapAmount = $this.data("snapAmount"); if (snapAmount) { scrollTo = Math.round(scrollTo / snapAmount) * snapAmount - $this.data("snapOffset"); } /*scrolling animation*/ functions.mTweenAxis.call(this, mCSB_dragger[0], "top", Math.round(draggerScrollTo), draggerSpeed, options.scrollEasing); functions.mTweenAxis.call(this, mCSB_container[0], "top", Math.round(scrollTo), contentSpeed, options.scrollEasing, { onStart: function () { if (options.callbacks && !$this.data("mCS_tweenRunning")) { callbacks("onScrollStart"); } if ($this.data("autoHideScrollbar")) { functions.showScrollbar.call(mCSB_scrollTools); } }, onUpdate: function () { if (options.callbacks) { callbacks("whileScrolling"); } }, onComplete: function () { if (options.callbacks) { callbacks("onScroll"); if (scrollBeginning || (scrollBeginningOffset && mCSB_container.position().top >= scrollBeginningOffset)) { callbacks("onTotalScrollBack"); } if (totalScroll || (totalScrollOffset && mCSB_container.position().top <= totalScrollOffset)) { callbacks("onTotalScroll"); } } mCSB_dragger.data("preventAction", false); $this.data("mCS_tweenRunning", false); if ($this.data("autoHideScrollbar")) { if (!mCustomScrollBox.hasClass("mCS-mouse-over")) { functions.hideScrollbar.call(mCSB_scrollTools); } } } }); } if ($this.data("mCS_Init")) { $this.data({"mCS_Init": false}); } } } /*callbacks*/ function callbacks(cb) { this.mcs = { top: mCSB_container.position().top, left: mCSB_container.position().left, draggerTop: mCSB_dragger.position().top, draggerLeft: mCSB_dragger.position().left, topPct: Math.round((100 * Math.abs(mCSB_container.position().top)) / Math.abs(mCSB_container.outerHeight() - mCustomScrollBox.height())), leftPct: Math.round((100 * Math.abs(mCSB_container.position().left)) / Math.abs(mCSB_container.outerWidth() - mCustomScrollBox.width())) }; switch (cb) { /*start scrolling callback*/ case "onScrollStart": $this.data("mCS_tweenRunning", true).data("onScrollStart_Callback").call($this, this.mcs); break; case "whileScrolling": $this.data("whileScrolling_Callback").call($this, this.mcs); break; case "onScroll": $this.data("onScroll_Callback").call($this, this.mcs); break; case "onTotalScrollBack": $this.data("onTotalScrollBack_Callback").call($this, this.mcs); break; case "onTotalScroll": $this.data("onTotalScroll_Callback").call($this, this.mcs); break; } } }, stop: function () { var $this = $(this), mCSB_container = $this.children().children(".mCSB_container"), mCSB_dragger = $this.children().children().children().children(".mCSB_dragger"); functions.mTweenAxisStop.call(this, mCSB_container[0]); functions.mTweenAxisStop.call(this, mCSB_dragger[0]); }, disable: function (resetScroll) { var $this = $(this), mCustomScrollBox = $this.children(".mCustomScrollBox"), mCSB_container = mCustomScrollBox.children(".mCSB_container"), mCSB_scrollTools = mCustomScrollBox.children(".mCSB_scrollTools"), mCSB_dragger = mCSB_scrollTools.children().children(".mCSB_dragger"); mCustomScrollBox.unbind("mousewheel focusin mouseenter mouseleave touchend"); mCSB_container.unbind("touchstart touchmove") if (resetScroll) { if ($this.data("horizontalScroll")) { mCSB_dragger.add(mCSB_container).css("left", 0); } else { mCSB_dragger.add(mCSB_container).css("top", 0); } } mCSB_scrollTools.css("display", "none"); mCSB_container.addClass("mCS_no_scrollbar"); $this.data({ "bindEvent_mousewheel": false, "bindEvent_focusin": false, "bindEvent_content_touch": false, "bindEvent_autoHideScrollbar": false }).addClass("mCS_disabled"); }, destroy: function () { var $this = $(this); $this.removeClass("mCustomScrollbar _mCS_" + $this.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove(); $(document).unbind("mousemove." + $this.data("mCustomScrollbarIndex") + " mouseup." + $this.data("mCustomScrollbarIndex") + " MSPointerMove." + $this.data("mCustomScrollbarIndex") + " MSPointerUp." + $this.data("mCustomScrollbarIndex")); $(window).unbind("resize." + $this.data("mCustomScrollbarIndex")); } }, functions = { /*hide/show scrollbar*/ showScrollbar: function () { this.stop().animate({opacity: 1}, "fast"); }, hideScrollbar: function () { this.stop().animate({opacity: 0}, "fast"); }, /*js animation tween*/ mTweenAxis: function (el, prop, to, duration, easing, callbacks) { var callbacks = callbacks || {}, onStart = callbacks.onStart || function () { }, onUpdate = callbacks.onUpdate || function () { }, onComplete = callbacks.onComplete || function () { }; var startTime = _getTime(), _delay, progress = 0, from = el.offsetTop, elStyle = el.style; if (prop === "left") { from = el.offsetLeft; } var diff = to - from; _cancelTween(); _startTween(); function _getTime() { if (window.performance && window.performance.now) { return window.performance.now(); } else { if (window.performance && window.performance.webkitNow) { return window.performance.webkitNow(); } else { if (Date.now) { return Date.now(); } else { return new Date().getTime(); } } } } function _step() { if (!progress) { onStart.call(); } progress = _getTime() - startTime; _tween(); if (progress >= el._time) { el._time = (progress > el._time) ? progress + _delay - (progress - el._time) : progress + _delay - 1; if (el._time < progress + 1) { el._time = progress + 1; } } if (el._time < duration) { el._id = _request(_step); } else { onComplete.call(); } } function _tween() { if (duration > 0) { el.currVal = _ease(el._time, from, diff, duration, easing); elStyle[prop] = Math.round(el.currVal) + "px"; } else { elStyle[prop] = to + "px"; } onUpdate.call(); } function _startTween() { _delay = 1000 / 60; el._time = progress + _delay; _request = (!window.requestAnimationFrame) ? function (f) { _tween(); return setTimeout(f, 0.01); } : window.requestAnimationFrame; el._id = _request(_step); } function _cancelTween() { if (el._id == null) { return; } if (!window.requestAnimationFrame) { clearTimeout(el._id); } else { window.cancelAnimationFrame(el._id); } el._id = null; } function _ease(t, b, c, d, type) { switch (type) { case "linear": return c * t / d + b; break; case "easeOutQuad": t /= d; return -c * t * (t - 2) + b; break; case "easeInOutQuad": t /= d / 2; if (t < 1) return c / 2 * t * t + b; t--; return -c / 2 * (t * (t - 2) - 1) + b; break; case "easeOutCubic": t /= d; t--; return c * (t * t * t + 1) + b; break; case "easeOutQuart": t /= d; t--; return -c * (t * t * t * t - 1) + b; break; case "easeOutQuint": t /= d; t--; return c * (t * t * t * t * t + 1) + b; break; case "easeOutCirc": t /= d; t--; return c * Math.sqrt(1 - t * t) + b; break; case "easeOutSine": return c * Math.sin(t / d * (Math.PI / 2)) + b; break; case "easeOutExpo": return c * ( -Math.pow(2, -10 * t / d) + 1 ) + b; break; case "mcsEaseOut": var ts = (t /= d) * t, tc = ts * t; return b + c * (0.499999999999997 * tc * ts + -2.5 * ts * ts + 5.5 * tc + -6.5 * ts + 4 * t); break; case "draggerRailEase": t /= d / 2; if (t < 1) return c / 2 * t * t * t + b; t -= 2; return c / 2 * (t * t * t + 2) + b; break; } } }, /*stop js animation tweens*/ mTweenAxisStop: function (el) { if (el._id == null) { return; } if (!window.requestAnimationFrame) { clearTimeout(el._id); } else { window.cancelAnimationFrame(el._id); } el._id = null; }, /*detect requestAnimationFrame and polyfill*/ rafPolyfill: function () { var pfx = ["ms", "moz", "webkit", "o"], i = pfx.length; while (--i > -1 && !window.requestAnimationFrame) { window.requestAnimationFrame = window[pfx[i] + "RequestAnimationFrame"]; window.cancelAnimationFrame = window[pfx[i] + "CancelAnimationFrame"] || window[pfx[i] + "CancelRequestAnimationFrame"]; } } } /*detect features*/ functions.rafPolyfill.call(); /*requestAnimationFrame*/ $.support.touch = !!('ontouchstart' in window); /*touch*/ $.support.msPointer = window.navigator.msPointerEnabled; /*MSPointer support*/ /*plugin dependencies*/ var _dlp = ("https:" == document.location.protocol) ? "https:" : "http:"; $.event.special.mousewheel || document.write('