// source --> https://pfotengefluester.de/wp-content/plugins/affiliate-toolkit-templatepack/dist/script.js?ver=6.9.4 
/* hover box */

var offsetx = 20;
var offsety = 0;

function hideAtkpBox(e, Inhalte) {
    document.getElementById('atkp-infobox').style.visibility = "hidden";
}

function isAtkpMobile() {
    var isMobile = false; //initiate as false
    // device detection
    if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)
        || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) {
        isMobile = true;
    }

    return isMobile;
}

function showAtkpBox(e, Inhalte, offsetX, offsetY) {

    if(isAtkpMobile()) {
        hideAtkpBox(e, Inhalte);
        return;
    }

    if (offsetX) {
        offsetx = offsetX;
    } else {
        offsetx = 20;
    }
    if (offsetY) {
        offsety = offsetY;
    } else {
        offsety = 0;
    }
    var PositionX = 0;
    var PositionY = 0;
    if (!e) var e = window.event;
    if (e.pageX || e.pageY) {
        PositionX = e.pageX;
        PositionY = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        PositionX = e.clientX + document.body.scrollLeft;
        PositionY = e.clientY + document.body.scrollTop;
    }
    document.getElementById("BoxInhalte").innerHTML = document.getElementById(Inhalte).innerHTML;
    document.getElementById('atkp-infobox').style.left = (PositionX + offsetx) + "px";
    document.getElementById('atkp-infobox').style.top = (PositionY + offsety) + "px";
    document.getElementById('atkp-infobox').style.visibility = "visible";

}



/*slider*/

/*! nouislider - 9.0.0 - 2016-09-29 21:44:02 */

