/*
* jquery flexslider v2.2.2
* copyright 2012 woothemes
* contributing author: tyler smith
*/
(function (e) {
e.flexslider = function (t, n) {
var r = e(t);
r.vars = e.extend({}, e.flexslider.defaults, n);
var i = r.vars.namespace, s = window.navigator && window.navigator.mspointerenabled && window.msgesture, o = ("ontouchstart"in window || s || window.documenttouch && document instanceof documenttouch) && r.vars.touch, u = "click touchend mspointerup", a = "", f, l = r.vars.direction === "vertical", c = r.vars.reverse, h = r.vars.itemwidth > 0, p = r.vars.animation === "fade", d = r.vars.asnavfor !== "", v = {}, m = !0;
e.data(t, "flexslider", r);
v = {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 = e(r.vars.selector, r);
r.container = e(r.containerselector, r);
r.count = r.slides.length;
r.syncexists = e(r.vars.sync).length > 0;
r.vars.animation === "slide" && (r.vars.animation = "swing");
r.prop = l ? "top" : "marginleft";
r.args = {};
r.manualpause = !1;
r.stopped = !1;
r.started = !1;
r.starttimeout = null;
r.transitions = !r.vars.video && !p && r.vars.usecss && function () {
var e = document.createelement("div"), t = ["perspectiveproperty", "webkitperspective", "mozperspective", "operspective", "msperspective"];
for (var n in t) {
if (e.style[t[n]] !== undefined) {
r.pfx = t[n].replace("perspective", "").tolowercase();
r.prop = "-" + r.pfx + "-transform";
return!0
}
}
return!1
}();
r.vars.controlscontainer !== "" && (r.controlscontainer = e(r.vars.controlscontainer).length > 0 && e(r.vars.controlscontainer));
r.vars.manualcontrols !== "" && (r.manualcontrols = e(r.vars.manualcontrols).length > 0 && e(r.vars.manualcontrols));
if (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 && v.controlnav.setup();
r.vars.directionnav && v.directionnav.setup();
r.vars.keyboard && (e(r.containerselector).length === 1 || r.vars.multiplekeyboard) && e(document).bind("keyup", function (e) {
var t = e.keycode;
if (!r.animating && (t === 39 || t === 37)) {
var n = t === 39 ? r.gettarget("next") : t === 37 ? r.gettarget("prev") : !1;
r.flexanimate(n, r.vars.pauseonaction)
}
});
r.vars.mousewheel && r.bind("mousewheel", function (e, t, n, i) {
e.preventdefault();
var s = t < 0 ? r.gettarget("next") : r.gettarget("prev");
r.flexanimate(s, r.vars.pauseonaction)
});
r.vars.pauseplay && v.pauseplay.setup();
r.vars.slideshow && r.vars.pauseinvisible && v.pauseinvisible.init();
if (r.vars.slideshow) {
r.vars.pauseonhover && r.hover(function () {
!r.manualplay && !r.manualpause && r.pause()
}, function () {
!r.manualpause && !r.manualplay && !r.stopped && r.play()
});
if (!r.vars.pauseinvisible || !v.pauseinvisible.ishidden()) {
r.vars.initdelay > 0 ? r.starttimeout = settimeout(r.play, r.vars.initdelay) : r.play()
}
}
d && v.asnav.setup();
o && r.vars.touch && v.touch();
(!p || p && r.vars.smoothheight) && e(window).bind("resize orientationchange focus", v.resize);
r.find("img").attr("draggable", "false");
settimeout(function () {
r.vars.start(r)
}, 200)
}, asnav: {setup: function () {
r.asnav = !0;
r.animatingto = math.floor(r.currentslide / r.move);
r.currentitem = r.currentslide;
r.slides.removeclass(i + "active-slide").eq(r.currentitem).addclass(i + "active-slide");
if (!s) {
r.slides.on(u, function (t) {
t.preventdefault();
var n = e(this), s = n.index(), o = n.offset().left - e(r).scrollleft();
if (o <= 0 && n.hasclass(i + "active-slide")) {
r.flexanimate(r.gettarget("prev"), !0);
} else if (!e(r.vars.asnavfor).data("flexslider").animating && !n.hasclass(i + "active-slide")) {
r.direction = r.currentitem < s ? "next" : "prev";
r.flexanimate(s, r.vars.pauseonaction, !1, !0, !0)
}
});
} else {
t._slider = r;
r.slides.each(function () {
var t = this;
t._gesture = new msgesture;
t._gesture.target = t;
t.addeventlistener("mspointerdown", function (e) {
e.preventdefault();
e.currenttarget._gesture && e.currenttarget._gesture.addpointer(e.pointerid)
}, !1);
t.addeventlistener("msgesturetap", function (t) {
t.preventdefault();
var n = e(this), i = n.index();
if (!e(r.vars.asnavfor).data("flexslider").animating && !n.hasclass("active")) {
r.direction = r.currentitem < i ? "next" : "prev";
r.flexanimate(i, r.vars.pauseonaction, !1, !0, !0)
}
})
})
}
}}, controlnav: {setup: function () {
r.manualcontrols ? v.controlnav.setupmanual() : v.controlnav.setuppaging()
}, setuppaging: function () {
var t = r.vars.controlnav === "thumbnails" ? "control-thumbs" : "control-paging", n = 1, s, o;
r.controlnavscaffold = e('
');
if (r.pagingcount > 1) {
for (var f = 0; f < r.pagingcount; f++) {
o = r.slides.eq(f);
s = r.vars.controlnav === "thumbnails" ? '' : "" + n + "";
if ("thumbnails" === r.vars.controlnav && !0 === r.vars.thumbcaptions) {
var l = o.attr("data-thumbcaption");
"" != l && undefined != l && (s += '' + l + "")
}
r.controlnavscaffold.append("" + s + "");
n++
}
}
r.controlscontainer ? e(r.controlscontainer).append(r.controlnavscaffold) : r.append(r.controlnavscaffold);
v.controlnav.set();
v.controlnav.active();
r.controlnavscaffold.delegate("a, img", u, function (t) {
t.preventdefault();
if (a === "" || a === t.type) {
var n = e(this), s = r.controlnav.index(n);
if (!n.hasclass(i + "active")) {
r.direction = s > r.currentslide ? "next" : "prev";
r.flexanimate(s, r.vars.pauseonaction)
}
}
a === "" && (a = t.type);
v.settoclearwatchedevent()
})
}, setupmanual: function () {
r.controlnav = r.manualcontrols;
v.controlnav.active();
r.controlnav.bind(u, function (t) {
t.preventdefault();
if (a === "" || a === t.type) {
var n = e(this), s = r.controlnav.index(n);
if (!n.hasclass(i + "active")) {
s > r.currentslide ? r.direction = "next" : r.direction = "prev";
r.flexanimate(s, r.vars.pauseonaction)
}
}
a === "" && (a = t.type);
v.settoclearwatchedevent()
})
}, set: function () {
var t = r.vars.controlnav === "thumbnails" ? "img" : "a";
r.controlnav = e("." + i + "control-nav li " + t, r.controlscontainer ? r.controlscontainer : r)
}, active: function () {
r.controlnav.removeclass(i + "active").eq(r.animatingto).addclass(i + "active")
}, update: function (t, n) {
r.pagingcount > 1 && t === "add" ? r.controlnavscaffold.append(e("" + r.count + "")) : r.pagingcount === 1 ? r.controlnavscaffold.find("li").remove() : r.controlnav.eq(n).closest("li").remove();
v.controlnav.set();
r.pagingcount > 1 && r.pagingcount !== r.controlnav.length ? r.update(n, t) : v.controlnav.active()
}}, directionnav: {setup: function () {
var t = e('");
if (r.controlscontainer) {
e(r.controlscontainer).append(t);
r.directionnav = e("." + i + "direction-nav li a", r.controlscontainer)
} else {
r.append(t);
r.directionnav = e("." + i + "direction-nav li a", r)
}
v.directionnav.update();
r.directionnav.bind(u, function (t) {
t.preventdefault();
var n;
if (a === "" || a === t.type) {
n = e(this).hasclass(i + "next") ? r.gettarget("next") : r.gettarget("prev");
r.flexanimate(n, r.vars.pauseonaction)
}
a === "" && (a = t.type);
v.settoclearwatchedevent()
})
}, update: function () {
var e = i + "disabled";
r.pagingcount === 1 ? r.directionnav.addclass(e).attr("tabindex", "-1") : r.vars.animationloop ? r.directionnav.removeclass(e).removeattr("tabindex") : r.animatingto === 0 ? r.directionnav.removeclass(e).filter("." + i + "prev").addclass(e).attr("tabindex", "-1") : r.animatingto === r.last ? r.directionnav.removeclass(e).filter("." + i + "next").addclass(e).attr("tabindex", "-1") : r.directionnav.removeclass(e).removeattr("tabindex")
}}, pauseplay: {setup: function () {
var t = e('');
if (r.controlscontainer) {
r.controlscontainer.append(t);
r.pauseplay = e("." + i + "pauseplay a", r.controlscontainer)
} else {
r.append(t);
r.pauseplay = e("." + i + "pauseplay a", r)
}
v.pauseplay.update(r.vars.slideshow ? i + "pause" : i + "play");
r.pauseplay.bind(u, function (t) {
t.preventdefault();
if (a === "" || a === t.type) {
if (e(this).hasclass(i + "pause")) {
r.manualpause = !0;
r.manualplay = !1;
r.pause()
} else {
r.manualpause = !1;
r.manualplay = !0;
r.play()
}
}
a === "" && (a = t.type);
v.settoclearwatchedevent()
})
}, update: function (e) {
e === "play" ? r.pauseplay.removeclass(i + "pause").addclass(i + "play").html(r.vars.playtext) : r.pauseplay.removeclass(i + "play").addclass(i + "pause").html(r.vars.pausetext)
}}, touch: function () {
var e, n, i, o, u, a, f = !1, d = 0, v = 0, m = 0;
if (!s) {
t.addeventlistener("touchstart", g, !1);
function g(s) {
if (r.animating) {
s.preventdefault();
} else if (window.navigator.mspointerenabled || s.touches.length === 1) {
r.pause();
o = l ? r.h : r.w;
a = number(new date);
d = s.touches[0].pagex;
v = s.touches[0].pagey;
i = h && c && r.animatingto === r.last ? 0 : h && c ? r.limit - (r.itemw + r.vars.itemmargin) * r.move * r.animatingto : h && r.currentslide === r.last ? r.limit : h ? (r.itemw + r.vars.itemmargin) * r.move * r.currentslide : c ? (r.last - r.currentslide + r.cloneoffset) * o : (r.currentslide + r.cloneoffset) * o;
e = l ? v : d;
n = l ? d : v;
t.addeventlistener("touchmove", y, !1);
t.addeventlistener("touchend", b, !1)
}
}
function y(t) {
d = t.touches[0].pagex;
v = t.touches[0].pagey;
u = l ? e - v : e - d;
f = l ? math.abs(u) < math.abs(d - n) : math.abs(u) < math.abs(v - n);
var s = 500;
if (!f || number(new date) - a > s) {
t.preventdefault();
if (!p && r.transitions) {
r.vars.animationloop || (u /= r.currentslide === 0 && u < 0 || r.currentslide === r.last && u > 0 ? math.abs(u) / o + 2 : 1);
r.setprops(i + u, "settouch")
}
}
}
function b(s) {
t.removeeventlistener("touchmove", y, !1);
if (r.animatingto === r.currentslide && !f && u !== null) {
var l = c ? -u : u, h = l > 0 ? r.gettarget("next") : r.gettarget("prev");
r.canadvance(h) && (number(new date) - a < 550 && math.abs(l) > 50 || math.abs(l) > o / 2) ? r.flexanimate(h, r.vars.pauseonaction) : p || r.flexanimate(r.currentslide, r.vars.pauseonaction, !0)
}
t.removeeventlistener("touchend", b, !1);
e = null;
n = null;
u = null;
i = null
}
} else {
t.style.mstouchaction = "none";
t._gesture = new msgesture;
t._gesture.target = t;
t.addeventlistener("mspointerdown", w, !1);
t._slider = r;
t.addeventlistener("msgesturechange", e, !1);
t.addeventlistener("msgestureend", s, !1);
function w(e) {
e.stoppropagation();
if (r.animating) {
e.preventdefault();
} else {
r.pause();
t._gesture.addpointer(e.pointerid);
m = 0;
o = l ? r.h : r.w;
a = number(new date);
i = h && c && r.animatingto === r.last ? 0 : h && c ? r.limit - (r.itemw + r.vars.itemmargin) * r.move * r.animatingto : h && r.currentslide === r.last ? r.limit : h ? (r.itemw + r.vars.itemmargin) * r.move * r.currentslide : c ? (r.last - r.currentslide + r.cloneoffset) * o : (r.currentslide + r.cloneoffset) * o
}
}
function e(e) {
e.stoppropagation();
var n = e.target._slider;
if (!n) {
return;
}
var r = -e.translationx, s = -e.translationy;
m += l ? s : r;
u = m;
f = l ? math.abs(m) < math.abs(-r) : math.abs(m) < math.abs(-s);
if (e.detail === e.msgesture_flag_inertia) {
setimmediate(function () {
t._gesture.stop()
});
return
}
if (!f || number(new date) - a > 500) {
e.preventdefault();
if (!p && n.transitions) {
n.vars.animationloop || (u = m / (n.currentslide === 0 && m < 0 || n.currentslide === n.last && m > 0 ? math.abs(m) / o + 2 : 1));
n.setprops(i + u, "settouch")
}
}
}
function s(t) {
t.stoppropagation();
var r = t.target._slider;
if (!r) {
return;
}
if (r.animatingto === r.currentslide && !f && u !== null) {
var s = c ? -u : u, l = s > 0 ? r.gettarget("next") : r.gettarget("prev");
r.canadvance(l) && (number(new date) - a < 550 && math.abs(s) > 50 || math.abs(s) > o / 2) ? r.flexanimate(l, r.vars.pauseonaction) : p || r.flexanimate(r.currentslide, r.vars.pauseonaction, !0)
}
e = null;
n = null;
u = null;
i = null;
m = 0
}
}
}, resize: function () {
if (!r.animating && r.is(":visible")) {
h || r.domath();
if (p) {
v.smoothheight();
} else if (h) {
r.slides.width(r.computedw);
r.update(r.pagingcount);
r.setprops()
} else if (l) {
r.viewport.height(r.h);
r.setprops(r.h, "settotal")
} else {
r.vars.smoothheight && v.smoothheight();
r.newslides.width(r.computedw);
r.setprops(r.computedw, "settotal")
}
}
}, smoothheight: function (e) {
if (!l || p) {
var t = p ? r : r.viewport;
e ? t.animate({height: r.slides.eq(r.animatingto).height()}, e) : t.height(r.slides.eq(r.animatingto).height())
}
}, sync: function (t) {
var n = e(r.vars.sync).data("flexslider"), i = r.animatingto;
switch (t) {
case"animate":
n.flexanimate(i, r.vars.pauseonaction, !1, !0);
break;
case"play":
!n.playing && !n.asnav && n.play();
break;
case"pause":
n.pause()
}
}, uniqueid: function (t) {
t.find("[id]").each(function () {
var t = e(this);
t.attr("id", t.attr("id") + "_clone")
});
return t
}, pauseinvisible: {visprop: null, init: function () {
var e = ["webkit", "moz", "ms", "o"];
if ("hidden"in document) {
return"hidden";
}
for (var t = 0; t < e.length; t++) {
e[t] + "hidden"in document && (v.pauseinvisible.visprop = e[t] + "hidden");
}
if (v.pauseinvisible.visprop) {
var n = v.pauseinvisible.visprop.replace(/[h|h]idden/, "") + "visibilitychange";
document.addeventlistener(n, function () {
v.pauseinvisible.ishidden() ? r.starttimeout ? cleartimeout(r.starttimeout) : r.pause() : r.started ? r.play() : r.vars.initdelay > 0 ? settimeout(r.play, r.vars.initdelay) : r.play()
})
}
}, ishidden: function () {
return document[v.pauseinvisible.visprop] || !1
}}, settoclearwatchedevent: function () {
cleartimeout(f);
f = settimeout(function () {
a = ""
}, 3e3)
}};
r.flexanimate = function (t, n, s, u, a) {
!r.vars.animationloop && t !== r.currentslide && (r.direction = t > r.currentslide ? "next" : "prev");
d && r.pagingcount === 1 && (r.direction = r.currentitem < t ? "next" : "prev");
if (!r.animating && (r.canadvance(t, a) || s) && r.is(":visible")) {
if (d && u) {
var f = e(r.vars.asnavfor).data("flexslider");
r.atend = t === 0 || t === r.count - 1;
f.flexanimate(t, !0, !1, !0, a);
r.direction = r.currentitem < t ? "next" : "prev";
f.direction = r.direction;
if (math.ceil((t + 1) / r.visible) - 1 === r.currentslide || t === 0) {
r.currentitem = t;
r.slides.removeclass(i + "active-slide").eq(t).addclass(i + "active-slide");
return!1
}
r.currentitem = t;
r.slides.removeclass(i + "active-slide").eq(t).addclass(i + "active-slide");
t = math.floor(t / r.visible)
}
r.animating = !0;
r.animatingto = t;
n && r.pause();
r.vars.before(r);
r.syncexists && !a && v.sync("animate");
r.vars.controlnav && v.controlnav.active();
h || r.slides.removeclass(i + "active-slide").eq(t).addclass(i + "active-slide");
r.atend = t === 0 || t === r.last;
r.vars.directionnav && v.directionnav.update();
if (t === r.last) {
r.vars.end(r);
r.vars.animationloop || r.pause()
}
if (!p) {
var m = l ? r.slides.filter(":first").height() : r.computedw, g, y, b;
if (h) {
g = r.vars.itemmargin;
b = (r.itemw + g) * r.move * r.animatingto;
y = b > r.limit && r.visible !== 1 ? r.limit : b
} else {
r.currentslide === 0 && t === r.count - 1 && r.vars.animationloop && r.direction !== "next" ? y = c ? (r.count + r.cloneoffset) * m : 0 : r.currentslide === r.last && t === 0 && r.vars.animationloop && r.direction !== "prev" ? y = c ? 0 : (r.count + 1) * m : y = c ? (r.count - 1 - t + r.cloneoffset) * m : (t + r.cloneoffset) * m;
}
r.setprops(y, "", r.vars.animationspeed);
if (r.transitions) {
if (!r.vars.animationloop || !r.atend) {
r.animating = !1;
r.currentslide = r.animatingto
}
r.container.unbind("webkittransitionend transitionend");
r.container.bind("webkittransitionend transitionend", function () {
r.wrapup(m)
})
} else {
r.container.animate(r.args, r.vars.animationspeed, r.vars.easing, function () {
r.wrapup(m)
})
}
} else if (!o) {
r.slides.eq(r.currentslide).css({zindex: 1}).animate({opacity: 0}, r.vars.animationspeed, r.vars.easing);
r.slides.eq(t).css({zindex: 2}).animate({opacity: 1}, r.vars.animationspeed, r.vars.easing, r.wrapup)
} else {
r.slides.eq(r.currentslide).css({opacity: 0, zindex: 1});
r.slides.eq(t).css({opacity: 1, zindex: 2});
r.wrapup(m)
}
r.vars.smoothheight && v.smoothheight(r.vars.animationspeed)
}
};
r.wrapup = function (e) {
!p && !h && (r.currentslide === 0 && r.animatingto === r.last && r.vars.animationloop ? r.setprops(e, "jumpend") : r.currentslide === r.last && r.animatingto === 0 && r.vars.animationloop && r.setprops(e, "jumpstart"));
r.animating = !1;
r.currentslide = r.animatingto;
r.vars.after(r)
};
r.animateslides = function () {
!r.animating && m && r.flexanimate(r.gettarget("next"))
};
r.pause = function () {
clearinterval(r.animatedslides);
r.animatedslides = null;
r.playing = !1;
r.vars.pauseplay && v.pauseplay.update("play");
r.syncexists && v.sync("pause")
};
r.play = function () {
r.playing && clearinterval(r.animatedslides);
r.animatedslides = r.animatedslides || setinterval(r.animateslides, r.vars.slideshowspeed);
r.started = r.playing = !0;
r.vars.pauseplay && v.pauseplay.update("pause");
r.syncexists && v.sync("play")
};
r.stop = function () {
r.pause();
r.stopped = !0
};
r.canadvance = function (e, t) {
var n = d ? r.pagingcount - 1 : r.last;
return t ? !0 : d && r.currentitem === r.count - 1 && e === 0 && r.direction === "prev" ? !0 : d && r.currentitem === 0 && e === r.pagingcount - 1 && r.direction !== "next" ? !1 : e === r.currentslide && !d ? !1 : r.vars.animationloop ? !0 : r.atend && r.currentslide === 0 && e === n && r.direction !== "next" ? !1 : r.atend && r.currentslide === n && e === 0 && r.direction === "next" ? !1 : !0
};
r.gettarget = function (e) {
r.direction = e;
return e === "next" ? r.currentslide === r.last ? 0 : r.currentslide + 1 : r.currentslide === 0 ? r.last : r.currentslide - 1
};
r.setprops = function (e, t, n) {
var i = function () {
var n = e ? e : (r.itemw + r.vars.itemmargin) * r.move * r.animatingto, i = function () {
if (h) {
return t === "settouch" ? e : c && r.animatingto === r.last ? 0 : c ? r.limit - (r.itemw + r.vars.itemmargin) * r.move * r.animatingto : r.animatingto === r.last ? r.limit : n;
}
switch (t) {
case"settotal":
return c ? (r.count - 1 - r.currentslide + r.cloneoffset) * e : (r.currentslide + r.cloneoffset) * e;
case"settouch":
return c ? e : e;
case"jumpend":
return c ? e : r.count * e;
case"jumpstart":
return c ? r.count * e : e;
default:
return e
}
}();
return i * -1 + "px"
}();
if (r.transitions) {
i = l ? "translate3d(0," + i + ",0)" : "translate3d(" + i + ",0,0)";
n = n !== undefined ? n / 1e3 + "s" : "0s";
r.container.css("-" + r.pfx + "-transition-duration", n);
r.container.css("transition-duration", n)
}
r.args[r.prop] = i;
(r.transitions || n === undefined) && r.container.css(r.args);
r.container.css("transform", i)
};
r.setup = function (t) {
if (!p) {
var n, s;
if (t === "init") {
r.viewport = e('').css({overflow: "hidden", position: "relative"}).appendto(r).append(r.container);
r.clonecount = 0;
r.cloneoffset = 0;
if (c) {
s = e.makearray(r.slides).reverse();
r.slides = e(s);
r.container.empty().append(r.slides)
}
}
if (r.vars.animationloop && !h) {
r.clonecount = 2;
r.cloneoffset = 1;
t !== "init" && r.container.find(".clone").remove();
r.container.append(r.slides.first().clone().addclass("clone").attr("aria-hidden", "true")).prepend(r.slides.last().clone().addclass("clone").attr("aria-hidden", "true"));
v.uniqueid(r.slides.first().clone().addclass("clone")).appendto(r.container);
v.uniqueid(r.slides.last().clone().addclass("clone")).prependto(r.container)
}
r.newslides = e(r.vars.selector, r);
n = c ? r.count - 1 - r.currentslide + r.cloneoffset : r.currentslide + r.cloneoffset;
if (l && !h) {
r.container.height((r.count + r.clonecount) * 200 + "%").css("position", "absolute").width("100%");
settimeout(function () {
r.newslides.css({display: "block"});
r.domath();
r.viewport.height(r.h);
r.setprops(n * r.h, "init")
}, t === "init" ? 100 : 0)
} else {
r.container.width((r.count + r.clonecount) * 200 + "%");
r.setprops(n * r.computedw, "init");
settimeout(function () {
r.domath();
r.newslides.css({width: r.computedw, "float": "left", display: "block"});
r.vars.smoothheight && v.smoothheight()
}, t === "init" ? 100 : 0)
}
} else {
r.slides.css({width: "100%", "float": "left", marginright: "-100%", position: "relative"});
t === "init" && (o ? r.slides.css({opacity: 0, display: "block", webkittransition: "opacity " + r.vars.animationspeed / 1e3 + "s ease", zindex: 1}).eq(r.currentslide).css({opacity: 1, zindex: 2}) : r.slides.css({opacity: 0, display: "block", zindex: 1}).eq(r.currentslide).css({zindex: 2}).animate({opacity: 1}, r.vars.animationspeed, r.vars.easing));
r.vars.smoothheight && v.smoothheight()
}
h || r.slides.removeclass(i + "active-slide").eq(r.currentslide).addclass(i + "active-slide");
r.vars.init(r)
};
r.domath = function () {
var e = r.slides.first(), t = r.vars.itemmargin, n = r.vars.minitems, i = r.vars.maxitems;
r.w = r.viewport === undefined ? r.width() : r.viewport.width();
r.h = e.height();
r.boxpadding = e.outerwidth() - e.width();
if (h) {
r.itemt = r.vars.itemwidth + t;
r.minw = n ? n * r.itemt : r.w;
r.maxw = i ? i * r.itemt - t : r.w;
r.itemw = r.minw > r.w ? (r.w - t * (n - 1)) / n : r.maxw < r.w ? (r.w - t * (i - 1)) / i : r.vars.itemwidth > r.w ? r.w : r.vars.itemwidth;
r.visible = math.floor(r.w / r.itemw);
r.move = r.vars.move > 0 && r.vars.move < r.visible ? r.vars.move : r.visible;
r.pagingcount = math.ceil((r.count - r.visible) / r.move + 1);
r.last = r.pagingcount - 1;
r.limit = r.pagingcount === 1 ? 0 : r.vars.itemwidth > r.w ? r.itemw * (r.count - 1) + t * (r.count - 1) : (r.itemw + t) * r.count - r.w - t
} else {
r.itemw = r.w;
r.pagingcount = r.count;
r.last = r.count - 1
}
r.computedw = r.itemw - r.boxpadding
};
r.update = function (e, t) {
r.domath();
if (!h) {
e < r.currentslide ? r.currentslide += 1 : e <= r.currentslide && e !== 0 && (r.currentslide -= 1);
r.animatingto = r.currentslide
}
if (r.vars.controlnav && !r.manualcontrols) {
if (t === "add" && !h || r.pagingcount > r.controlnav.length) {
v.controlnav.update("add");
} else if (t === "remove" && !h || r.pagingcount < r.controlnav.length) {
if (h && r.currentslide > r.last) {
r.currentslide -= 1;
r.animatingto -= 1
}
v.controlnav.update("remove", r.last)
}
}
r.vars.directionnav && v.directionnav.update()
};
r.addslide = function (t, n) {
var i = e(t);
r.count += 1;
r.last = r.count - 1;
l && c ? n !== undefined ? r.slides.eq(r.count - n).after(i) : r.container.prepend(i) : n !== undefined ? r.slides.eq(n).before(i) : r.container.append(i);
r.update(n, "add");
r.slides = e(r.vars.selector + ":not(.clone)", r);
r.setup();
r.vars.added(r)
};
r.removeslide = function (t) {
var n = isnan(t) ? r.slides.index(e(t)) : t;
r.count -= 1;
r.last = r.count - 1;
isnan(t) ? e(t, r.slides).remove() : l && c ? r.slides.eq(r.last).remove() : r.slides.eq(t).remove();
r.domath();
r.update(n, "remove");
r.slides = e(r.vars.selector + ":not(.clone)", r);
r.setup();
r.vars.removed(r)
};
v.init()
};
e(window).blur(function (e) {
focused = !1
}).focus(function (e) {
focused = !0
});
e.flexslider.defaults = {namespace: "flex-", selector: ".slides > li", animation: "fade", easing: "swing", direction: "horizontal", reverse: !1, animationloop: !0, smoothheight: !1, startat: 0, slideshow: !0, slideshowspeed: 7e3, animationspeed: 600, initdelay: 0, randomize: !1, thumbcaptions: !1, pauseonaction: !0, pauseonhover: !1, pauseinvisible: !0, usecss: !0, touch: !0, video: !1, controlnav: !0, directionnav: !0, prevtext: "previous", nexttext: "next", keyboard: !0, multiplekeyboard: !1, mousewheel: !1, pauseplay: !1, pausetext: "pause", playtext: "play", controlscontainer: "", manualcontrols: "", sync: "", asnavfor: "", itemwidth: 0, itemmargin: 0, minitems: 1, maxitems: 0, move: 0, allowoneslide: !0, start: function () {
}, before: function () {
}, after: function () {
}, end: function () {
}, added: function () {
}, removed: function () {
}, init: function () {
}};
e.fn.flexslider = function (t) {
t === undefined && (t = {});
if (typeof t == "object") {
return this.each(function () {
var n = e(this), r = t.selector ? t.selector : ".slides > li", i = n.find(r);
if (i.length === 1 && t.allowoneslide === !0 || i.length === 0) {
i.fadein(400);
t.start && t.start(n)
} else {
n.data("flexslider") === undefined && new e.flexslider(this, t)
}
});
}
var n = e(this).data("flexslider");
switch (t) {
case"play":
n.play();
break;
case"pause":
n.pause();
break;
case"stop":
n.stop();
break;
case"next":
n.flexanimate(n.gettarget("next"), !0);
break;
case"prev":
case"previous":
n.flexanimate(n.gettarget("prev"), !0);
break;
default:
typeof t == "number" && n.flexanimate(t, !0)
}
}
})(jquery);