/* * jQuery FlexSlider v2.5.0 * Copyright 2012 WooThemes * Contributing Author: Tyler Smith */ ; (function (n) { n.flexslider = function (t, i) { var r = n(t); r.vars = n.extend({}, n.flexslider.defaults, i); var f = r.vars.namespace, v = window.navigator && window.navigator.msPointerEnabled && window.MSGesture, y = ("ontouchstart" in window || v || window.DocumentTouch && document instanceof DocumentTouch) && r.vars.touch, a = "click touchend MSPointerUp keyup", s = "", p, h = r.vars.direction === "vertical", o = r.vars.reverse, e = r.vars.itemWidth > 0, c = r.vars.animation === "fade", l = r.vars.asNavFor !== "", u = {}, w = !0; n.data(t, "flexslider", r); u = { init: function () { r.animating = !1; r.currentSlide = parseInt(r.vars.startAt ? r.vars.startAt : 0, 10); isNaN(r.currentSlide) && (r.currentSlide = 0); r.animatingTo = r.currentSlide; r.atEnd = r.currentSlide === 0 || r.currentSlide === r.last; r.containerSelector = r.vars.selector.substr(0, r.vars.selector.search(" ")); r.slides = n(r.vars.selector, r); r.container = n(r.containerSelector, r); r.count = r.slides.length; r.syncExists = n(r.vars.sync).length > 0; r.vars.animation === "slide" && (r.vars.animation = "swing"); r.prop = h ? "top" : "marginLeft"; r.args = {}; r.manualPause = !1; r.stopped = !1; r.started = !1; r.startTimeout = null; r.transitions = !r.vars.video && !c && r.vars.useCSS && function () { var i = document.createElement("div"), n = ["perspectiveProperty", "WebkitPerspective", "MozPerspective", "OPerspective", "msPerspective"]; for (var t in n) if (i.style[n[t]] !== undefined) return r.pfx = n[t].replace("Perspective", "").toLowerCase(), r.prop = "-" + r.pfx + "-transform", !0; return !1 }(); r.ensureAnimationEnd = ""; r.vars.controlsContainer !== "" && (r.controlsContainer = n(r.vars.controlsContainer).length > 0 && n(r.vars.controlsContainer)); r.vars.manualControls !== "" && (r.manualControls = n(r.vars.manualControls).length > 0 && n(r.vars.manualControls)); r.vars.customDirectionNav !== "" && (r.customDirectionNav = n(r.vars.customDirectionNav).length === 2 && n(r.vars.customDirectionNav)); r.vars.randomize && (r.slides.sort(function () { return Math.round(Math.random()) - .5 }), r.container.empty().append(r.slides)); r.doMath(); r.setup("init"); r.vars.controlNav && u.controlNav.setup(); r.vars.directionNav && u.directionNav.setup(); r.vars.keyboard && (n(r.containerSelector).length === 1 || r.vars.multipleKeyboard) && n(document).bind("keyup", function (n) { var t = n.keyCode, i; r.animating || t !== 39 && t !== 37 || (i = t === 39 ? r.getTarget("next") : t === 37 ? r.getTarget("prev") : !1, r.flexAnimate(i, r.vars.pauseOnAction)) }); r.vars.mousewheel && r.bind("mousewheel", function (n, t) { n.preventDefault(); var i = t < 0 ? r.getTarget("next") : r.getTarget("prev"); r.flexAnimate(i, r.vars.pauseOnAction) }); r.vars.pausePlay && u.pausePlay.setup(); r.vars.slideshow && r.vars.pauseInvisible && u.pauseInvisible.init(); r.vars.slideshow && (r.vars.pauseOnHover && r.hover(function () { r.manualPlay || r.manualPause || r.pause() }, function () { r.manualPause || r.manualPlay || r.stopped || r.play() }), r.vars.pauseInvisible && u.pauseInvisible.isHidden() || (r.vars.initDelay > 0 ? r.startTimeout = setTimeout(r.play, r.vars.initDelay) : r.play())); l && u.asNav.setup(); y && r.vars.touch && u.touch(); (!c || c && r.vars.smoothHeight) && n(window).bind("resize orientationchange focus", u.resize); r.find("img").attr("draggable", "false"); setTimeout(function () { r.vars.start(r) }, 200) }, asNav: { setup: function () { if (r.asNav = !0, r.animatingTo = Math.floor(r.currentSlide / r.move), r.currentItem = r.currentSlide, r.slides.removeClass(f + "active-slide").eq(r.currentItem).addClass(f + "active-slide"), v) t._slider = r, r.slides.each(function () { var t = this; t._gesture = new MSGesture; t._gesture.target = t; t.addEventListener("MSPointerDown", function (n) { n.preventDefault(); n.currentTarget._gesture && n.currentTarget._gesture.addPointer(n.pointerId) }, !1); t.addEventListener("MSGestureTap", function (t) { t.preventDefault(); var i = n(this), u = i.index(); n(r.vars.asNavFor).data("flexslider").animating || i.hasClass("active") || (r.direction = r.currentItem < u ? "next" : "prev", r.flexAnimate(u, r.vars.pauseOnAction, !1, !0, !0)) }) }); else r.slides.on(a, function (t) { t.preventDefault(); var i = n(this), u = i.index(), e = i.offset().left - n(r).scrollLeft(); e <= 0 && i.hasClass(f + "active-slide") ? r.flexAnimate(r.getTarget("prev"), !0) : n(r.vars.asNavFor).data("flexslider").animating || i.hasClass(f + "active-slide") || (r.direction = r.currentItem < u ? "next" : "prev", r.flexAnimate(u, r.vars.pauseOnAction, !1, !0, !0)) }) } }, controlNav: { setup: function () { r.manualControls ? u.controlNav.setupManual() : u.controlNav.setupPaging() }, setupPaging: function () { var c = r.vars.controlNav === "thumbnails" ? "control-thumbs" : "control-paging", h = 1, e, o, t, i; if (r.controlNavScaffold = n('
    <\/ol>'), r.pagingCount > 1) for (t = 0; t < r.pagingCount; t++) o = r.slides.eq(t), e = r.vars.controlNav === "thumbnails" ? '' : "" + h + "<\/a>", "thumbnails" === r.vars.controlNav && !0 === r.vars.thumbCaptions && (i = o.attr("data-thumbcaption"), "" !== i && undefined !== i && (e += '' + i + "<\/span>")), r.controlNavScaffold.append("
  1. " + e + "<\/li>"), h++; r.controlsContainer ? n(r.controlsContainer).append(r.controlNavScaffold) : r.append(r.controlNavScaffold); u.controlNav.set(); u.controlNav.active(); r.controlNavScaffold.delegate("a, img", a, function (t) { if (t.preventDefault(), s === "" || s === t.type) { var i = n(this), e = r.controlNav.index(i); i.hasClass(f + "active") || (r.direction = e > r.currentSlide ? "next" : "prev", r.flexAnimate(e, r.vars.pauseOnAction)) } s === "" && (s = t.type); u.setToClearWatchedEvent() }) }, setupManual: function () { r.controlNav = r.manualControls; u.controlNav.active(); r.controlNav.bind(a, function (t) { if (t.preventDefault(), s === "" || s === t.type) { var i = n(this), e = r.controlNav.index(i); i.hasClass(f + "active") || (r.direction = e > r.currentSlide ? "next" : "prev", r.flexAnimate(e, r.vars.pauseOnAction)) } s === "" && (s = t.type); u.setToClearWatchedEvent() }) }, set: function () { var t = r.vars.controlNav === "thumbnails" ? "img" : "a"; r.controlNav = n("." + f + "control-nav li " + t, r.controlsContainer ? r.controlsContainer : r) }, active: function () { r.controlNav.removeClass(f + "active").eq(r.animatingTo).addClass(f + "active") }, update: function (t, i) { r.pagingCount > 1 && t === "add" ? r.controlNavScaffold.append(n("
  2. " + r.count + "<\/a><\/li>")) : r.pagingCount === 1 ? r.controlNavScaffold.find("li").remove() : r.controlNav.eq(i).closest("li").remove(); u.controlNav.set(); r.pagingCount > 1 && r.pagingCount !== r.controlNav.length ? r.update(i, t) : u.controlNav.active() } }, directionNav: { setup: function () { var t = n('