!function (a) {
    "function" == typeof define && define.amd ? define([], a) : "object" == typeof exports ? module.exports = a() : window.atkpnoUiSlider = a()
}(function () {
    "use strict";

    function a(a, b) {
        var c = document.createElement("div");
        return j(c, b), a.appendChild(c), c
    }

    function b(a) {
        return a.filter(function (a) {
            return !this[a] && (this[a] = !0)
        }, {})
    }

    function c(a, b) {
        return Math.round(a / b) * b
    }

    function d(a, b) {
        var c = a.getBoundingClientRect(), d = a.ownerDocument, e = d.documentElement, f = m();
        return /webkit.*Chrome.*Mobile/i.test(navigator.userAgent) && (f.x = 0), b ? c.top + f.y - e.clientTop : c.left + f.x - e.clientLeft
    }

    function e(a) {
        return "number" == typeof a && !isNaN(a) && isFinite(a)
    }

    function f(a, b, c) {
        c > 0 && (j(a, b), setTimeout(function () {
            k(a, b)
        }, c))
    }

    function g(a) {
        return Math.max(Math.min(a, 100), 0)
    }

    function h(a) {
        return Array.isArray(a) ? a : [a]
    }

    function i(a) {
        a = String(a);
        var b = a.split(".");
        return b.length > 1 ? b[1].length : 0
    }

    function j(a, b) {
        a.classList ? a.classList.add(b) : a.className += " " + b
    }

    function k(a, b) {
        a.classList ? a.classList.remove(b) : a.className = a.className.replace(new RegExp("(^|\\b)" + b.split(" ").join("|") + "(\\b|$)", "gi"), " ")
    }

    function l(a, b) {
        return a.classList ? a.classList.contains(b) : new RegExp("\\b" + b + "\\b").test(a.className)
    }

    function m() {
        var a = void 0 !== window.pageXOffset, b = "CSS1Compat" === (document.compatMode || ""),
            c = a ? window.pageXOffset : b ? document.documentElement.scrollLeft : document.body.scrollLeft,
            d = a ? window.pageYOffset : b ? document.documentElement.scrollTop : document.body.scrollTop;
        return {x: c, y: d}
    }

    function n() {
        return window.navigator.pointerEnabled ? {
            start: "pointerdown",
            move: "pointermove",
            end: "pointerup"
        } : window.navigator.msPointerEnabled ? {
            start: "MSPointerDown",
            move: "MSPointerMove",
            end: "MSPointerUp"
        } : {start: "mousedown touchstart", move: "mousemove touchmove", end: "mouseup touchend"}
    }

    function o(a, b) {
        return 100 / (b - a)
    }

    function p(a, b) {
        return 100 * b / (a[1] - a[0])
    }

    function q(a, b) {
        return p(a, a[0] < 0 ? b + Math.abs(a[0]) : b - a[0])
    }

    function r(a, b) {
        return b * (a[1] - a[0]) / 100 + a[0]
    }

    function s(a, b) {
        for (var c = 1; a >= b[c];) c += 1;
        return c
    }

    function t(a, b, c) {
        if (c >= a.slice(-1)[0]) return 100;
        var d, e, f, g, h = s(c, a);
        return d = a[h - 1], e = a[h], f = b[h - 1], g = b[h], f + q([d, e], c) / o(f, g)
    }

    function u(a, b, c) {
        if (c >= 100) return a.slice(-1)[0];
        var d, e, f, g, h = s(c, b);
        return d = a[h - 1], e = a[h], f = b[h - 1], g = b[h], r([d, e], (c - f) * o(f, g))
    }

    function v(a, b, d, e) {
        if (100 === e) return e;
        var f, g, h = s(e, a);
        return d ? (f = a[h - 1], g = a[h], e - f > (g - f) / 2 ? g : f) : b[h - 1] ? a[h - 1] + c(e - a[h - 1], b[h - 1]) : e
    }

    function w(a, b, c) {
        var d;
        if ("number" == typeof b && (b = [b]), "[object Array]" !== Object.prototype.toString.call(b)) throw new Error("atkpnoUiSlider: 'range' contains invalid value.");
        if (d = "min" === a ? 0 : "max" === a ? 100 : parseFloat(a), !e(d) || !e(b[0])) throw new Error("atkpnoUiSlider: 'range' value isn't numeric.");
        c.xPct.push(d), c.xVal.push(b[0]), d ? c.xSteps.push(!isNaN(b[1]) && b[1]) : isNaN(b[1]) || (c.xSteps[0] = b[1]), c.xHighestCompleteStep.push(0)
    }

    function x(a, b, c) {
        if (!b) return !0;
        c.xSteps[a] = p([c.xVal[a], c.xVal[a + 1]], b) / o(c.xPct[a], c.xPct[a + 1]);
        var d = (c.xVal[a + 1] - c.xVal[a]) / c.xNumSteps[a], e = Math.ceil(Number(d.toFixed(3)) - 1),
            f = c.xVal[a] + c.xNumSteps[a] * e;
        c.xHighestCompleteStep[a] = f
    }

    function y(a, b, c, d) {
        this.xPct = [], this.xVal = [], this.xSteps = [d || !1], this.xNumSteps = [!1], this.xHighestCompleteStep = [], this.snap = b, this.direction = c;
        var e, f = [];
        for (e in a) a.hasOwnProperty(e) && f.push([a[e], e]);
        for (f.length && "object" == typeof f[0][0] ? f.sort(function (a, b) {
            return a[0][0] - b[0][0]
        }) : f.sort(function (a, b) {
            return a[0] - b[0]
        }), e = 0; e < f.length; e++) w(f[e][1], f[e][0], this);
        for (this.xNumSteps = this.xSteps.slice(0), e = 0; e < this.xNumSteps.length; e++) x(e, this.xNumSteps[e], this)
    }

    function z(a, b) {
        if (!e(b)) throw new Error("atkpnoUiSlider: 'step' is not numeric.");
        a.singleStep = b
    }

    function A(a, b) {
        if ("object" != typeof b || Array.isArray(b)) throw new Error("atkpnoUiSlider: 'range' is not an object.");
        if (void 0 === b.min || void 0 === b.max) throw new Error("atkpnoUiSlider: Missing 'min' or 'max' in 'range'.");
        if (b.min === b.max) throw new Error("atkpnoUiSlider: 'range' 'min' and 'max' cannot be equal.");
        a.spectrum = new y(b, a.snap, a.dir, a.singleStep)
    }

    function B(a, b) {
        if (b = h(b), !Array.isArray(b) || !b.length) throw new Error("atkpnoUiSlider: 'start' option is incorrect.");
        a.handles = b.length, a.start = b
    }

    function C(a, b) {
        if (a.snap = b, "boolean" != typeof b) throw new Error("atkpnoUiSlider: 'snap' option must be a boolean.")
    }

    function D(a, b) {
        if (a.animate = b, "boolean" != typeof b) throw new Error("atkpnoUiSlider: 'animate' option must be a boolean.")
    }

    function E(a, b) {
        if (a.animationDuration = b, "number" != typeof b) throw new Error("atkpnoUiSlider: 'animationDuration' option must be a number.")
    }

    function F(a, b) {
        var c, d = [!1];
        if (b === !0 || b === !1) {
            for (c = 1; c < a.handles; c++) d.push(b);
            d.push(!1)
        } else {
            if (!Array.isArray(b) || !b.length || b.length !== a.handles + 1) throw new Error("atkpnoUiSlider: 'connect' option doesn't match handle count.");
            d = b
        }
        a.connect = d
    }

    function G(a, b) {
        switch (b) {
            case"horizontal":
                a.ort = 0;
                break;
            case"vertical":
                a.ort = 1;
                break;
            default:
                throw new Error("atkpnoUiSlider: 'orientation' option is invalid.")
        }
    }

    function H(a, b) {
        if (!e(b)) throw new Error("atkpnoUiSlider: 'margin' option must be numeric.");
        if (0 !== b && (a.margin = a.spectrum.getMargin(b), !a.margin)) throw new Error("atkpnoUiSlider: 'margin' option is only supported on linear sliders.")
    }

    function I(a, b) {
        if (!e(b)) throw new Error("atkpnoUiSlider: 'limit' option must be numeric.");
        if (a.limit = a.spectrum.getMargin(b), !a.limit || a.handles < 2) throw new Error("atkpnoUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")
    }

    function J(a, b) {
        switch (b) {
            case"ltr":
                a.dir = 0;
                break;
            case"rtl":
                a.dir = 1;
                break;
            default:
                throw new Error("atkpnoUiSlider: 'direction' option was not recognized.")
        }
    }

    function K(a, b) {
        if ("string" != typeof b) throw new Error("atkpnoUiSlider: 'behaviour' must be a string containing options.");
        var c = b.indexOf("tap") >= 0, d = b.indexOf("drag") >= 0, e = b.indexOf("fixed") >= 0,
            f = b.indexOf("snap") >= 0, g = b.indexOf("hover") >= 0;
        if (e) {
            if (2 !== a.handles) throw new Error("atkpnoUiSlider: 'fixed' behaviour must be used with 2 handles");
            H(a, a.start[1] - a.start[0])
        }
        a.events = {tap: c || f, drag: d, fixed: e, snap: f, hover: g}
    }

    function L(a, b) {
        if (b !== !1) if (b === !0) {
            a.tooltips = [];
            for (var c = 0; c < a.handles; c++) a.tooltips.push(!0)
        } else {
            if (a.tooltips = h(b), a.tooltips.length !== a.handles) throw new Error("atkpnoUiSlider: must pass a formatter for all handles.");
            a.tooltips.forEach(function (a) {
                if ("boolean" != typeof a && ("object" != typeof a || "function" != typeof a.to)) throw new Error("atkpnoUiSlider: 'tooltips' must be passed a formatter or 'false'.")
            })
        }
    }

    function M(a, b) {
        if (a.format = b, "function" == typeof b.to && "function" == typeof b.from) return !0;
        throw new Error("atkpnoUiSlider: 'format' requires 'to' and 'from' methods.")
    }

    function N(a, b) {
        if (void 0 !== b && "string" != typeof b && b !== !1) throw new Error("atkpnoUiSlider: 'cssPrefix' must be a string or `false`.");
        a.cssPrefix = b
    }

    function O(a, b) {
        if (void 0 !== b && "object" != typeof b) throw new Error("atkpnoUiSlider: 'cssClasses' must be an object.");
        if ("string" == typeof a.cssPrefix) {
            a.cssClasses = {};
            for (var c in b) b.hasOwnProperty(c) && (a.cssClasses[c] = a.cssPrefix + b[c])
        } else a.cssClasses = b
    }

    function P(a, b) {
        if (b !== !0 && b !== !1) throw new Error("atkpnoUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");
        a.useRequestAnimationFrame = b
    }

    function Q(a) {
        var b, c = {margin: 0, limit: 0, animate: !0, animationDuration: 300, format: T};
        b = {
            step: {r: !1, t: z},
            start: {r: !0, t: B},
            connect: {r: !0, t: F},
            direction: {r: !0, t: J},
            snap: {r: !1, t: C},
            animate: {r: !1, t: D},
            animationDuration: {r: !1, t: E},
            range: {r: !0, t: A},
            orientation: {r: !1, t: G},
            margin: {r: !1, t: H},
            limit: {r: !1, t: I},
            behaviour: {r: !0, t: K},
            format: {r: !1, t: M},
            tooltips: {r: !1, t: L},
            cssPrefix: {r: !1, t: N},
            cssClasses: {r: !1, t: O},
            useRequestAnimationFrame: {r: !1, t: P}
        };
        var d = {
            connect: !1,
            direction: "ltr",
            behaviour: "tap",
            orientation: "horizontal",
            cssPrefix: "atkpnoUi-",
            cssClasses: {
                target: "target",
                base: "base",
                origin: "origin",
                handle: "handle",
                horizontal: "horizontal",
                vertical: "vertical",
                background: "background",
                connect: "connect",
                ltr: "ltr",
                rtl: "rtl",
                draggable: "draggable",
                drag: "state-drag",
                tap: "state-tap",
                active: "active",
                tooltip: "tooltip",
                pips: "pips",
                pipsHorizontal: "pips-horizontal",
                pipsVertical: "pips-vertical",
                marker: "marker",
                markerHorizontal: "marker-horizontal",
                markerVertical: "marker-vertical",
                markerNormal: "marker-normal",
                markerLarge: "marker-large",
                markerSub: "marker-sub",
                value: "value",
                valueHorizontal: "value-horizontal",
                valueVertical: "value-vertical",
                valueNormal: "value-normal",
                valueLarge: "value-large",
                valueSub: "value-sub"
            },
            useRequestAnimationFrame: !0
        };
        Object.keys(b).forEach(function (e) {
            if (void 0 === a[e] && void 0 === d[e]) {
                if (b[e].r) throw new Error("atkpnoUiSlider: '" + e + "' is required.");
                return !0
            }
            b[e].t(c, void 0 === a[e] ? d[e] : a[e])
        }), c.pips = a.pips;
        var e = [["left", "top"], ["right", "bottom"]];
        return c.style = e[c.dir][c.ort], c.styleOposite = e[c.dir ? 0 : 1][c.ort], c
    }

    function R(c, e, i) {
        function o(b, c) {
            var d = a(b, e.cssClasses.origin), f = a(d, e.cssClasses.handle);
            return f.setAttribute("data-handle", c), d
        }

        function p(b, c) {
            return !!c && a(b, e.cssClasses.connect)
        }

        function q(a, b) {
            ba = [], ca = [], ca.push(p(b, a[0]));
            for (var c = 0; c < e.handles; c++) ba.push(o(b, c)), ha[c] = c, ca.push(p(b, a[c + 1]))
        }

        function r(b) {
            j(b, e.cssClasses.target), 0 === e.dir ? j(b, e.cssClasses.ltr) : j(b, e.cssClasses.rtl), 0 === e.ort ? j(b, e.cssClasses.horizontal) : j(b, e.cssClasses.vertical), aa = a(b, e.cssClasses.base)
        }

        function s(b, c) {
            return !!e.tooltips[c] && a(b.firstChild, e.cssClasses.tooltip)
        }

        function t() {
            var a = ba.map(s);
            Z("update", function (b, c, d) {
                if (a[c]) {
                    var f = b[c];
                    e.tooltips[c] !== !0 && (f = e.tooltips[c].to(d[c])), a[c].innerHTML = f
                }
            })
        }

        function u(a, b, c) {
            if ("range" === a || "steps" === a) return ia.xVal;
            if ("count" === a) {
                var d, e = 100 / (b - 1), f = 0;
                for (b = []; (d = f++ * e) <= 100;) b.push(d);
                a = "positions"
            }
            return "positions" === a ? b.map(function (a) {
                return ia.fromStepping(c ? ia.getStep(a) : a)
            }) : "values" === a ? c ? b.map(function (a) {
                return ia.fromStepping(ia.getStep(ia.toStepping(a)))
            }) : b : void 0
        }

        function v(a, c, d) {
            function e(a, b) {
                return (a + b).toFixed(7) / 1
            }

            var f = {}, g = ia.xVal[0], h = ia.xVal[ia.xVal.length - 1], i = !1, j = !1, k = 0;
            return d = b(d.slice().sort(function (a, b) {
                return a - b
            })), d[0] !== g && (d.unshift(g), i = !0), d[d.length - 1] !== h && (d.push(h), j = !0), d.forEach(function (b, g) {
                var h, l, m, n, o, p, q, r, s, t, u = b, v = d[g + 1];
                if ("steps" === c && (h = ia.xNumSteps[g]), h || (h = v - u), u !== !1 && void 0 !== v) for (h = Math.max(h, 1e-7), l = u; l <= v; l = e(l, h)) {
                    for (n = ia.toStepping(l), o = n - k, r = o / a, s = Math.round(r), t = o / s, m = 1; m <= s; m += 1) p = k + m * t, f[p.toFixed(5)] = ["x", 0];
                    q = d.indexOf(l) > -1 ? 1 : "steps" === c ? 2 : 0, !g && i && (q = 0), l === v && j || (f[n.toFixed(5)] = [l, q]), k = n
                }
            }), f
        }

        function w(a, b, c) {
            function d(a, b) {
                var c = b === e.cssClasses.value, d = c ? m : n, f = c ? k : l;
                return b + " " + d[e.ort] + " " + f[a]
            }

            function f(a, b, c) {
                return 'class="' + d(c[1], b) + '" style="' + e.style + ": " + a + '%"'
            }

            function g(a, d) {
                d[1] = d[1] && b ? b(d[0], d[1]) : d[1], i += "<div " + f(a, e.cssClasses.marker, d) + "></div>", d[1] && (i += "<div " + f(a, e.cssClasses.value, d) + ">" + c.to(d[0]) + "</div>")
            }

            var h = document.createElement("div"), i = "",
                k = [e.cssClasses.valueNormal, e.cssClasses.valueLarge, e.cssClasses.valueSub],
                l = [e.cssClasses.markerNormal, e.cssClasses.markerLarge, e.cssClasses.markerSub],
                m = [e.cssClasses.valueHorizontal, e.cssClasses.valueVertical],
                n = [e.cssClasses.markerHorizontal, e.cssClasses.markerVertical];
            return j(h, e.cssClasses.pips), j(h, 0 === e.ort ? e.cssClasses.pipsHorizontal : e.cssClasses.pipsVertical), Object.keys(a).forEach(function (b) {
                g(b, a[b])
            }), h.innerHTML = i, h
        }

        function x(a) {
            var b = a.mode, c = a.density || 1, d = a.filter || !1, e = a.values || !1, f = a.stepped || !1,
                g = u(b, e, f), h = v(c, b, g), i = a.format || {to: Math.round};
            return fa.appendChild(w(h, d, i))
        }

        function y() {
            var a = aa.getBoundingClientRect(), b = "offset" + ["Width", "Height"][e.ort];
            return 0 === e.ort ? a.width || aa[b] : a.height || aa[b]
        }

        function z(a, b, c, d) {
            var f = function (b) {
                return !fa.hasAttribute("disabled") && (!l(fa, e.cssClasses.tap) && (b = A(b, d.pageOffset), !(a === ea.start && void 0 !== b.buttons && b.buttons > 1) && ((!d.hover || !b.buttons) && (b.calcPoint = b.points[e.ort], void c(b, d)))))
            }, g = [];
            return a.split(" ").forEach(function (a) {
                b.addEventListener(a, f, !1), g.push([a, f])
            }), g
        }

        function A(a, b) {
            a.preventDefault();
            var c, d, e = 0 === a.type.indexOf("touch"), f = 0 === a.type.indexOf("mouse"),
                g = 0 === a.type.indexOf("pointer"), h = a;
            if (0 === a.type.indexOf("MSPointer") && (g = !0), e) {
                if (h.touches.length > 1) return !1;
                c = a.changedTouches[0].pageX, d = a.changedTouches[0].pageY
            }
            return b = b || m(), (f || g) && (c = a.clientX + b.x, d = a.clientY + b.y), h.pageOffset = b, h.points = [c, d], h.cursor = f || g, h
        }

        function B(a) {
            var b = a - d(aa, e.ort), c = 100 * b / y();
            return e.dir ? 100 - c : c
        }

        function C(a) {
            var b = 100, c = !1;
            return ba.forEach(function (d, e) {
                if (!d.hasAttribute("disabled")) {
                    var f = Math.abs(ga[e] - a);
                    f < b && (c = e, b = f)
                }
            }), c
        }

        function D(a, b, c, d) {
            var e = c.slice(), f = [!a, a], g = [a, !a];
            d = d.slice(), a && d.reverse(), d.length > 1 ? d.forEach(function (a, c) {
                var d = M(e, a, e[a] + b, f[c], g[c]);
                d === !1 ? b = 0 : (b = d - e[a], e[a] = d)
            }) : f = g = [!0];
            var h = !1;
            d.forEach(function (a, d) {
                h = R(a, c[a] + b, f[d], g[d]) || h
            }), h && d.forEach(function (a) {
                E("update", a), E("slide", a)
            })
        }

        function E(a, b, c) {
            Object.keys(ka).forEach(function (d) {
                var f = d.split(".")[0];
                a === f && ka[d].forEach(function (a) {
                    a.call(da, ja.map(e.format.to), b, ja.slice(), c || !1, ga.slice())
                })
            })
        }

        function F(a, b) {
            "mouseout" === a.type && "HTML" === a.target.nodeName && null === a.relatedTarget && H(a, b)
        }

        function G(a, b) {
            if (navigator.appVersion.indexOf("MSIE 9") === -1 && 0 === a.buttons && 0 !== b.buttonsProperty) return H(a, b);
            var c = (e.dir ? -1 : 1) * (a.calcPoint - b.startCalcPoint), d = 100 * c / b.baseSize;
            D(c > 0, d, b.locations, b.handleNumbers)
        }

        function H(a, b) {
            var c = aa.querySelector("." + e.cssClasses.active);
            null !== c && k(c, e.cssClasses.active), a.cursor && (document.body.style.cursor = "", document.body.removeEventListener("selectstart", document.body.atkpnoUiListener)), document.documentElement.atkpnoUiListeners.forEach(function (a) {
                document.documentElement.removeEventListener(a[0], a[1])
            }), k(fa, e.cssClasses.drag), P(), b.handleNumbers.forEach(function (a) {
                E("set", a), E("change", a), E("end", a)
            })
        }

        function I(a, b) {
            if (1 === b.handleNumbers.length) {
                var c = ba[b.handleNumbers[0]];
                if (c.hasAttribute("disabled")) return !1;
                j(c.children[0], e.cssClasses.active)
            }
            a.preventDefault(), a.stopPropagation();
            var d = z(ea.move, document.documentElement, G, {
                    startCalcPoint: a.calcPoint,
                    baseSize: y(),
                    pageOffset: a.pageOffset,
                    handleNumbers: b.handleNumbers,
                    buttonsProperty: a.buttons,
                    locations: ga.slice()
                }), f = z(ea.end, document.documentElement, H, {handleNumbers: b.handleNumbers}),
                g = z("mouseout", document.documentElement, F, {handleNumbers: b.handleNumbers});
            if (document.documentElement.atkpnoUiListeners = d.concat(f, g), a.cursor) {
                document.body.style.cursor = getComputedStyle(a.target).cursor, ba.length > 1 && j(fa, e.cssClasses.drag);
                var h = function () {
                    return !1
                };
                document.body.atkpnoUiListener = h, document.body.addEventListener("selectstart", h, !1)
            }
            b.handleNumbers.forEach(function (a) {
                E("start", a)
            })
        }

        function J(a) {
            a.stopPropagation();
            var b = B(a.calcPoint), c = C(b);
            return c !== !1 && (e.events.snap || f(fa, e.cssClasses.tap, e.animationDuration), R(c, b, !0, !0), P(), E("slide", c, !0), E("set", c, !0), E("change", c, !0), E("update", c, !0), void(e.events.snap && I(a, {handleNumbers: [c]})))
        }

        function K(a) {
            var b = B(a.calcPoint), c = ia.getStep(b), d = ia.fromStepping(c);
            Object.keys(ka).forEach(function (a) {
                "hover" === a.split(".")[0] && ka[a].forEach(function (a) {
                    a.call(da, d)
                })
            })
        }

        function L(a) {
            a.fixed || ba.forEach(function (a, b) {
                z(ea.start, a.children[0], I, {handleNumbers: [b]})
            }), a.tap && z(ea.start, aa, J, {}), a.hover && z(ea.move, aa, K, {hover: !0}), a.drag && ca.forEach(function (b, c) {
                if (b !== !1 && 0 !== c && c !== ca.length - 1) {
                    var d = ba[c - 1], f = ba[c], g = [b];
                    j(b, e.cssClasses.draggable), a.fixed && (g.push(d.children[0]), g.push(f.children[0])), g.forEach(function (a) {
                        z(ea.start, a, I, {handles: [d, f], handleNumbers: [c - 1, c]})
                    })
                }
            })
        }

        function M(a, b, c, d, f) {
            return ba.length > 1 && (d && b > 0 && (c = Math.max(c, a[b - 1] + e.margin)), f && b < ba.length - 1 && (c = Math.min(c, a[b + 1] - e.margin))), ba.length > 1 && e.limit && (d && b > 0 && (c = Math.min(c, a[b - 1] + e.limit)), f && b < ba.length - 1 && (c = Math.max(c, a[b + 1] - e.limit))), c = ia.getStep(c), c = g(c), c !== a[b] && c
        }

        function N(a) {
            return a + "%"
        }

        function O(a, b) {
            ga[a] = b, ja[a] = ia.fromStepping(b);
            var c = function () {
                ba[a].style[e.style] = N(b), S(a), S(a + 1)
            };
            window.requestAnimationFrame && e.useRequestAnimationFrame ? window.requestAnimationFrame(c) : c()
        }

        function P() {
            ha.forEach(function (a) {
                var b = ga[a] > 50 ? -1 : 1, c = 3 + (ba.length + b * a);
                ba[a].childNodes[0].style.zIndex = c
            })
        }

        function R(a, b, c, d) {
            return b = M(ga, a, b, c, d), b !== !1 && (O(a, b), !0)
        }

        function S(a) {
            if (ca[a]) {
                var b = 0, c = 100;
                0 !== a && (b = ga[a - 1]), a !== ca.length - 1 && (c = ga[a]), ca[a].style[e.style] = N(b), ca[a].style[e.styleOposite] = N(100 - c)
            }
        }

        function T(a, b) {
            null !== a && a !== !1 && ("number" == typeof a && (a = String(a)), a = e.format.from(a), a === !1 || isNaN(a) || R(b, ia.toStepping(a), !1, !1))
        }

        function U(a, b) {
            var c = h(a), d = void 0 === ga[0];
            b = void 0 === b || !!b, c.forEach(T), e.animate && !d && f(fa, e.cssClasses.tap, e.animationDuration), ha.forEach(function (a) {
                R(a, ga[a], !0, !1)
            }), P(), ha.forEach(function (a) {
                E("update", a), null !== c[a] && b && E("set", a)
            })
        }

        function V(a) {
            U(e.start, a)
        }

        function W() {
            var a = ja.map(e.format.to);
            return 1 === a.length ? a[0] : a
        }

        function X() {
            for (var a in e.cssClasses) e.cssClasses.hasOwnProperty(a) && k(fa, e.cssClasses[a]);
            for (; fa.firstChild;) fa.removeChild(fa.firstChild);
            delete fa.atkpnoUiSlider
        }

        function Y() {
            return ga.map(function (a, b) {
                var c = ia.getNearbySteps(a), d = ja[b], e = c.thisStep.step, f = null;
                e !== !1 && d + e > c.stepAfter.startValue && (e = c.stepAfter.startValue - d), f = d > c.thisStep.startValue ? c.thisStep.step : c.stepBefore.step !== !1 && d - c.stepBefore.highestStep, 100 === a ? e = null : 0 === a && (f = null);
                var g = ia.countStepDecimals();
                return null !== e && e !== !1 && (e = Number(e.toFixed(g))), null !== f && f !== !1 && (f = Number(f.toFixed(g))), [f, e]
            })
        }

        function Z(a, b) {
            ka[a] = ka[a] || [], ka[a].push(b), "update" === a.split(".")[0] && ba.forEach(function (a, b) {
                E("update", b)
            })
        }

        function $(a) {
            var b = a && a.split(".")[0], c = b && a.substring(b.length);
            Object.keys(ka).forEach(function (a) {
                var d = a.split(".")[0], e = a.substring(d.length);
                b && b !== d || c && c !== e || delete ka[a]
            })
        }

        function _(a, b) {
            var c = W(), d = ["margin", "limit", "range", "animate", "snap", "step", "format"];
            d.forEach(function (b) {
                void 0 !== a[b] && (i[b] = a[b])
            });
            var f = Q(i);
            d.forEach(function (b) {
                void 0 !== a[b] && (e[b] = f[b])
            }), f.spectrum.direction = ia.direction, ia = f.spectrum, e.margin = f.margin, e.limit = f.limit, ga = [], U(a.start || c, b)
        }

        var aa, ba, ca, da, ea = n(), fa = c, ga = [], ha = [], ia = e.spectrum, ja = [], ka = {};
        if (fa.atkpnoUiSlider) throw new Error("Slider was already initialized.");
        return r(fa), q(e.connect, aa), da = {
            destroy: X,
            steps: Y,
            on: Z,
            off: $,
            get: W,
            set: U,
            reset: V,
            __moveHandles: function (a, b, c) {
                D(a, b, ga, c)
            },
            options: i,
            updateOptions: _,
            target: fa,
            pips: x
        }, L(e.events), U(e.start), e.pips && x(e.pips), e.tooltips && t(), da
    }

    function S(a, b) {
        if (!a.nodeName) throw new Error("atkpnoUiSlider.create requires a single element.");
        var c = Q(b, a), d = R(a, c, b);
        return a.atkpnoUiSlider = d, d
    }

    y.prototype.getMargin = function (a) {
        var b = this.xNumSteps[0];
        if (b && a % b) throw new Error("atkpnoUiSlider: 'limit' and 'margin' must be divisible by step.");
        return 2 === this.xPct.length && p(this.xVal, a)
    }, y.prototype.toStepping = function (a) {
        return a = t(this.xVal, this.xPct, a)
    }, y.prototype.fromStepping = function (a) {
        return u(this.xVal, this.xPct, a)
    }, y.prototype.getStep = function (a) {
        return a = v(this.xPct, this.xSteps, this.snap, a)
    }, y.prototype.getNearbySteps = function (a) {
        var b = s(a, this.xPct);
        return {
            stepBefore: {
                startValue: this.xVal[b - 2],
                step: this.xNumSteps[b - 2],
                highestStep: this.xHighestCompleteStep[b - 2]
            },
            thisStep: {
                startValue: this.xVal[b - 1],
                step: this.xNumSteps[b - 1],
                highestStep: this.xHighestCompleteStep[b - 1]
            },
            stepAfter: {
                startValue: this.xVal[b - 0],
                step: this.xNumSteps[b - 0],
                highestStep: this.xHighestCompleteStep[b - 0]
            }
        }
    }, y.prototype.countStepDecimals = function () {
        var a = this.xNumSteps.map(i);
        return Math.max.apply(null, a)
    }, y.prototype.convert = function (a) {
        return this.getStep(this.toStepping(a))
    };
    var T = {
        to: function (a) {
            return void 0 !== a && a.toFixed(2)
        }, from: Number
    };
    return {create: S}
});





