﻿(function (a) { a.fn.Slider = function (d) { function f(c, d) { var e = a(c).find(b.content).size(), g; g = a(c).find(b.content).filter(".showing"); g = a(g).prevAll(b.content).size() + 1; var f = a(c).find(b.content).filter(".showing"); d == "next" && g < e ? (e = a(f).next(b.content), a(e).showContent(b)) : d == "prev" && g > 1 ? (e = a(f).prev(b.content), a(e).showContent(b)) : d == "nextloop" && (e = g == e ? a(b.content, c).filter(":first-child") : a(f).next(b.content), a(e).showContent(b)) } function e(c) { a(b.content, c).filter(":first-child").showContent(b, !0); b.autoSlider && a(b.content, c).size() > 1 && setInterval(function () { f(c, "nextloop") }, b.interval) } var b = a.extend({}, a.fn.Slider.Defaults, d); b.content = "." + b.content; b.nextButton = "." + b.nextButton; b.prevButton = "." + b.prevButton; b.indexNumber = "." + b.indexNumber; return this.each(function () { var c = this; e(c); a(c).find(b.nextButton).click(function () { a(c).find("*:animated").size() == 0 && f(c, "next") }); a(c).find(b.prevButton).click(function () { a(c).find("*:animated").size() == 0 && f(c, "prev") }) }) }; a.fn.showContent = function (d, f) { var e = a(this), b = a(e).parents(d.container); d.animation ? f ? (a(d.content, b).hide(), a(e).fadeIn("normal", function () { a(e).addClass("showing").show() })) : a(d.content, b).filter(":visible").fadeOut("normal", function () { a(this); a(this).removeClass("showing"); a(e).fadeIn("normal", function () { a(e).addClass("showing").show() }) }) : (a(d.content, b).hide().removeClass("showing"), a(e).addClass("showing").show()); var c = a(b).find(d.content).size(), h = a(e).prevAll(d.content).size() + 1; a(b).find(d.indexNumber).html(h + "-" + c); h == 1 ? a(b).find(d.prevButton).css({ cursor: "", opacity: 0.3 }) : a(b).find(d.prevButton).css({ cursor: "pointer", opacity: 1 }); h == c ? a(b).find(d.nextButton).css({ cursor: "", opacity: 0.3 }) : a(b).find(d.nextButton).css({ cursor: "pointer", opacity: 1 }); return this }; a.fn.Slider.Defaults = { container: "", content: "Slide", nextButton: "NextButton", prevButton: "PrevButton", indexNumber: "IndexNumber", animation: !1, autoSlider: !1, interval: 5E3} })(jQuery);