/* atkp carousel */


jQuery(document).ready(function () {

    var CONSTANTS = {
        productMinWidth: 185,
        productMargin: 20
    };

    var $adUnits = jQuery('.atkp-product-carousel-unit');
    $adUnits.each(function () {

        var $adUnit = jQuery(this),
            dataid = $adUnit.data('uid'),
            $wrapper = $adUnit.find('.atkp-pc-wrapper-'+dataid),
            $productContainer = $adUnit.find('.atkp-pc-product-container-'+dataid),
            $btnNext = $adUnit.find('.atkp-pc-btn-next-'+dataid),
            $btnPrev = $adUnit.find('.atkp-pc-btn-prev-'+dataid),

            $productList = $productContainer.find('.atkp-pc-product-list-'+dataid),
            $products = $productList.find('.atkp-pc-product-'+dataid),
            productCount = $products.length;

        if (!productCount) {
            return true;
        }
        if ($adUnit.data('productminwidth') != null)
            CONSTANTS.productMinWidth = $adUnit.data('productminwidth');
        if ($adUnit.data('productmargin') != null)
            CONSTANTS.productMargin = $adUnit.data('productmargin');

        var rows = $adUnit.find('input[name=rows]').length && parseInt($adUnit.find('input[name=rows]').val(), 10);
        var columns = $adUnit.find('input[name=columns]').length && parseInt($adUnit.find('input[name=columns]').val(), 10);

        if (columns) {
            var productContainerMinWidth = columns * (CONSTANTS.productMinWidth + CONSTANTS.productMargin) + 'px';
            $adUnit.css('min-width', productContainerMinWidth);
            $productContainer.css('min-width', productContainerMinWidth);
            $products.filter(':nth-child(' + columns + 'n + 1)').css('clear', 'both');
        }

        if (rows && columns) {
            var cutOffIndex = (rows * columns) - 1;
            $products.filter(':gt(' + cutOffIndex + ')').remove();
        }

        function updateLayout() {
            var wrapperWidth = $wrapper.width();
            var possibleColumns = columns || parseInt(wrapperWidth / (CONSTANTS.productMinWidth + CONSTANTS.productMargin), 10);
            var actualColumns = columns || possibleColumns < productCount ? possibleColumns : productCount;

            /**
             * The actual columns can be zero when the wraperwidth is less than sum of CONSTANTS.productMinWidth and
             * CONSTANTS.productMargin.The parseInt will use floor function and converts any value less than 1 to
             * zero.Therefore making actual columns 1 .
             **/
            if (actualColumns == 0) {
                actualColumns = 1;
            }

            var productWidth = parseInt(wrapperWidth / actualColumns, 10) - CONSTANTS.productMargin;

            $products.css('width', productWidth + 'px');

            /**
             * Removing the Carousel navigation button when the number of products selected by admin is less
             * than the actual columns (the number of products) can be shown on screen
             **/
            if (productCount > actualColumns) {
                $btnNext.css('visibility', 'visible').removeClass('disabled').unbind('click');
                $btnPrev.css('visibility', 'visible').removeClass('disabled').unbind('click');
            }
            $productContainer.jCarouselLite({
                containerSelector: '.atkp-pc-product-list',
                itemSelector: '.atkp-pc-product',
                btnNext: '#' + $adUnit.attr('id') + ' .atkp-pc-btn-next-'+dataid,
                btnPrev: '#' + $adUnit.attr('id') + ' .atkp-pc-btn-prev-'+dataid,
                visible: actualColumns,
                circular: true,
                responsive: true
            });


        }

        updateLayout();
        jQuery(window).resize(updateLayout);
    });
});

/*!
 * jCarousel Lite - v1.9.3 - 2015-02-16
 * http://kswedberg.github.com/jquery-carousel-lite/
 * Copyright (c) 2015 Karl Swedberg
 * based on the original by Ganeshji Marwaha (gmarwaha.com)
 * Licensed MIT (http://kswedberg.github.com/jquery-carousel-lite/blob/master/LICENSE-MIT)
 */


(function ($) {
    $.jCarouselLite = {
        version: '1.9.3',
        curr: 0
    };

    $.fn.anim = typeof $.fn.velocity !== 'undefined' ? $.fn.velocity : $.fn.animate;

    $.fn.jCarouselLite = function (options) {
        var o = $.extend(true, {}, $.fn.jCarouselLite.defaults, options),
            ceil = Math.ceil,
            mabs = Math.abs;

        this.each(function () {

            var beforeCirc, afterCirc, pageNav, pageNavCount, resize,
                li, itemLength, curr,
                prepResize, touchEvents, $btnsGo,
                isTouch = 'ontouchend' in document,
                styles = {div: {}, ul: {}, li: {}},
                // firstCss = true,
                running = false,
                animCss = o.vertical ? 'top' : 'left',
                aniProps = {},
                sizeProp = o.vertical ? 'height' : 'width',
                outerMethod = o.vertical ? 'outerHeight' : 'outerWidth',
                self = this,
                div = $(this),
                ul = div.find(o.containerSelector).eq(0),
                tLi = ul.children(o.itemSelector),
                tl = tLi.length,
                visibleNum = o.visible,
                // need visibleCeil and visibleFloor in case we want a fractional number of visible items at a time
                visibleCeil = ceil(visibleNum),
                visibleFloor = Math.floor(visibleNum),
                start = Math.min(o.start, tl - 1),
                direction = 1,
                activeBtnOffset = 0,
                activeBtnTypes = {},
                startTouch = {},
                endTouch = {},
                axisPrimary = o.vertical ? 'y' : 'x',
                axisSecondary = o.vertical ? 'x' : 'y';


            var init = o.init.call(this, o, tLi);
            // bail out for this carousel if the o.init() callback returns `false`
            if (init === false) {
                return;
            }

            var makeCircular = function () {
                if (beforeCirc && beforeCirc.length) {
                    beforeCirc.remove();
                    afterCirc.remove();
                }
                tLi = ul.children(o.liSelector);
                tl = tLi.length;
                beforeCirc = tLi.slice(tl - visibleCeil).clone(true).each(fixIds);
                afterCirc = tLi.slice(0, visibleCeil).clone(true).each(fixIds);
                ul.prepend(beforeCirc)
                    .append(afterCirc);
                li = ul.children(o.liSelector);
                itemLength = li.length;
            };

            div.data('dirjc', direction);
            div.data(animCss + 'jc', div.css(animCss));

            if (o.circular) {

                makeCircular();
                start += visibleCeil;
                activeBtnOffset = visibleCeil;

            } else {
                li = ul.children(o.liSelector);
                itemLength = li.length;
            }

            if (o.btnGo && o.btnGo.length) {

                if ($.isArray(o.btnGo) && typeof o.btnGo[0] === 'string') {
                    $btnsGo = $(o.btnGo.join());
                } else {
                    $btnsGo = $(o.btnGo);
                }

                $btnsGo.each(function (i) {
                    $(this).bind('click.jc', function (event) {
                        event.preventDefault();
                        var btnInfo = {
                            btnGo: this,
                            btnGoIndex: i
                        };
                        return go(o.circular ? visibleNum + i : i, btnInfo);
                    });
                });
                activeBtnTypes.go = 1;
            }

            var setActive = function (i, types) {
                i = ceil(i);

                // Set active class on the appropriate carousel item
                li.filter('.' + o.activeClass).removeClass(o.activeClass);
                li.eq(i).addClass(o.activeClass);

                var activeBtnIndex = (i - activeBtnOffset) % tl,
                    visEnd = activeBtnIndex + visibleFloor;

                if (types.go) {
                    // remove active and visible classes from all the go buttons
                    $btnsGo.removeClass(o.activeClass).removeClass(o.visibleClass);
                    // add active class to the go button corresponding to the first visible slide
                    $btnsGo.eq(activeBtnIndex).addClass(o.activeClass);
                    // add visible class to go buttons corresponding to all visible slides
                    $btnsGo.slice(activeBtnIndex, activeBtnIndex + visibleFloor).addClass(o.visibleClass);

                    if (visEnd > $btnsGo.length) {
                        $btnsGo.slice(0, visEnd - $btnsGo.length).addClass(o.visibleClass);
                    }
                }

                if (types.pager) {
                    pageNav.removeClass(o.activeClass);
                    pageNav.eq(ceil(activeBtnIndex / visibleNum)).addClass(o.activeClass);
                }
                return activeBtnIndex;
            };

            curr = start;

            $.jCarouselLite.curr = curr;

            var getDimensions = function (reset) {
                var liSize, ulSize, divSize;

                if (reset) {

                    styles.div[sizeProp] = '';
                    styles.li = {
                        width: '',
                        height: ''
                    };
                    // bail out with the reset styles
                    return styles;
                }

                // Full li size(incl margin)-Used for animation
                liSize = li[outerMethod](true);

                // size of full ul(total length, not just for the visible items)
                ulSize = liSize * itemLength;

                // size of entire div(total length for just the visible items)
                divSize = liSize * visibleNum;

                styles.div[sizeProp] = divSize + 'px';
                styles.ul[sizeProp] = ulSize + 'px';
                styles.ul[animCss] = -(curr * liSize) + 'px';
                styles.li = {
                    width: li.width(),
                    height: li.height()
                };
                styles.liSize = liSize;
                return styles;
            };


            var setDimensions = function (reset) {
                var css, tmpDivSize;
                var prelimCss = {
                    div: {visibility: 'visible', position: 'relative', zIndex: 2, left: '0'},
                    ul: {margin: '0', padding: '0', position: 'relative', listStyleType: 'none', zIndex: 1},
                    li: {overflow: o.vertical ? 'hidden' : 'visible', 'float': o.vertical ? 'none' : 'left'}
                };

                if (reset) {
                    css = getDimensions(true);
                    div.css(css.div);
                    ul.css(css.ul);
                    li.css(css.li);
                }

                css = getDimensions();

                if (o.autoCSS) {
                    $.extend(true, css, prelimCss);
                    // firstCss = false;
                }

                if (o.autoWidth) {
                    tmpDivSize = parseInt(div.css(sizeProp), 10);
                    styles.liSize = tmpDivSize / o.visible;
                    css.li[sizeProp] = styles.liSize - (li[outerMethod](true) - parseInt(li.css(sizeProp), 10));

                    // Need to adjust other settings to fit with li width
                    css.ul[sizeProp] = (styles.liSize * itemLength) + 'px';
                    css.ul[animCss] = -(curr * styles.liSize) + 'px';
                    css.div[sizeProp] = tmpDivSize;
                }

                if (o.autoCSS) {
                    li.css(css.li);
                    ul.css(css.ul);
                    div.css(css.div);
                }
            };

            setDimensions();

            // set up timed advancer
            var advanceCounter = 0,
                autoStop = iterations(tl, o),
                autoScrollBy = typeof o.auto === 'number' ? o.auto : o.scroll;

            var advancer = function () {
                self.setAutoAdvance = setTimeout(function () {

                    if (!autoStop || autoStop > advanceCounter) {
                        direction = div.data('dirjc');
                        go(curr + (direction * autoScrollBy), {auto: true});
                        advanceCounter++;
                        advancer();
                    }
                }, o.timeout);
            };

            // bind click handlers to prev and next buttons, if set
            $.each(['btnPrev', 'btnNext'], function (index, btn) {
                if (o[btn]) {
                    o['$' + btn] = $.isFunction(o[btn]) ? o[btn].call(div[0]) : $(o[btn]);
                    o['$' + btn].bind('click.jc', function (event) {
                        event.preventDefault();
                        var step = index === 0 ? curr - o.scroll : curr + o.scroll;
                        if (o.directional) {
                            // set direction of subsequent scrolls to:
                            //  1 if "btnNext" clicked
                            // -1 if "btnPrev" clicked
                            div.data('dirjc', (index ? 1 : -1));
                        }
                        return go(step);
                    });
                }
            });

            if (!o.circular) {
                if (o.btnPrev && start === 0) {
                    o.$btnPrev.addClass(o.btnDisabledClass);
                }

                if (o.btnNext && start + visibleFloor >= itemLength) {
                    o.$btnNext.addClass(o.btnDisabledClass);
                }
            }

            if (o.autoPager) {
                pageNavCount = ceil(tl / visibleNum);
                pageNav = [];
                for (var i = 0; i < pageNavCount; i++) {
                    pageNav.push('<li><a href="#">' + (i + 1) + '</a></li>');
                }
                if (pageNav.length > 1) {
                    pageNav = $('<ul>' + pageNav.join('') + '</ul>').appendTo(o.autoPager).find('li');
                    pageNav.find('a').each(function (i) {
                        $(this).bind('click.jc', function (event) {
                            event.preventDefault();
                            var slide = i * visibleNum;
                            if (o.circular) {
                                slide += visibleNum;
                            }
                            return go(slide);
                        });
                    });
                    activeBtnTypes.pager = 1;
                }
            }

            // set the active class on the btn corresponding to the "start" li
            setActive(start, activeBtnTypes);

            if (o.mouseWheel && div.mousewheel) {
                div.bind('mousewheel.jc', function (e, d) {
                    return d > 0 ? go(curr - o.scroll) : go(curr + o.scroll);
                });
            }

            if (o.pause && o.auto && !isTouch) {
                div.bind('mouseenter.jc', function () {
                    div.trigger('pauseCarousel.jc');
                }).bind('mouseleave.jc', function () {
                    div.trigger('resumeCarousel.jc');
                });
            }

            if (o.auto) {
                advancer();
            }

            function vis() {
                return li.slice(curr).slice(0, visibleCeil);
            }

            $.jCarouselLite.vis = vis;

            function go(to, settings) {
                if (running) {
                    return false;
                }
                settings = settings || {};
                var prev = curr,
                    direction = to > curr,
                    speed = typeof settings.speed !== 'undefined' ? settings.speed : o.speed,
                    // offset appears if touch moves slides
                    offset = settings.offset || 0;

                if (o.beforeStart) {
                    o.beforeStart.call(div, vis(), direction, settings);
                }

                // If circular and we are in first or last, then go to the other end
                if (o.circular) {
                    if (to > curr && to > itemLength - visibleCeil) {

                        // temporarily set "to" as the difference
                        to = to - curr;
                        curr = curr % tl;

                        // use the difference to make "to" correct relative to curr
                        to = curr + to;
                        ul.css(animCss, (-curr * styles.liSize) - offset);
                    } else if (to < curr && to < 0) {
                        curr += tl;
                        to += tl;
                        ul.css(animCss, (-curr * styles.liSize) - offset);
                    }

                    curr = to + (to % 1);

                    // If non-circular and "to" points beyond first or last, we change to first or last.
                } else {
                    if (to < 0) {
                        to = 0;
                    } else if (to > itemLength - visibleFloor) {
                        to = itemLength - visibleFloor;
                    }

                    curr = to;

                    if (curr === 0 && o.first) {
                        o.first.call(this, vis(), direction);
                    }

                    if (curr === itemLength - visibleFloor && o.last) {
                        o.last.call(this, vis(), direction);
                    }

                    // Disable buttons when the carousel reaches the last/first, and enable when not
                    if (o.btnPrev) {
                        o.$btnPrev.toggleClass(o.btnDisabledClass, curr === 0);
                    }
                    if (o.btnNext) {
                        o.$btnNext.toggleClass(o.btnDisabledClass, curr === itemLength - visibleFloor);
                    }
                }

                // if btnGo, set the active class on the btnGo element corresponding to the first visible carousel li
                // if autoPager, set active class on the appropriate autopager element
                setActive(curr, activeBtnTypes);

                $.jCarouselLite.curr = curr;

                if (prev === curr && !settings.force) {
                    if (o.afterEnd) {
                        o.afterEnd.call(div, vis(), direction, settings);
                    }
                    return curr;
                }

                running = true;

                aniProps[animCss] = -(curr * styles.liSize);
                ul.anim(aniProps, speed, o.easing, function () {
                    if (o.afterEnd) {
                        o.afterEnd.call(div, vis(), direction, settings);
                    }
                    running = false;
                });

                return curr;
            } // end go function

            // bind custom events so they can be triggered by user
            div
                .bind('go.jc', function (e, to, settings) {

                    if (typeof to === 'undefined') {
                        to = '+=1';
                    }

                    var todir = typeof to === 'string' && /(\+=|-=)(\d+)/.exec(to);

                    if (todir) {
                        to = todir[1] === '-=' ? curr - todir[2] * 1 : curr + todir[2] * 1;
                    } else {
                        to += start;
                    }
                    go(to, settings);
                })
                .bind('startCarousel.jc', function () {
                    clearTimeout(self.setAutoAdvance);
                    self.setAutoAdvance = undefined;
                    div.trigger('go', '+=' + o.scroll);
                    advancer();
                    div.removeData('pausedjc').removeData('stoppedjc');
                })
                .bind('resumeCarousel.jc', function (event, forceRun) {
                    if (self.setAutoAdvance) {
                        return;
                    }
                    clearTimeout(self.setAutoAdvance);
                    self.setAutoAdvance = undefined;

                    var stopped = div.data('stoppedjc');
                    if (forceRun || !stopped) {
                        advancer();
                        div.removeData('pausedjc');
                        if (stopped) {
                            div.removeData('stoppedjc');
                        }
                    }
                })

                .bind('pauseCarousel.jc', function () {
                    clearTimeout(self.setAutoAdvance);
                    self.setAutoAdvance = undefined;
                    div.data('pausedjc', true);
                })
                .bind('stopCarousel.jc', function () {
                    clearTimeout(self.setAutoAdvance);
                    self.setAutoAdvance = undefined;

                    div.data('stoppedjc', true);
                })

                .bind('refreshCarousel.jc', function (event, all) {
                    if (all && o.circular) {
                        makeCircular();
                    }
                    setDimensions(o.autoCSS);
                })

                .bind('endCarousel.jc', function () {
                    if (self.setAutoAdvance) {
                        clearTimeout(self.setAutoAdvance);
                        self.setAutoAdvance = undefined;
                    }
                    if (o.btnPrev) {
                        o.$btnPrev.addClass(o.btnDisabledClass).unbind('.jc');
                    }
                    if (o.btnNext) {
                        o.$btnNext.addClass(o.btnDisabledClass).unbind('.jc');
                    }
                    if (o.btnGo) {
                        $.each(o.btnGo, function (i, val) {
                            $(val).unbind('.jc');
                        });
                    }

                    if (o.circular) {
                        li.slice(0, visibleCeil).remove();
                        li.slice(-visibleCeil).remove();
                    }
                    $.each([animCss + 'jc', 'pausedjc', 'stoppedjc', 'dirjc'], function (i, d) {
                        div.removeData(d);
                    });
                    div.unbind('.jc');
                });

            // touch gesture support

            touchEvents = {
                touchstart: function (event) {
                    endTouch.x = 0;
                    endTouch.y = 0;
                    startTouch.x = event.targetTouches[0].pageX;
                    startTouch.y = event.targetTouches[0].pageY;
                    startTouch[animCss] = parseFloat(ul.css(animCss));
                    startTouch.time = +new Date();
                },

                touchmove: function (event) {
                    var tlength = event.targetTouches.length;

                    if (tlength === 1) {
                        endTouch.x = event.targetTouches[0].pageX;
                        endTouch.y = event.targetTouches[0].pageY;
                        aniProps[animCss] = startTouch[animCss] + (endTouch[axisPrimary] - startTouch[axisPrimary]);
                        ul.css(aniProps);
                        if (o.preventTouchWindowScroll) {
                            event.preventDefault();
                        }
                    } else {
                        endTouch.x = startTouch.x;
                        endTouch.y = startTouch.y;
                    }
                },

                touchend: function () {
                    // bail out early if there is no touch movement
                    if (!endTouch.x) {
                        return;
                    }

                    var pxDelta = startTouch[axisPrimary] - endTouch[axisPrimary],
                        pxAbsDelta = mabs(pxDelta),
                        primaryAxisGood = pxAbsDelta > o.swipeThresholds[axisPrimary],
                        secondaryAxisGood = mabs(startTouch[axisSecondary] - endTouch[axisSecondary]) < o.swipeThresholds[axisSecondary],
                        timeDelta = +new Date() - startTouch.time,
                        quickSwipe = timeDelta < o.swipeThresholds.time,
                        operator = pxDelta > 0 ? '+=' : '-=',
                        to = operator + o.scroll,
                        swipeInfo = {force: true};

                    // quick, clean swipe
                    if (quickSwipe && primaryAxisGood && secondaryAxisGood) {
                        // set animation speed to twice as fast as that set in speed option
                        swipeInfo.speed = o.speed / 2;
                    } else
                        // slow swipe < 1/2 slide width, OR
                        // not enough movement for swipe, OR
                        // too much movement on secondary axis when quick swipe
                    if ((!quickSwipe && pxAbsDelta < styles.liSize / 2) ||
                        !primaryAxisGood ||
                        (quickSwipe && !secondaryAxisGood)
                    ) {
                        // revert to same slide
                        to = '+=0';
                    } else
                        // slow swipe > 1/2 slide width
                    if (!quickSwipe && pxAbsDelta > styles.liSize / 2) {
                        to = Math.round(pxAbsDelta / styles.liSize);
                        to = operator + (to > o.visible ? o.visible : to);

                        // send pxDelta along as offset in case carousel is circular and needs to reset
                        swipeInfo.offset = pxDelta;
                    }

                    div.trigger('go.jc', [to, swipeInfo]);
                    endTouch = {};
                },

                handle: function (event) {
                    event = event.originalEvent;
                    touchEvents[event.type](event);
                }
            };

            if (isTouch && o.swipe) {
                div.bind('touchstart.jc touchmove.jc touchend.jc', touchEvents.handle);
            } // end swipe events

            // Responsive design handling:
            // Reset dimensions on window.resize
            if (o.responsive) {
                prepResize = o.autoCSS;
                $(window).bind('resize', function () {
                    if (prepResize) {
                        ul.width(ul.width() * 2);
                        prepResize = false;
                    }

                    clearTimeout(resize);
                    resize = setTimeout(function () {
                        div.trigger('refreshCarousel.jc', [true]);
                        prepResize = o.autoCSS;
                    }, 100);
                });
            }

        }); // end each

        return this;
    };

    $.fn.jCarouselLite.defaults = {

        // valid selector for the "ul" container containing the slides
        containerSelector: 'ul',

        // valid selector for the slide "li" items
        itemSelector: 'li',

        btnPrev: null,
        btnNext: null,

        // array (or jQuery object) of elements. When clicked, makes the corresponding carousel LI the first visible one
        btnGo: null,

        // selector (or jQuery object) indicating the containing element for pagination navigation.
        autoPager: null,
        btnDisabledClass: 'disabled',

        // class applied to the active slide and btnGo element
        activeClass: 'active',

        // class applied to the btnGo elements corresponding to the visible slides
        visibleClass: 'vis',
        mouseWheel: false,
        speed: 200,
        easing: null,

        // milliseconds between scrolls
        timeout: 4000,

        // true to enable auto scrolling; number to auto-scroll by different number at a time than that of scroll option
        auto: false,


        // true to enable changing direction of auto scrolling when user clicks prev or next button
        directional: false,

        // number of times before autoscrolling will stop. (if circular is false, won't iterate more than number of items)
        autoStop: false,

        // pause scrolling on hover
        pause: true,
        vertical: false,

        // continue scrolling when reach the last item
        circular: true,

        // the number to be visible at a given time.
        visible: 3,

        // index of item to show initially in the first posiition
        start: 0,

        // number of items to scroll at a time
        scroll: 1,

        // whether to set initial styles on the carousel elements. See readme for info
        autoCSS: true,

        // whether the dimensions should change on resize
        responsive: false,

        // whether to set width of <li>s (and left/top of <ul>) based on width of <div>
        autoWidth: false,

        // touch options
        swipe: true,
        swipeThresholds: {
            x: 80,
            y: 40,
            time: 150
        },

        // whether to prevent vertical scrolling of the document window when swiping
        preventTouchWindowScroll: true,

        // Function to be called for each matched carousel when .jCaourselLite() is called.
        // Inside the function, `this` is the carousel div.
        // The function can take 2 arguments:
        // 1. The merged options object
        // 2. A jQuery object containing the <li> items in the carousel
        // If the function returns `false`, the plugin will skip all the carousel magic for that carousel div
        init: function () {
        },

        // function to be called once the first slide is hit
        first: null,

        // function to be called once the last slide is hit
        last: null,

        // function to be called before each transition starts
        beforeStart: null,

        // function to be called after each transition ends
        afterEnd: null
    };

    function iterations(itemLength, options) {
        return options.autoStop && (options.circular ? options.autoStop : Math.min(itemLength, options.autoStop));
    }

    function fixIds(i) {
        if (this.id) {
            this.id += i;
        }
    }
})(jQuery);
// source --> https://pfotengefluester.de/wp-content/plugins/affiliate-toolkit-templatepack/lib/lightslider/js/lightslider.min.js?ver=6.9.4 
/*! lightslider - v1.1.6 - 2016-10-25
* https://github.com/sachinchoolur/lightslider
* Copyright (c) 2016 Sachin N; Licensed MIT */
!function(a,b){"use strict";var c={item:3,autoWidth:!1,slideMove:1,slideMargin:10,addClass:"",mode:"slide",useCSS:!0,cssEasing:"ease",easing:"linear",speed:400,auto:!1,pauseOnHover:!1,loop:!1,slideEndAnimation:!0,pause:2e3,keyPress:!1,controls:!0,prevHtml:"",nextHtml:"",rtl:!1,adaptiveHeight:!1,vertical:!1,verticalHeight:500,vThumbWidth:100,thumbItem:10,pager:!0,gallery:!1,galleryMargin:5,thumbMargin:5,currentPagerPosition:"middle",enableTouch:!0,enableDrag:!0,freeMove:!0,swipeThreshold:40,responsive:[],onBeforeStart:function(a){},onSliderLoad:function(a){},onBeforeSlide:function(a,b){},onAfterSlide:function(a,b){},onBeforeNextSlide:function(a,b){},onBeforePrevSlide:function(a,b){}};a.fn.lightSlider=function(b){if(0===this.length)return this;if(this.length>1)return this.each(function(){a(this).lightSlider(b)}),this;var d={},e=a.extend(!0,{},c,b),f={},g=this;d.$el=this,"fade"===e.mode&&(e.vertical=!1);var h=g.children(),i=a(window).width(),j=null,k=null,l=0,m=0,n=!1,o=0,p="",q=0,r=e.vertical===!0?"height":"width",s=e.vertical===!0?"margin-bottom":"margin-right",t=0,u=0,v=0,w=0,x=null,y="ontouchstart"in document.documentElement,z={};return z.chbreakpoint=function(){if(i=a(window).width(),e.responsive.length){var b;if(e.autoWidth===!1&&(b=e.item),i<e.responsive[0].breakpoint)for(var c=0;c<e.responsive.length;c++)i<e.responsive[c].breakpoint&&(j=e.responsive[c].breakpoint,k=e.responsive[c]);if("undefined"!=typeof k&&null!==k)for(var d in k.settings)k.settings.hasOwnProperty(d)&&(("undefined"==typeof f[d]||null===f[d])&&(f[d]=e[d]),e[d]=k.settings[d]);if(!a.isEmptyObject(f)&&i>e.responsive[0].breakpoint)for(var g in f)f.hasOwnProperty(g)&&(e[g]=f[g]);e.autoWidth===!1&&t>0&&v>0&&b!==e.item&&(q=Math.round(t/((v+e.slideMargin)*e.slideMove)))}},z.calSW=function(){e.autoWidth===!1&&(v=(o-(e.item*e.slideMargin-e.slideMargin))/e.item)},z.calWidth=function(a){var b=a===!0?p.find(".lslide").length:h.length;if(e.autoWidth===!1)m=b*(v+e.slideMargin);else{m=0;for(var c=0;b>c;c++)m+=parseInt(h.eq(c).width())+e.slideMargin}return m},d={doCss:function(){var a=function(){for(var a=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],b=document.documentElement,c=0;c<a.length;c++)if(a[c]in b.style)return!0};return e.useCSS&&a()?!0:!1},keyPress:function(){e.keyPress&&a(document).on("keyup.lightslider",function(b){a(":focus").is("input, textarea")||(b.preventDefault?b.preventDefault():b.returnValue=!1,37===b.keyCode?g.goToPrevSlide():39===b.keyCode&&g.goToNextSlide())})},controls:function(){e.controls&&(g.after('<div class="lSAction"><a class="lSPrev">'+e.prevHtml+'</a><a class="lSNext">'+e.nextHtml+"</a></div>"),e.autoWidth?z.calWidth(!1)<o&&p.find(".lSAction").hide():l<=e.item&&p.find(".lSAction").hide(),p.find(".lSAction a").on("click",function(b){return b.preventDefault?b.preventDefault():b.returnValue=!1,"lSPrev"===a(this).attr("class")?g.goToPrevSlide():g.goToNextSlide(),!1}))},initialStyle:function(){var a=this;"fade"===e.mode&&(e.autoWidth=!1,e.slideEndAnimation=!1),e.auto&&(e.slideEndAnimation=!1),e.autoWidth&&(e.slideMove=1,e.item=1),e.loop&&(e.slideMove=1,e.freeMove=!1),e.onBeforeStart.call(this,g),z.chbreakpoint(),g.addClass("lightSlider").wrap('<div class="lSSlideOuter '+e.addClass+'"><div class="lSSlideWrapper"></div></div>'),p=g.parent(".lSSlideWrapper"),e.rtl===!0&&p.parent().addClass("lSrtl"),e.vertical?(p.parent().addClass("vertical"),o=e.verticalHeight,p.css("height",o+"px")):o=g.outerWidth(),h.addClass("lslide"),e.loop===!0&&"slide"===e.mode&&(z.calSW(),z.clone=function(){if(z.calWidth(!0)>o){for(var b=0,c=0,d=0;d<h.length&&(b+=parseInt(g.find(".lslide").eq(d).width())+e.slideMargin,c++,!(b>=o+e.slideMargin));d++);var f=e.autoWidth===!0?c:e.item;if(f<g.find(".clone.left").length)for(var i=0;i<g.find(".clone.left").length-f;i++)h.eq(i).remove();if(f<g.find(".clone.right").length)for(var j=h.length-1;j>h.length-1-g.find(".clone.right").length;j--)q--,h.eq(j).remove();for(var k=g.find(".clone.right").length;f>k;k++)g.find(".lslide").eq(k).clone().removeClass("lslide").addClass("clone right").appendTo(g),q++;for(var l=g.find(".lslide").length-g.find(".clone.left").length;l>g.find(".lslide").length-f;l--)g.find(".lslide").eq(l-1).clone().removeClass("lslide").addClass("clone left").prependTo(g);h=g.children()}else h.hasClass("clone")&&(g.find(".clone").remove(),a.move(g,0))},z.clone()),z.sSW=function(){l=h.length,e.rtl===!0&&e.vertical===!1&&(s="margin-left"),e.autoWidth===!1&&h.css(r,v+"px"),h.css(s,e.slideMargin+"px"),m=z.calWidth(!1),g.css(r,m+"px"),e.loop===!0&&"slide"===e.mode&&n===!1&&(q=g.find(".clone.left").length)},z.calL=function(){h=g.children(),l=h.length},this.doCss()&&p.addClass("usingCss"),z.calL(),"slide"===e.mode?(z.calSW(),z.sSW(),e.loop===!0&&(t=a.slideValue(),this.move(g,t)),e.vertical===!1&&this.setHeight(g,!1)):(this.setHeight(g,!0),g.addClass("lSFade"),this.doCss()||(h.fadeOut(0),h.eq(q).fadeIn(0))),e.loop===!0&&"slide"===e.mode?h.eq(q).addClass("active"):h.first().addClass("active")},pager:function(){var a=this;if(z.createPager=function(){w=(o-(e.thumbItem*e.thumbMargin-e.thumbMargin))/e.thumbItem;var b=p.find(".lslide"),c=p.find(".lslide").length,d=0,f="",h=0;for(d=0;c>d;d++){"slide"===e.mode&&(e.autoWidth?h+=(parseInt(b.eq(d).width())+e.slideMargin)*e.slideMove:h=d*(v+e.slideMargin)*e.slideMove);var i=b.eq(d*e.slideMove).attr("data-thumb");if(f+=e.gallery===!0?'<li style="width:100%;'+r+":"+w+"px;"+s+":"+e.thumbMargin+'px"><a href="#"><img src="'+i+'" /></a></li>':'<li><a href="#">'+(d+1)+"</a></li>","slide"===e.mode&&h>=m-o-e.slideMargin){d+=1;var j=2;e.autoWidth&&(f+='<li><a href="#">'+(d+1)+"</a></li>",j=1),j>d?(f=null,p.parent().addClass("noPager")):p.parent().removeClass("noPager");break}}var k=p.parent();k.find(".lSPager").html(f),e.gallery===!0&&(e.vertical===!0&&k.find(".lSPager").css("width",e.vThumbWidth+"px"),u=d*(e.thumbMargin+w)+.5,k.find(".lSPager").css({property:u+"px","transition-duration":e.speed+"ms"}),e.vertical===!0&&p.parent().css("padding-right",e.vThumbWidth+e.galleryMargin+"px"),k.find(".lSPager").css(r,u+"px"));var l=k.find(".lSPager").find("li");l.first().addClass("active"),l.on("click",function(){return e.loop===!0&&"slide"===e.mode?q+=l.index(this)-k.find(".lSPager").find("li.active").index():q=l.index(this),g.mode(!1),e.gallery===!0&&a.slideThumb(),!1})},e.pager){var b="lSpg";e.gallery&&(b="lSGallery"),p.after('<ul class="lSPager '+b+'"></ul>');var c=e.vertical?"margin-left":"margin-top";p.parent().find(".lSPager").css(c,e.galleryMargin+"px"),z.createPager()}setTimeout(function(){z.init()},0)},setHeight:function(a,b){var c=null,d=this;c=e.loop?a.children(".lslide ").first():a.children().first();var f=function(){var d=c.outerHeight(),e=0,f=d;b&&(d=0,e=100*f/o),a.css({height:d+"px","padding-bottom":e+"%"})};f(),c.find("img").length?c.find("img")[0].complete?(f(),x||d.auto()):c.find("img").on("load",function(){setTimeout(function(){f(),x||d.auto()},100)}):x||d.auto()},active:function(a,b){this.doCss()&&"fade"===e.mode&&p.addClass("on");var c=0;if(q*e.slideMove<l){a.removeClass("active"),this.doCss()||"fade"!==e.mode||b!==!1||a.fadeOut(e.speed),c=b===!0?q:q*e.slideMove;var d,f;b===!0&&(d=a.length,f=d-1,c+1>=d&&(c=f)),e.loop===!0&&"slide"===e.mode&&(c=b===!0?q-g.find(".clone.left").length:q*e.slideMove,b===!0&&(d=a.length,f=d-1,c+1===d?c=f:c+1>d&&(c=0))),this.doCss()||"fade"!==e.mode||b!==!1||a.eq(c).fadeIn(e.speed),a.eq(c).addClass("active")}else a.removeClass("active"),a.eq(a.length-1).addClass("active"),this.doCss()||"fade"!==e.mode||b!==!1||(a.fadeOut(e.speed),a.eq(c).fadeIn(e.speed))},move:function(a,b){e.rtl===!0&&(b=-b),this.doCss()?a.css(e.vertical===!0?{transform:"translate3d(0px, "+-b+"px, 0px)","-webkit-transform":"translate3d(0px, "+-b+"px, 0px)"}:{transform:"translate3d("+-b+"px, 0px, 0px)","-webkit-transform":"translate3d("+-b+"px, 0px, 0px)"}):e.vertical===!0?a.css("position","relative").animate({top:-b+"px"},e.speed,e.easing):a.css("position","relative").animate({left:-b+"px"},e.speed,e.easing);var c=p.parent().find(".lSPager").find("li");this.active(c,!0)},fade:function(){this.active(h,!1);var a=p.parent().find(".lSPager").find("li");this.active(a,!0)},slide:function(){var a=this;z.calSlide=function(){m>o&&(t=a.slideValue(),a.active(h,!1),t>m-o-e.slideMargin?t=m-o-e.slideMargin:0>t&&(t=0),a.move(g,t),e.loop===!0&&"slide"===e.mode&&(q>=l-g.find(".clone.left").length/e.slideMove&&a.resetSlide(g.find(".clone.left").length),0===q&&a.resetSlide(p.find(".lslide").length)))},z.calSlide()},resetSlide:function(a){var b=this;p.find(".lSAction a").addClass("disabled"),setTimeout(function(){q=a,p.css("transition-duration","0ms"),t=b.slideValue(),b.active(h,!1),d.move(g,t),setTimeout(function(){p.css("transition-duration",e.speed+"ms"),p.find(".lSAction a").removeClass("disabled")},50)},e.speed+100)},slideValue:function(){var a=0;if(e.autoWidth===!1)a=q*(v+e.slideMargin)*e.slideMove;else{a=0;for(var b=0;q>b;b++)a+=parseInt(h.eq(b).width())+e.slideMargin}return a},slideThumb:function(){var a;switch(e.currentPagerPosition){case"left":a=0;break;case"middle":a=o/2-w/2;break;case"right":a=o-w}var b=q-g.find(".clone.left").length,c=p.parent().find(".lSPager");"slide"===e.mode&&e.loop===!0&&(b>=c.children().length?b=0:0>b&&(b=c.children().length));var d=b*(w+e.thumbMargin)-a;d+o>u&&(d=u-o-e.thumbMargin),0>d&&(d=0),this.move(c,d)},auto:function(){e.auto&&(clearInterval(x),x=setInterval(function(){g.goToNextSlide()},e.pause))},pauseOnHover:function(){var b=this;e.auto&&e.pauseOnHover&&(p.on("mouseenter",function(){a(this).addClass("ls-hover"),g.pause(),e.auto=!0}),p.on("mouseleave",function(){a(this).removeClass("ls-hover"),p.find(".lightSlider").hasClass("lsGrabbing")||b.auto()}))},touchMove:function(a,b){if(p.css("transition-duration","0ms"),"slide"===e.mode){var c=a-b,d=t-c;if(d>=m-o-e.slideMargin)if(e.freeMove===!1)d=m-o-e.slideMargin;else{var f=m-o-e.slideMargin;d=f+(d-f)/5}else 0>d&&(e.freeMove===!1?d=0:d/=5);this.move(g,d)}},touchEnd:function(a){if(p.css("transition-duration",e.speed+"ms"),"slide"===e.mode){var b=!1,c=!0;t-=a,t>m-o-e.slideMargin?(t=m-o-e.slideMargin,e.autoWidth===!1&&(b=!0)):0>t&&(t=0);var d=function(a){var c=0;if(b||a&&(c=1),e.autoWidth)for(var d=0,f=0;f<h.length&&(d+=parseInt(h.eq(f).width())+e.slideMargin,q=f+c,!(d>=t));f++);else{var g=t/((v+e.slideMargin)*e.slideMove);q=parseInt(g)+c,t>=m-o-e.slideMargin&&g%1!==0&&q++}};a>=e.swipeThreshold?(d(!1),c=!1):a<=-e.swipeThreshold&&(d(!0),c=!1),g.mode(c),this.slideThumb()}else a>=e.swipeThreshold?g.goToPrevSlide():a<=-e.swipeThreshold&&g.goToNextSlide()},enableDrag:function(){var b=this;if(!y){var c=0,d=0,f=!1;p.find(".lightSlider").addClass("lsGrab"),p.on("mousedown",function(b){return o>m&&0!==m?!1:void("lSPrev"!==a(b.target).attr("class")&&"lSNext"!==a(b.target).attr("class")&&(c=e.vertical===!0?b.pageY:b.pageX,f=!0,b.preventDefault?b.preventDefault():b.returnValue=!1,p.scrollLeft+=1,p.scrollLeft-=1,p.find(".lightSlider").removeClass("lsGrab").addClass("lsGrabbing"),clearInterval(x)))}),a(window).on("mousemove",function(a){f&&(d=e.vertical===!0?a.pageY:a.pageX,b.touchMove(d,c))}),a(window).on("mouseup",function(g){if(f){p.find(".lightSlider").removeClass("lsGrabbing").addClass("lsGrab"),f=!1,d=e.vertical===!0?g.pageY:g.pageX;var h=d-c;Math.abs(h)>=e.swipeThreshold&&a(window).on("click.ls",function(b){b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopImmediatePropagation(),b.stopPropagation(),a(window).off("click.ls")}),b.touchEnd(h)}})}},enableTouch:function(){var a=this;if(y){var b={},c={};p.on("touchstart",function(a){c=a.originalEvent.targetTouches[0],b.pageX=a.originalEvent.targetTouches[0].pageX,b.pageY=a.originalEvent.targetTouches[0].pageY,clearInterval(x)}),p.on("touchmove",function(d){if(o>m&&0!==m)return!1;var f=d.originalEvent;c=f.targetTouches[0];var g=Math.abs(c.pageX-b.pageX),h=Math.abs(c.pageY-b.pageY);e.vertical===!0?(3*h>g&&d.preventDefault(),a.touchMove(c.pageY,b.pageY)):(3*g>h&&d.preventDefault(),a.touchMove(c.pageX,b.pageX))}),p.on("touchend",function(){if(o>m&&0!==m)return!1;var d;d=e.vertical===!0?c.pageY-b.pageY:c.pageX-b.pageX,a.touchEnd(d)})}},build:function(){var b=this;b.initialStyle(),this.doCss()&&(e.enableTouch===!0&&b.enableTouch(),e.enableDrag===!0&&b.enableDrag()),a(window).on("focus",function(){b.auto()}),a(window).on("blur",function(){clearInterval(x)}),b.pager(),b.pauseOnHover(),b.controls(),b.keyPress()}},d.build(),z.init=function(){z.chbreakpoint(),e.vertical===!0?(o=e.item>1?e.verticalHeight:h.outerHeight(),p.css("height",o+"px")):o=p.outerWidth(),e.loop===!0&&"slide"===e.mode&&z.clone(),z.calL(),"slide"===e.mode&&g.removeClass("lSSlide"),"slide"===e.mode&&(z.calSW(),z.sSW()),setTimeout(function(){"slide"===e.mode&&g.addClass("lSSlide")},1e3),e.pager&&z.createPager(),e.adaptiveHeight===!0&&e.vertical===!1&&g.css("height",h.eq(q).outerHeight(!0)),e.adaptiveHeight===!1&&("slide"===e.mode?e.vertical===!1?d.setHeight(g,!1):d.auto():d.setHeight(g,!0)),e.gallery===!0&&d.slideThumb(),"slide"===e.mode&&d.slide(),e.autoWidth===!1?h.length<=e.item?p.find(".lSAction").hide():p.find(".lSAction").show():z.calWidth(!1)<o&&0!==m?p.find(".lSAction").hide():p.find(".lSAction").show()},g.goToPrevSlide=function(){if(q>0)e.onBeforePrevSlide.call(this,g,q),q--,g.mode(!1),e.gallery===!0&&d.slideThumb();else if(e.loop===!0){if(e.onBeforePrevSlide.call(this,g,q),"fade"===e.mode){var a=l-1;q=parseInt(a/e.slideMove)}g.mode(!1),e.gallery===!0&&d.slideThumb()}else e.slideEndAnimation===!0&&(g.addClass("leftEnd"),setTimeout(function(){g.removeClass("leftEnd")},400))},g.goToNextSlide=function(){var a=!0;if("slide"===e.mode){var b=d.slideValue();a=b<m-o-e.slideMargin}q*e.slideMove<l-e.slideMove&&a?(e.onBeforeNextSlide.call(this,g,q),q++,g.mode(!1),e.gallery===!0&&d.slideThumb()):e.loop===!0?(e.onBeforeNextSlide.call(this,g,q),q=0,g.mode(!1),e.gallery===!0&&d.slideThumb()):e.slideEndAnimation===!0&&(g.addClass("rightEnd"),setTimeout(function(){g.removeClass("rightEnd")},400))},g.mode=function(a){e.adaptiveHeight===!0&&e.vertical===!1&&g.css("height",h.eq(q).outerHeight(!0)),n===!1&&("slide"===e.mode?d.doCss()&&(g.addClass("lSSlide"),""!==e.speed&&p.css("transition-duration",e.speed+"ms"),""!==e.cssEasing&&p.css("transition-timing-function",e.cssEasing)):d.doCss()&&(""!==e.speed&&g.css("transition-duration",e.speed+"ms"),""!==e.cssEasing&&g.css("transition-timing-function",e.cssEasing))),a||e.onBeforeSlide.call(this,g,q),"slide"===e.mode?d.slide():d.fade(),p.hasClass("ls-hover")||d.auto(),setTimeout(function(){a||e.onAfterSlide.call(this,g,q)},e.speed),n=!0},g.play=function(){g.goToNextSlide(),e.auto=!0,d.auto()},g.pause=function(){e.auto=!1,clearInterval(x)},g.refresh=function(){z.init()},g.getCurrentSlideCount=function(){var a=q;if(e.loop){var b=p.find(".lslide").length,c=g.find(".clone.left").length;a=c-1>=q?b+(q-c):q>=b+c?q-b-c:q-c}return a+1},g.getTotalSlideCount=function(){return p.find(".lslide").length},g.goToSlide=function(a){q=e.loop?a+g.find(".clone.left").length-1:a,g.mode(!1),e.gallery===!0&&d.slideThumb()},g.destroy=function(){g.lightSlider&&(g.goToPrevSlide=function(){},g.goToNextSlide=function(){},g.mode=function(){},g.play=function(){},g.pause=function(){},g.refresh=function(){},g.getCurrentSlideCount=function(){},g.getTotalSlideCount=function(){},g.goToSlide=function(){},g.lightSlider=null,z={init:function(){}},g.parent().parent().find(".lSAction, .lSPager").remove(),g.removeClass("lightSlider lSFade lSSlide lsGrab lsGrabbing leftEnd right").removeAttr("style").unwrap().unwrap(),g.children().removeAttr("style"),h.removeClass("lslide active"),g.find(".clone").remove(),h=null,x=null,n=!1,q=0)},setTimeout(function(){e.onSliderLoad.call(this,g)},10),a(window).on("resize orientationchange",function(a){setTimeout(function(){a.preventDefault?a.preventDefault():a.returnValue=!1,z.init()},200)}),this}}(jQuery);
// source --> https://pfotengefluester.de/wp-content/plugins/affiliate-toolkit-starter/dist/script.js?ver=6.9.4 
if (typeof jQuery === 'undefined') {
    console.log('no jquery loaded');
} else {
    var $j = jQuery.noConflict();
    $j(document).ready(function () {
        $j(".atkp-ajax-container").each(function (i, obj) {

            var endpointurl = $j(obj).attr('data-endpointurl');
            var uid = $j(obj).attr('data-uid');

            var x = $j('#atkp-data-parameters-' + uid).html();
            var x2 = $j('#atkp-data-products-' + uid).html();

            var atkpparameters = JSON.parse(x);
            var atkpproducts = JSON.parse(x2);

            $j(obj).addClass('atkp-spinloader-round');

            $j.post(endpointurl,
                {
                    action: 'atkp_render_template',
                    products: JSON.stringify(atkpproducts),
                    parameters: JSON.stringify(atkpparameters),
                },
                function (data, status) {

                    if (status == 'success') {
                        //hide info??

                        switch (data.status) {
                            case 'okay':
                                //rendering ok
                                $j(obj).html(data.html);
                                break;
                            case 'error':
                                $j(obj).html(data.error + '<br />' + data.message);
                                break;
                            default:
                                $j(obj).html("unknown error on loading");
                                break;
                        }

                    }

                    $j(obj).removeClass('atkp-spinloader-round');
                }).fail(function () {
                $j(obj).removeClass('atkp-spinloader-round');
                $j(obj).html("server side error on loading");
            });
        });
    });
};
// source --> https://pfotengefluester.de/wp-content/uploads/affiliate-toolkit/scripts.js?ver=6.9.4 

function atkp_open_link(link, mode, trackingtype, linktype, linkcaption) {

    if (trackingtype == 1 && typeof ga !== "undefined")
        ga("send", "event", linktype, "click", linkcaption);
    else if (trackingtype == 2 && typeof _gaq !== "undefined")
        _gaq.push(["_trackEvent", linktype, "click", linkcaption]);
    else if (trackingtype == 3 && typeof gtag !== "undefined")
        gtag("event", linktype, {"event_category": "click", "event_label": linkcaption});
    else if (trackingtype == 4 && typeof _paq !== "undefined")
        _paq.push(["_trackEvent", "Clicks",linktype, linkcaption]);

    window.open(link, mode);

}
var $j = jQuery.noConflict();
$j(document).ready(function () {
	$j(".atkp-floating-bar").hide();
});
$j(document).scroll(function() {
    var scroll = $j(window).scrollTop();
    var positionEnd = null;    if (scroll > 500 && (positionEnd == null || scroll <= (positionEnd.top-1000))) { 
        $j('.atkp-floating-bar').fadeIn();
    } else {
        $j('.atkp-floating-bar').fadeOut();
    }
 });


                var $j = jQuery.noConflict();
                $j(document).ready(function() {
            
                    $j('.atkp-imagegallery').lightSlider({
                        gallery:true,
                        item:1,
                        loop:true,
                        thumbItem:5,
                        
                        slideMargin:0,
                        enableDrag: false,
                        currentPagerPosition:'left',
                        onSliderLoad: function(el) {
                            el.lightGallery({
                                selector: '.atkp-imagegallery .lslide'
                            });
                        }           
                    });  
                    
                    $j('.atkp-imageslider').lightSlider({                        
                        item:1,
                        slideMargin:0,
                        loop:true
                    });
                    
                    $j('.atkp-autoimageslider').lightSlider({                        
                        item:4,
                        auto:true,
                        loop:true,
                        pauseOnHover: true,                        
                    });
                  });