Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
  2.  * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
  3.  */
  4. ;
  5. window.Modernizr = function (a, b, c) {
  6.     function D(a) {
  7.         j.cssText = a
  8.     }
  9.  
  10.     function E(a, b) {
  11.         return D(n.join(a + ";") + (b || ""))
  12.     }
  13.  
  14.     function F(a, b) {
  15.         return typeof a === b
  16.     }
  17.  
  18.     function G(a, b) {
  19.         return!!~("" + a).indexOf(b)
  20.     }
  21.  
  22.     function H(a, b) {
  23.         for (var d in a) {
  24.             var e = a[d];
  25.             if (!G(e, "-") && j[e] !== c) {
  26.                 return b == "pfx" ? e : !0
  27.             }
  28.         }
  29.         return!1
  30.     }
  31.  
  32.     function I(a, b, d) {
  33.         for (var e in a) {
  34.             var f = b[a[e]];
  35.             if (f !== c) {
  36.                 return d === !1 ? a[e] : F(f, "function") ? f.bind(d || b) : f
  37.             }
  38.         }
  39.         return!1
  40.     }
  41.  
  42.     function J(a, b, c) {
  43.         var d = a.charAt(0).toUpperCase() + a.slice(1), e = (a + " " + p.join(d + " ") + d).split(" ");
  44.         return F(b, "string") || F(b, "undefined") ? H(e, b) : (e = (a + " " + q.join(d + " ") + d).split(" "), I(e, b, c))
  45.     }
  46.  
  47.     function K() {
  48.         e.input = function (c) {
  49.             for (var d = 0, e = c.length; d < e; d++) {
  50.                 u[c[d]] = c[d]in k;
  51.             }
  52.             return u.list && (u.list = !!b.createElement("datalist") && !!a.HTMLDataListElement), u
  53.         }("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")), e.inputtypes = function (a) {
  54.             for (var d = 0, e, f, h, i = a.length; d < i; d++) {
  55.                 k.setAttribute("type", f = a[d]), e = k.type !== "text", e && (k.value = l, k.style.cssText =
  56.                         "position:absolute;visibility:hidden;", /^range$/.test(f) && k.style.WebkitAppearance !== c ?
  57.                         (g.appendChild(k), h = b.defaultView, e =
  58.                                 h.getComputedStyle && h.getComputedStyle(k, null).WebkitAppearance !== "textfield" && k.offsetHeight
  59.                                 !== 0, g.removeChild(k)) :
  60.                         /^(search|tel)$/.test(f) || (/^(url|email)$/.test(f) ? e = k.checkValidity && k.checkValidity() === !1 :
  61.                         e = k.value != l)), t[a[d]] = !!e;
  62.             }
  63.             return t
  64.         }("search tel url email datetime date month week time datetime-local number range color".split(" "))
  65.     }
  66.  
  67.     var d = "2.6.2", e = {}, f = !0, g = b.documentElement, h = "modernizr", i = b.createElement(h), j = i.style, k = b.createElement("input"), l = ":)", m = {}.toString, n = " -webkit- -moz- -o- -ms- ".split(" "), o = "Webkit Moz O ms", p = o.split(" "), q = o.toLowerCase().split(" "), r = {svg: "http://www.w3.org/2000/svg"}, s = {}, t = {}, u = {}, v = [], w = v.slice, x, y = function (a,
  68.                                                                                                                                                                                                                                                                                                                                                                                                        c,
  69.                                                                                                                                                                                                                                                                                                                                                                                                        d,
  70.                                                                                                                                                                                                                                                                                                                                                                                                        e) {
  71.         var f, i, j, k, l = b.createElement("div"), m = b.body, n = m || b.createElement("body");
  72.         if (parseInt(d, 10)) {
  73.             while (d--) {
  74.                 j = b.createElement("div"), j.id = e ? e[d] : h + (d + 1), l.appendChild(j);
  75.             }
  76.         }
  77.         return f = ["&#173;", '<style id="s', h, '">', a, "</style>"].join(""), l.id = h, (m ? l : n).innerHTML += f, n.appendChild(l), m
  78.                 || (n.style.background = "", n.style.overflow = "hidden", k = g.style.overflow, g.style.overflow = "hidden", g.appendChild(n)), i =
  79.                 c(l, a), m ? l.parentNode.removeChild(l) : (n.parentNode.removeChild(n), g.style.overflow = k), !!i
  80.     }, z = function (b) {
  81.         var c = a.matchMedia || a.msMatchMedia;
  82.         if (c) {
  83.             return c(b).matches;
  84.         }
  85.         var d;
  86.         return y("@media " + b + " { #" + h + " { position: absolute; } }", function (b) {
  87.             d = (a.getComputedStyle ? getComputedStyle(b, null) : b.currentStyle)["position"] == "absolute"
  88.         }), d
  89.     }, A = function () {
  90.         function d(d, e) {
  91.             e = e || b.createElement(a[d] || "div"), d = "on" + d;
  92.             var f = d in e;
  93.             return f || (e.setAttribute || (e = b.createElement("div")), e.setAttribute && e.removeAttribute && (e.setAttribute(d, ""), f =
  94.                     F(e[d], "function"), F(e[d], "undefined") || (e[d] = c), e.removeAttribute(d))), e = null, f
  95.         }
  96.  
  97.         var a = {select: "input", change: "input", submit: "form", reset: "form", error: "img", load: "img", abort: "img"};
  98.         return d
  99.     }(), B = {}.hasOwnProperty, C;
  100.     !F(B, "undefined") && !F(B.call, "undefined") ? C = function (a, b) {
  101.         return B.call(a, b)
  102.     } : C = function (a, b) {
  103.         return b in a && F(a.constructor.prototype[b], "undefined")
  104.     }, Function.prototype.bind || (Function.prototype.bind = function (b) {
  105.         var c = this;
  106.         if (typeof c != "function") {
  107.             throw new TypeError;
  108.         }
  109.         var d = w.call(arguments, 1), e = function () {
  110.             if (this instanceof e) {
  111.                 var a = function () {
  112.                 };
  113.                 a.prototype = c.prototype;
  114.                 var f = new a, g = c.apply(f, d.concat(w.call(arguments)));
  115.                 return Object(g) === g ? g : f
  116.             }
  117.             return c.apply(b, d.concat(w.call(arguments)))
  118.         };
  119.         return e
  120.     }), s.flexbox = function () {
  121.         return J("flexWrap")
  122.     }, s.flexboxlegacy = function () {
  123.         return J("boxDirection")
  124.     }, s.canvas = function () {
  125.         var a = b.createElement("canvas");
  126.         return!!a.getContext && !!a.getContext("2d")
  127.     }, s.canvastext = function () {
  128.         return!!e.canvas && !!F(b.createElement("canvas").getContext("2d").fillText, "function")
  129.     }, s.webgl = function () {
  130.         return!!a.WebGLRenderingContext
  131.     }, s.touch = function () {
  132.         var c;
  133.         return"ontouchstart"in a || a.DocumentTouch && b instanceof DocumentTouch ? c = !0 :
  134.                 y(["@media (", n.join("touch-enabled),("), h, ")", "{#modernizr{top:9px;position:absolute}}"].join(""), function (a) {
  135.                     c = a.offsetTop === 9
  136.                 }), c
  137.     }, s.geolocation = function () {
  138.         return"geolocation"in navigator
  139.     }, s.postmessage = function () {
  140.         return!!a.postMessage
  141.     }, s.websqldatabase = function () {
  142.         return!!a.openDatabase
  143.     }, s.indexedDB = function () {
  144.         return!!J("indexedDB", a)
  145.     }, s.hashchange = function () {
  146.         return A("hashchange", a) && (b.documentMode === c || b.documentMode > 7)
  147.     }, s.history = function () {
  148.         return!!a.history && !!history.pushState
  149.     }, s.draganddrop = function () {
  150.         var a = b.createElement("div");
  151.         return"draggable"in a || "ondragstart"in a && "ondrop"in a
  152.     }, s.websockets = function () {
  153.         return"WebSocket"in a || "MozWebSocket"in a
  154.     }, s.rgba = function () {
  155.         return D("background-color:rgba(150,255,150,.5)"), G(j.backgroundColor, "rgba")
  156.     }, s.hsla = function () {
  157.         return D("background-color:hsla(120,40%,100%,.5)"), G(j.backgroundColor, "rgba") || G(j.backgroundColor, "hsla")
  158.     }, s.multiplebgs = function () {
  159.         return D("background:url(https://),url(https://),red url(https://)"), /(url\s*\(.*?){3}/.test(j.background)
  160.     }, s.backgroundsize = function () {
  161.         return J("backgroundSize")
  162.     }, s.borderimage = function () {
  163.         return J("borderImage")
  164.     }, s.borderradius = function () {
  165.         return J("borderRadius")
  166.     }, s.boxshadow = function () {
  167.         return J("boxShadow")
  168.     }, s.textshadow = function () {
  169.         return b.createElement("div").style.textShadow === ""
  170.     }, s.opacity = function () {
  171.         return E("opacity:.55"), /^0.55$/.test(j.opacity)
  172.     }, s.cssanimations = function () {
  173.         return J("animationName")
  174.     }, s.csscolumns = function () {
  175.         return J("columnCount")
  176.     }, s.cssgradients = function () {
  177.         var a = "background-image:", b = "gradient(linear,left top,right bottom,from(#9f9),to(white));", c = "linear-gradient(left top,#9f9, white);";
  178.         return D((a + "-webkit- ".split(" ").join(b + a) + n.join(c + a)).slice(0, -a.length)), G(j.backgroundImage, "gradient")
  179.     }, s.cssreflections = function () {
  180.         return J("boxReflect")
  181.     }, s.csstransforms = function () {
  182.         return!!J("transform")
  183.     }, s.csstransforms3d = function () {
  184.         var a = !!J("perspective");
  185.         return a && "webkitPerspective"in g.style
  186.                 && y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}", function (b, c) {
  187.                     a = b.offsetLeft === 9 && b.offsetHeight === 3
  188.                 }), a
  189.     }, s.csstransitions = function () {
  190.         return J("transition")
  191.     }, s.fontface = function () {
  192.         var a;
  193.         return y('@font-face {font-family:"font";src:url("https://")}', function (c, d) {
  194.             var e = b.getElementById("smodernizr"), f = e.sheet || e.styleSheet, g = f ?
  195.                             f.cssRules && f.cssRules[0] ? f.cssRules[0].cssText : f.cssText || "" : "";
  196.             a = /src/i.test(g) && g.indexOf(d.split(" ")[0]) === 0
  197.         }), a
  198.     }, s.generatedcontent = function () {
  199.         var a;
  200.         return y(["#", h, "{font:0/0 a}#", h, ':after{content:"', l, '";visibility:hidden;font:3px/1 a}'].join(""), function (b) {
  201.             a = b.offsetHeight >= 3
  202.         }), a
  203.     }, s.video = function () {
  204.         var a = b.createElement("video"), c = !1;
  205.         try {
  206.             if (c = !!a.canPlayType) {
  207.                 c = new Boolean(c), c.ogg = a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ""), c.h264 =
  208.                         a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ""), c.webm =
  209.                         a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "")
  210.             }
  211.         }
  212.         catch (d) {
  213.         }
  214.         return c
  215.     }, s.audio = function () {
  216.         var a = b.createElement("audio"), c = !1;
  217.         try {
  218.             if (c = !!a.canPlayType) {
  219.                 c = new Boolean(c), c.ogg = a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), c.mp3 =
  220.                         a.canPlayType("audio/mpeg;").replace(/^no$/, ""), c.wav = a.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""), c.m4a =
  221.                         (a.canPlayType("audio/x-m4a;") || a.canPlayType("audio/aac;")).replace(/^no$/, "")
  222.             }
  223.         }
  224.         catch (d) {
  225.         }
  226.         return c
  227.     }, s.localstorage = function () {
  228.         try {
  229.             return localStorage.setItem(h, h), localStorage.removeItem(h), !0
  230.         }
  231.         catch (a) {
  232.             return!1
  233.         }
  234.     }, s.sessionstorage = function () {
  235.         try {
  236.             return sessionStorage.setItem(h, h), sessionStorage.removeItem(h), !0
  237.         }
  238.         catch (a) {
  239.             return!1
  240.         }
  241.     }, s.webworkers = function () {
  242.         return!!a.Worker
  243.     }, s.applicationcache = function () {
  244.         return!!a.applicationCache
  245.     }, s.svg = function () {
  246.         return!!b.createElementNS && !!b.createElementNS(r.svg, "svg").createSVGRect
  247.     }, s.inlinesvg = function () {
  248.         var a = b.createElement("div");
  249.         return a.innerHTML = "<svg/>", (a.firstChild && a.firstChild.namespaceURI) == r.svg
  250.     }, s.smil = function () {
  251.         return!!b.createElementNS && /SVGAnimate/.test(m.call(b.createElementNS(r.svg, "animate")))
  252.     }, s.svgclippaths = function () {
  253.         return!!b.createElementNS && /SVGClipPath/.test(m.call(b.createElementNS(r.svg, "clipPath")))
  254.     };
  255.     for (var L in s) {
  256.         C(s, L) && (x = L.toLowerCase(), e[x] = s[L](), v.push((e[x] ? "" : "no-") + x));
  257.     }
  258.     return e.input || K(), e.addTest = function (a, b) {
  259.         if (typeof a == "object") {
  260.             for (var d in a) {
  261.                 C(a, d) && e.addTest(d, a[d]);
  262.             }
  263.         }
  264.         else {
  265.             a = a.toLowerCase();
  266.             if (e[a] !== c) {
  267.                 return e;
  268.             }
  269.             b = typeof b == "function" ? b() : b, typeof f != "undefined" && f && (g.className += " " + (b ? "" : "no-") + a), e[a] = b
  270.         }
  271.         return e
  272.     }, D(""), i = k = null, function (a, b) {
  273.         function k(a, b) {
  274.             var c = a.createElement("p"), d = a.getElementsByTagName("head")[0] || a.documentElement;
  275.             return c.innerHTML = "x<style>" + b + "</style>", d.insertBefore(c.lastChild, d.firstChild)
  276.         }
  277.  
  278.         function l() {
  279.             var a = r.elements;
  280.             return typeof a == "string" ? a.split(" ") : a
  281.         }
  282.  
  283.         function m(a) {
  284.             var b = i[a[g]];
  285.             return b || (b = {}, h++, a[g] = h, i[h] = b), b
  286.         }
  287.  
  288.         function n(a, c, f) {
  289.             c || (c = b);
  290.             if (j) {
  291.                 return c.createElement(a);
  292.             }
  293.             f || (f = m(c));
  294.             var g;
  295.             return f.cache[a] ? g = f.cache[a].cloneNode() :
  296.                     e.test(a) ? g = (f.cache[a] = f.createElem(a)).cloneNode() : g = f.createElem(a), g.canHaveChildren && !d.test(a) ?
  297.                     f.frag.appendChild(g) : g
  298.         }
  299.  
  300.         function o(a, c) {
  301.             a || (a = b);
  302.             if (j) {
  303.                 return a.createDocumentFragment();
  304.             }
  305.             c = c || m(a);
  306.             var d = c.frag.cloneNode(), e = 0, f = l(), g = f.length;
  307.             for (; e < g; e++) {
  308.                 d.createElement(f[e]);
  309.             }
  310.             return d
  311.         }
  312.  
  313.         function p(a, b) {
  314.             b.cache || (b.cache = {}, b.createElem = a.createElement, b.createFrag = a.createDocumentFragment, b.frag =
  315.                     b.createFrag()), a.createElement = function (c) {
  316.                 return r.shivMethods ? n(c, a, b) : b.createElem(c)
  317.             }, a.createDocumentFragment =
  318.                     Function("h,f",
  319.                                     "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + l().join().replace(/\w+/g,
  320.                                     function (a) {
  321.                                         return b.createElem(a), b.frag.createElement(a), 'c("' + a + '")'
  322.                                     }) + ");return n}")(r, b.frag)
  323.         }
  324.  
  325.         function q(a) {
  326.             a || (a = b);
  327.             var c = m(a);
  328.             return r.shivCSS && !f && !c.hasCSS && (c.hasCSS =
  329.                     !!k(a, "article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")), j
  330.                     || p(a, c), a
  331.         }
  332.  
  333.         var c = a.html5
  334.                 || {}, d = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i, e = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i, f, g = "_html5shiv", h = 0, i = {}, j;
  335.         (function () {
  336.             try {
  337.                 var a = b.createElement("a");
  338.                 a.innerHTML = "<xyz></xyz>", f = "hidden"in a, j = a.childNodes.length == 1 || function () {
  339.                     b.createElement("a");
  340.                     var a = b.createDocumentFragment();
  341.                     return typeof a.cloneNode == "undefined" || typeof a.createDocumentFragment == "undefined" || typeof a.createElement
  342.                             == "undefined"
  343.                 }()
  344.             }
  345.             catch (c) {
  346.                 f = !0, j = !0
  347.             }
  348.         })();
  349.         var r = {elements: c.elements
  350.                 || "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video", shivCSS: c.shivCSS
  351.                 !== !1, supportsUnknownElements: j, shivMethods: c.shivMethods
  352.                 !== !1, type: "default", shivDocument: q, createElement: n, createDocumentFragment: o};
  353.         a.html5 = r, q(b)
  354.     }(this, b), e._version = d, e._prefixes = n, e._domPrefixes = q, e._cssomPrefixes = p, e.mq = z, e.hasEvent = A, e.testProp = function (a) {
  355.         return H([a])
  356.     }, e.testAllProps = J, e.testStyles = y, g.className = g.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (f ? " js " + v.join(" ") : ""), e
  357. }(this, this.document), function (a, b, c) {
  358.     function d(a) {
  359.         return"[object Function]" == o.call(a)
  360.     }
  361.  
  362.     function e(a) {
  363.         return"string" == typeof a
  364.     }
  365.  
  366.     function f() {
  367.     }
  368.  
  369.     function g(a) {
  370.         return!a || "loaded" == a || "complete" == a || "uninitialized" == a
  371.     }
  372.  
  373.     function h() {
  374.         var a = p.shift();
  375.         q = 1, a ? a.t ? m(function () {
  376.             ("c" == a.t ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1)
  377.         }, 0) : (a(), h()) : q = 0
  378.     }
  379.  
  380.     function i(a, c, d, e, f, i, j) {
  381.         function k(b) {
  382.             if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null, b)) {
  383.                 "img" != a && m(function () {
  384.                     t.removeChild(l)
  385.                 }, 50);
  386.                 for (var d in y[c]) {
  387.                     y[c].hasOwnProperty(d) && y[c][d].onload()
  388.                 }
  389.             }
  390.         }
  391.  
  392.         var j = j || B.errorTimeout, l = b.createElement(a), o = 0, r = 0, u = {t: d, s: c, e: f, a: i, x: j};
  393.         1 === y[c] && (r = 1, y[c] = []), "object" == a ? l.data = c : (l.src = c, l.type = a), l.width = l.height = "0", l.onerror =
  394.                 l.onload = l.onreadystatechange = function () {
  395.                     k.call(this, r)
  396.                 }, p.splice(e, 0, u), "img" != a && (r || 2 === y[c] ? (t.insertBefore(l, s ? null : n), m(k, j)) : y[c].push(l))
  397.     }
  398.  
  399.     function j(a, b, c, d, f) {
  400.         return q = 0, b = b || "j", e(a) ? i("c" == b ? v : u, a, b, this.i++, c, d, f) : (p.splice(this.i++, 0, a), 1 == p.length && h()), this
  401.     }
  402.  
  403.     function k() {
  404.         var a = B;
  405.         return a.loader = {load: j, i: 0}, a
  406.     }
  407.  
  408.     var l = b.documentElement, m = a.setTimeout, n = b.getElementsByTagName("script")[0], o = {}.toString, p = [], q = 0, r = "MozAppearance"
  409.             in l.style, s = r && !!b.createRange().compareNode, t = s ? l : n.parentNode, l = a.opera && "[object Opera]"
  410.             == o.call(a.opera), l = !!b.attachEvent && !l, u = r ? "object" : l ? "script" : "img", v = l ? "script" : u, w = Array.isArray
  411.             || function (a) {
  412.                 return"[object Array]" == o.call(a)
  413.             }, x = [], y = {}, z = {timeout: function (a, b) {
  414.         return b.length && (a.timeout = b[0]), a
  415.     }}, A, B;
  416.     B = function (a) {
  417.         function b(a) {
  418.             var a = a.split("!"), b = x.length, c = a.pop(), d = a.length, c = {url: c, origUrl: c, prefixes: a}, e, f, g;
  419.             for (f = 0; f < d; f++) {
  420.                 g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g));
  421.             }
  422.             for (f = 0; f < b; f++) {
  423.                 c = x[f](c);
  424.             }
  425.             return c
  426.         }
  427.  
  428.         function g(a, e, f, g, h) {
  429.             var i = b(a), j = i.autoCallback;
  430.             i.url.split(".").pop().split("?").shift(), i.bypass || (e && (e =
  431.                     d(e) ? e : e[a] || e[g] || e[a.split("/").pop().split("?")[0]]), i.instead ? i.instead(a, e, f, g, h) :
  432.                     (y[i.url] ? i.noexec = !0 : y[i.url] = 1, f.load(i.url,
  433.                                     i.forceCSS || !i.forceJS && "css" == i.url.split(".").pop().split("?").shift() ? "c" : c,
  434.                             i.noexec,
  435.                             i.attrs,
  436.                             i.timeout), (d(e) || d(j)) && f.load(function () {
  437.                         k(), e && e(i.origUrl, h, g), j && j(i.origUrl, h, g), y[i.url] = 2
  438.                     })))
  439.         }
  440.  
  441.         function h(a, b) {
  442.             function c(a, c) {
  443.                 if (a) {
  444.                     if (e(a)) {
  445.                         c || (j = function () {
  446.                             var a = [].slice.call(arguments);
  447.                             k.apply(this, a), l()
  448.                         }), g(a, j, b, 0, h);
  449.                     }
  450.                     else if (Object(a) === a) {
  451.                         for (n in m = function () {
  452.                             var b = 0, c;
  453.                             for (c in a) {
  454.                                 a.hasOwnProperty(c) && b++;
  455.                             }
  456.                             return b
  457.                         }(), a) {
  458.                             a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function () {
  459.                                 var a = [].slice.call(arguments);
  460.                                 k.apply(this, a), l()
  461.                             } : j[n] = function (a) {
  462.                                 return function () {
  463.                                     var b = [].slice.call(arguments);
  464.                                     a && a.apply(this, b), l()
  465.                                 }
  466.                             }(k[n])), g(a[n], j, b, n, h))
  467.                         }
  468.                     }
  469.                 }
  470.                 else {
  471.                     !c && l()
  472.                 }
  473.             }
  474.  
  475.             var h = !!a.test, i = a.load || a.both, j = a.callback || f, k = j, l = a.complete || f, m, n;
  476.             c(h ? a.yep : a.nope, !!i), i && c(i)
  477.         }
  478.  
  479.         var i, j, l = this.yepnope.loader;
  480.         if (e(a)) {
  481.             g(a, 0, l, 0);
  482.         }
  483.         else if (w(a)) {
  484.             for (i = 0; i < a.length; i++) {
  485.                 j = a[i], e(j) ? g(j, 0, l, 0) : w(j) ? B(j) : Object(j) === j && h(j, l);
  486.             }
  487.         }
  488.         else {
  489.             Object(a) === a && h(a, l)
  490.         }
  491.     }, B.addPrefix = function (a, b) {
  492.         z[a] = b
  493.     }, B.addFilter = function (a) {
  494.         x.push(a)
  495.     }, B.errorTimeout = 1e4, null == b.readyState && b.addEventListener && (b.readyState = "loading", b.addEventListener("DOMContentLoaded",
  496.             A = function () {
  497.                 b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete"
  498.             },
  499.             0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function (a, c, d, e, i, j) {
  500.         var k = b.createElement("script"), l, o, e = e || B.errorTimeout;
  501.         k.src = a;
  502.         for (o in d) {
  503.             k.setAttribute(o, d[o]);
  504.         }
  505.         c = j ? h : c || f, k.onreadystatechange = k.onload = function () {
  506.             !l && g(k.readyState) && (l = 1, c(), k.onload = k.onreadystatechange = null)
  507.         }, m(function () {
  508.             l || (l = 1, c(1))
  509.         }, e), i ? k.onload() : n.parentNode.insertBefore(k, n)
  510.     }, a.yepnope.injectCss = function (a, c, d, e, g, i) {
  511.         var e = b.createElement("link"), j, c = i ? h : c || f;
  512.         e.href = a, e.rel = "stylesheet", e.type = "text/css";
  513.         for (j in d) {
  514.             e.setAttribute(j, d[j]);
  515.         }
  516.         g || (n.parentNode.insertBefore(e, n), m(c, 0))
  517.     }
  518. }(this, document), Modernizr.load = function () {
  519.     yepnope.apply(window, [].slice.call(arguments, 0))
  520. };
  521.  
  522. (function (a) {
  523.     (jQuery.browser = jQuery.browser || {}).mobile =
  524.             /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|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(a)
  525.             || /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(a.substr(0,
  526.             4))
  527. })(navigator.userAgent || navigator.vendor || window.opera);
  528. ;
  529.  
  530. (function ($) {
  531.     var rotateLeft = function (lValue, iShiftBits) {
  532.         return(lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
  533.     }
  534.     var addUnsigned = function (lX, lY) {
  535.         var lX4, lY4, lX8, lY8, lResult;
  536.         lX8 = (lX & 0x80000000);
  537.         lY8 = (lY & 0x80000000);
  538.         lX4 = (lX & 0x40000000);
  539.         lY4 = (lY & 0x40000000);
  540.         lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
  541.         if (lX4 & lY4) {
  542.             return(lResult ^ 0x80000000 ^ lX8 ^ lY8);
  543.         }
  544.         if (lX4 | lY4) {
  545.             if (lResult & 0x40000000) {
  546.                 return(lResult ^ 0xC0000000 ^ lX8 ^ lY8);
  547.             }
  548.             else {
  549.                 return(lResult ^ 0x40000000 ^ lX8 ^ lY8);
  550.             }
  551.         }
  552.         else {
  553.             return(lResult ^ lX8 ^ lY8);
  554.         }
  555.     }
  556.     var F = function (x, y, z) {
  557.         return(x & y) | ((~x) & z);
  558.     }
  559.     var G = function (x, y, z) {
  560.         return(x & z) | (y & (~z));
  561.     }
  562.     var H = function (x, y, z) {
  563.         return(x ^ y ^ z);
  564.     }
  565.     var I = function (x, y, z) {
  566.         return(y ^ (x | (~z)));
  567.     }
  568.     var FF = function (a, b, c, d, x, s, ac) {
  569.         a = addUnsigned(a, addUnsigned(addUnsigned(F(b, c, d), x), ac));
  570.         return addUnsigned(rotateLeft(a, s), b);
  571.     };
  572.     var GG = function (a, b, c, d, x, s, ac) {
  573.         a = addUnsigned(a, addUnsigned(addUnsigned(G(b, c, d), x), ac));
  574.         return addUnsigned(rotateLeft(a, s), b);
  575.     };
  576.     var HH = function (a, b, c, d, x, s, ac) {
  577.         a = addUnsigned(a, addUnsigned(addUnsigned(H(b, c, d), x), ac));
  578.         return addUnsigned(rotateLeft(a, s), b);
  579.     };
  580.     var II = function (a, b, c, d, x, s, ac) {
  581.         a = addUnsigned(a, addUnsigned(addUnsigned(I(b, c, d), x), ac));
  582.         return addUnsigned(rotateLeft(a, s), b);
  583.     };
  584.     var convertToWordArray = function (string) {
  585.         var lWordCount;
  586.         var lMessageLength = string.length;
  587.         var lNumberOfWordsTempOne = lMessageLength + 8;
  588.         var lNumberOfWordsTempTwo = (lNumberOfWordsTempOne - (lNumberOfWordsTempOne % 64)) / 64;
  589.         var lNumberOfWords = (lNumberOfWordsTempTwo + 1) * 16;
  590.         var lWordArray = Array(lNumberOfWords - 1);
  591.         var lBytePosition = 0;
  592.         var lByteCount = 0;
  593.         while (lByteCount < lMessageLength) {
  594.             lWordCount = (lByteCount - (lByteCount % 4)) / 4;
  595.             lBytePosition = (lByteCount % 4) * 8;
  596.             lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
  597.             lByteCount++;
  598.         }
  599.         lWordCount = (lByteCount - (lByteCount % 4)) / 4;
  600.         lBytePosition = (lByteCount % 4) * 8;
  601.         lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
  602.         lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
  603.         lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
  604.         return lWordArray;
  605.     };
  606.     var wordToHex = function (lValue) {
  607.         var WordToHexValue = "", WordToHexValueTemp = "", lByte, lCount;
  608.         for (lCount = 0; lCount <= 3; lCount++) {
  609.             lByte = (lValue >>> (lCount * 8)) & 255;
  610.             WordToHexValueTemp = "0" + lByte.toString(16);
  611.             WordToHexValue = WordToHexValue + WordToHexValueTemp.substr(WordToHexValueTemp.length - 2, 2);
  612.         }
  613.         return WordToHexValue;
  614.     };
  615.     var uTF8Encode = function (string) {
  616.         string = string.replace(/\x0d\x0a/g, "\x0a");
  617.         var output = "";
  618.         for (var n = 0; n < string.length; n++) {
  619.             var c = string.charCodeAt(n);
  620.             if (c < 128) {
  621.                 output += String.fromCharCode(c);
  622.             }
  623.             else if ((c > 127) && (c < 2048)) {
  624.                 output += String.fromCharCode((c >> 6) | 192);
  625.                 output += String.fromCharCode((c & 63) | 128);
  626.             }
  627.             else {
  628.                 output += String.fromCharCode((c >> 12) | 224);
  629.                 output += String.fromCharCode(((c >> 6) & 63) | 128);
  630.                 output += String.fromCharCode((c & 63) | 128);
  631.             }
  632.         }
  633.         return output;
  634.     };
  635.     $.extend({md5: function (string) {
  636.         var x = Array();
  637.         var k, AA, BB, CC, DD, a, b, c, d;
  638.         var S11 = 7, S12 = 12, S13 = 17, S14 = 22;
  639.         var S21 = 5, S22 = 9, S23 = 14, S24 = 20;
  640.         var S31 = 4, S32 = 11, S33 = 16, S34 = 23;
  641.         var S41 = 6, S42 = 10, S43 = 15, S44 = 21;
  642.         string = uTF8Encode(string);
  643.         x = convertToWordArray(string);
  644.         a = 0x67452301;
  645.         b = 0xEFCDAB89;
  646.         c = 0x98BADCFE;
  647.         d = 0x10325476;
  648.         for (k = 0; k < x.length; k += 16) {
  649.             AA = a;
  650.             BB = b;
  651.             CC = c;
  652.             DD = d;
  653.             a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
  654.             d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
  655.             c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
  656.             b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
  657.             a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
  658.             d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
  659.             c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
  660.             b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
  661.             a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
  662.             d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
  663.             c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
  664.             b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
  665.             a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
  666.             d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
  667.             c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
  668.             b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
  669.             a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
  670.             d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
  671.             c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
  672.             b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
  673.             a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
  674.             d = GG(d, a, b, c, x[k + 10], S22, 0x2441453);
  675.             c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
  676.             b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
  677.             a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
  678.             d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
  679.             c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
  680.             b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
  681.             a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
  682.             d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
  683.             c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
  684.             b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
  685.             a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
  686.             d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
  687.             c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
  688.             b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
  689.             a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
  690.             d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
  691.             c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
  692.             b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
  693.             a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
  694.             d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
  695.             c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
  696.             b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
  697.             a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
  698.             d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
  699.             c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
  700.             b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
  701.             a = II(a, b, c, d, x[k + 0], S41, 0xF4292244);
  702.             d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
  703.             c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
  704.             b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
  705.             a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
  706.             d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
  707.             c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
  708.             b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
  709.             a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
  710.             d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
  711.             c = II(c, d, a, b, x[k + 6], S43, 0xA3014314);
  712.             b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
  713.             a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
  714.             d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
  715.             c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
  716.             b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
  717.             a = addUnsigned(a, AA);
  718.             b = addUnsigned(b, BB);
  719.             c = addUnsigned(c, CC);
  720.             d = addUnsigned(d, DD);
  721.         }
  722.         var tempValue = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
  723.         return tempValue.toLowerCase();
  724.     }});
  725. })(jQuery);
  726. ;
  727.  
  728. var JSON;
  729. if (!JSON) {
  730.     JSON = {};
  731. }
  732. (function () {
  733.     'use strict';
  734.     function f(n) {
  735.         return n < 10 ? '0' + n : n;
  736.     }
  737.  
  738.     if (typeof Date.prototype.toJSON !== 'function') {
  739.         Date.prototype.toJSON = function (key) {
  740.             return isFinite(this.valueOf()) ?
  741.                     this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':'
  742.                     + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z' : null;
  743.         };
  744.         String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (key) {
  745.             return this.valueOf();
  746.         };
  747.     }
  748.     var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\'}, rep;
  749.  
  750.     function quote(string) {
  751.         escapable.lastIndex = 0;
  752.         return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
  753.             var c = meta[a];
  754.             return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
  755.         }) + '"' : '"' + string + '"';
  756.     }
  757.  
  758.     function str(key, holder) {
  759.         var i, k, v, length, mind = gap, partial, value = holder[key];
  760.         if (value && typeof value === 'object' && typeof value.toJSON === 'function') {
  761.             value = value.toJSON(key);
  762.         }
  763.         if (typeof rep === 'function') {
  764.             value = rep.call(holder, key, value);
  765.         }
  766.         switch (typeof value) {
  767.             case'string':
  768.                 return quote(value);
  769.             case'number':
  770.                 return isFinite(value) ? String(value) : 'null';
  771.             case'boolean':
  772.             case'null':
  773.                 return String(value);
  774.             case'object':
  775.                 if (!value) {
  776.                     return'null';
  777.                 }
  778.                 gap += indent;
  779.                 partial = [];
  780.                 if (Object.prototype.toString.apply(value) === '[object Array]') {
  781.                     length = value.length;
  782.                     for (i = 0; i < length; i += 1) {
  783.                         partial[i] = str(i, value) || 'null';
  784.                     }
  785.                     v =
  786.                                     partial.length === 0 ? '[]' :
  787.                             gap ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : '[' + partial.join(',') + ']';
  788.                     gap = mind;
  789.                     return v;
  790.                 }
  791.                 if (rep && typeof rep === 'object') {
  792.                     length = rep.length;
  793.                     for (i = 0; i < length; i += 1) {
  794.                         if (typeof rep[i] === 'string') {
  795.                             k = rep[i];
  796.                             v = str(k, value);
  797.                             if (v) {
  798.                                 partial.push(quote(k) + (gap ? ': ' : ':') + v);
  799.                             }
  800.                         }
  801.                     }
  802.                 }
  803.                 else {
  804.                     for (k in value) {
  805.                         if (Object.prototype.hasOwnProperty.call(value, k)) {
  806.                             v = str(k, value);
  807.                             if (v) {
  808.                                 partial.push(quote(k) + (gap ? ': ' : ':') + v);
  809.                             }
  810.                         }
  811.                     }
  812.                 }
  813.                 v = partial.length === 0 ? '{}' : gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : '{' + partial.join(',') + '}';
  814.                 gap = mind;
  815.                 return v;
  816.         }
  817.     }
  818.  
  819.     if (typeof JSON.stringify !== 'function') {
  820.         JSON.stringify = function (value, replacer, space) {
  821.             var i;
  822.             gap = '';
  823.             indent = '';
  824.             if (typeof space === 'number') {
  825.                 for (i = 0; i < space; i += 1) {
  826.                     indent += ' ';
  827.                 }
  828.             }
  829.             else if (typeof space === 'string') {
  830.                 indent = space;
  831.             }
  832.             rep = replacer;
  833.             if (replacer && typeof replacer !== 'function' && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) {
  834.                 throw new Error('JSON.stringify');
  835.             }
  836.             return str('', {'': value});
  837.         };
  838.     }
  839.     if (typeof JSON.parse !== 'function') {
  840.         JSON.parse = function (text, reviver) {
  841.             var j;
  842.  
  843.             function walk(holder, key) {
  844.                 var k, v, value = holder[key];
  845.                 if (value && typeof value === 'object') {
  846.                     for (k in value) {
  847.                         if (Object.prototype.hasOwnProperty.call(value, k)) {
  848.                             v = walk(value, k);
  849.                             if (v !== undefined) {
  850.                                 value[k] = v;
  851.                             }
  852.                             else {
  853.                                 delete value[k];
  854.                             }
  855.                         }
  856.                     }
  857.                 }
  858.                 return reviver.call(holder, key, value);
  859.             }
  860.  
  861.             text = String(text);
  862.             cx.lastIndex = 0;
  863.             if (cx.test(text)) {
  864.                 text = text.replace(cx, function (a) {
  865.                     return'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
  866.                 });
  867.             }
  868.             if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
  869.                     '@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
  870.                 j = eval('(' + text + ')');
  871.                 return typeof reviver === 'function' ? walk({'': j}, '') : j;
  872.             }
  873.             throw new SyntaxError('JSON.parse');
  874.         };
  875.     }
  876. }());
  877. ;
  878.  
  879. (function () {
  880.     var JSTORAGE_VERSION = "0.3.0", $ = window.jQuery || window.$ || (window.$ = {}), JSON = {parse: window.JSON && (window.JSON.parse
  881.                     || window.JSON.decode) || String.prototype.evalJSON && function (str) {
  882.                 return String(str).evalJSON();
  883.             } || $.parseJSON || $.evalJSON, stringify: Object.toJSON || window.JSON && (window.JSON.stringify || window.JSON.encode) || $.toJSON};
  884.     if (!JSON.parse || !JSON.stringify) {
  885.         throw new Error("No JSON support found, include //cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js to page");
  886.     }
  887.     var _storage = {}, _storage_service = {jStorage: "{}"}, _storage_elm = null, _storage_size = 0, _backend = false, _observers = {}, _observer_timeout = false, _observer_update = 0, _pubsub_observers = {}, _pubsub_last = +new Date(), _ttl_timeout, _crc32Table = "00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 "
  888.                     + "0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 "
  889.                     + "6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 "
  890.                     + "FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 "
  891.                     + "A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 "
  892.                     + "32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 "
  893.                     + "56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 "
  894.                     + "C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 "
  895.                     + "E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 "
  896.                     + "6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 "
  897.                     + "12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE "
  898.                     + "A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 "
  899.                     + "DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 "
  900.                     + "5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 "
  901.                     + "2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF "
  902.                     + "04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 "
  903.                     + "7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 "
  904.                     + "FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 "
  905.                     + "A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C "
  906.                     + "36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 "
  907.                     + "5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 "
  908.                     + "C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 "
  909.                     + "EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D "
  910.                     + "7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 "
  911.                     + "18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 "
  912.                     + "A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A "
  913.                     + "D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A "
  914.                     + "53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 "
  915.                     + "2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D", _XMLService = {isXML: function (elm) {
  916.                 var documentElement = (elm ? elm.ownerDocument || elm : 0).documentElement;
  917.                 return documentElement ? documentElement.nodeName !== "HTML" : false;
  918.             }, encode: function (xmlNode) {
  919.                 if (!this.isXML(xmlNode)) {
  920.                     return false;
  921.                 }
  922.                 try {
  923.                     return new XMLSerializer().serializeToString(xmlNode);
  924.                 }
  925.                 catch (E1) {
  926.                     try {
  927.                         return xmlNode.xml;
  928.                     }
  929.                     catch (E2) {
  930.                     }
  931.                 }
  932.                 return false;
  933.             }, decode: function (xmlString) {
  934.                 var dom_parser = ("DOMParser"in window && (new DOMParser()).parseFromString) || (window.ActiveXObject && function (_xmlString) {
  935.                     var xml_doc = new ActiveXObject('Microsoft.XMLDOM');
  936.                     xml_doc.async = 'false';
  937.                     xml_doc.loadXML(_xmlString);
  938.                     return xml_doc;
  939.                 }), resultXML;
  940.                 if (!dom_parser) {
  941.                     return false;
  942.                 }
  943.                 resultXML = dom_parser.call("DOMParser"in window && (new DOMParser()) || window, xmlString, 'text/xml');
  944.                 return this.isXML(resultXML) ? resultXML : false;
  945.             }}, _localStoragePolyfillSetKey = function () {
  946.             };
  947.  
  948.     function _init() {
  949.         var localStorageReallyWorks = false;
  950.         if ("localStorage"in window) {
  951.             try {
  952.                 window.localStorage.setItem('_tmptest', 'tmpval');
  953.                 localStorageReallyWorks = true;
  954.                 window.localStorage.removeItem('_tmptest');
  955.             }
  956.             catch (BogusQuotaExceededErrorOnIos5) {
  957.             }
  958.         }
  959.         if (localStorageReallyWorks) {
  960.             try {
  961.                 if (window.localStorage) {
  962.                     _storage_service = window.localStorage;
  963.                     _backend = "localStorage";
  964.                     _observer_update = _storage_service.jStorage_update;
  965.                 }
  966.             }
  967.             catch (E3) {
  968.             }
  969.         }
  970.         else if ("globalStorage"in window) {
  971.             try {
  972.                 if (window.globalStorage) {
  973.                     _storage_service = window.globalStorage[window.location.hostname];
  974.                     _backend = "globalStorage";
  975.                     _observer_update = _storage_service.jStorage_update;
  976.                 }
  977.             }
  978.             catch (E4) {
  979.             }
  980.         }
  981.         else {
  982.             _storage_elm = document.createElement('link');
  983.             if (_storage_elm.addBehavior) {
  984.                 _storage_elm.style.behavior = 'url(#default#userData)';
  985.                 document.getElementsByTagName('head')[0].appendChild(_storage_elm);
  986.                 try {
  987.                     _storage_elm.load("jStorage");
  988.                 }
  989.                 catch (E) {
  990.                     _storage_elm.setAttribute("jStorage", "{}");
  991.                     _storage_elm.save("jStorage");
  992.                     _storage_elm.load("jStorage");
  993.                 }
  994.                 var data = "{}";
  995.                 try {
  996.                     data = _storage_elm.getAttribute("jStorage");
  997.                 }
  998.                 catch (E5) {
  999.                 }
  1000.                 try {
  1001.                     _observer_update = _storage_elm.getAttribute("jStorage_update");
  1002.                 }
  1003.                 catch (E6) {
  1004.                 }
  1005.                 _storage_service.jStorage = data;
  1006.                 _backend = "userDataBehavior";
  1007.             }
  1008.             else {
  1009.                 _storage_elm = null;
  1010.                 return;
  1011.             }
  1012.         }
  1013.         _load_storage();
  1014.         _handleTTL();
  1015.         _createPolyfillStorage("local");
  1016.         _createPolyfillStorage("session");
  1017.         _setupObserver();
  1018.         _handlePubSub();
  1019.         if ("addEventListener"in window) {
  1020.             window.addEventListener("pageshow", function (event) {
  1021.                 if (event.persisted) {
  1022.                     _storageObserver();
  1023.                 }
  1024.             }, false);
  1025.         }
  1026.     }
  1027.  
  1028.     function _createPolyfillStorage(type, forceCreate) {
  1029.         var _skipSave = false, _length = 0, i, storage, storage_source = {};
  1030.         var rand = Math.random();
  1031.         if (!forceCreate && typeof window[type + "Storage"] != "undefined") {
  1032.             return;
  1033.         }
  1034.         if (type == "local" && window.globalStorage) {
  1035.             localStorage = window.globalStorage[window.location.hostname];
  1036.             return;
  1037.         }
  1038.         if (_backend != "userDataBehavior") {
  1039.             return;
  1040.         }
  1041.         if (forceCreate && window[type + "Storage"] && window[type + "Storage"].parentNode) {
  1042.             window[type + "Storage"].parentNode.removeChild(window[type + "Storage"]);
  1043.         }
  1044.         storage = document.createElement("button");
  1045.         document.getElementsByTagName('head')[0].appendChild(storage);
  1046.         if (type == "local") {
  1047.             storage_source = _storage;
  1048.         }
  1049.         else if (type == "session") {
  1050.             _sessionStoragePolyfillUpdate();
  1051.         }
  1052.         for (i in storage_source) {
  1053.             if (storage_source.hasOwnProperty(i) && i != "__jstorage_meta" && i != "length" && typeof storage_source[i] != "undefined") {
  1054.                 if (!(i in storage)) {
  1055.                     _length++;
  1056.                 }
  1057.                 storage[i] = storage_source[i];
  1058.             }
  1059.         }
  1060.         storage.length = _length;
  1061.         storage.key = function (n) {
  1062.             var count = 0, i;
  1063.             _sessionStoragePolyfillUpdate();
  1064.             for (i in storage_source) {
  1065.                 if (storage_source.hasOwnProperty(i) && i != "__jstorage_meta" && i != "length" && typeof storage_source[i] != "undefined") {
  1066.                     if (count == n) {
  1067.                         return i;
  1068.                     }
  1069.                     count++;
  1070.                 }
  1071.             }
  1072.         }
  1073.         storage.getItem = function (key) {
  1074.             _sessionStoragePolyfillUpdate();
  1075.             if (type == "session") {
  1076.                 return storage_source[key];
  1077.             }
  1078.             return $.jStorage.get(key);
  1079.         }
  1080.         storage.setItem = function (key, value) {
  1081.             if (typeof value == "undefined") {
  1082.                 return;
  1083.             }
  1084.             storage[key] = (value || "").toString();
  1085.         }
  1086.         storage.removeItem = function (key) {
  1087.             if (type == "local") {
  1088.                 return $.jStorage.deleteKey(key);
  1089.             }
  1090.             storage[key] = undefined;
  1091.             _skipSave = true;
  1092.             if (key in storage) {
  1093.                 storage.removeAttribute(key);
  1094.             }
  1095.             _skipSave = false;
  1096.         }
  1097.         storage.clear = function () {
  1098.             if (type == "session") {
  1099.                 window.name = "";
  1100.                 _createPolyfillStorage("session", true);
  1101.                 return;
  1102.             }
  1103.             $.jStorage.flush();
  1104.         }
  1105.         if (type == "local") {
  1106.             _localStoragePolyfillSetKey = function (key, value) {
  1107.                 if (key == "length") {
  1108.                     return;
  1109.                 }
  1110.                 _skipSave = true;
  1111.                 if (typeof value == "undefined") {
  1112.                     if (key in storage) {
  1113.                         _length--;
  1114.                         storage.removeAttribute(key);
  1115.                     }
  1116.                 }
  1117.                 else {
  1118.                     if (!(key in storage)) {
  1119.                         _length++;
  1120.                     }
  1121.                     storage[key] = (value || "").toString();
  1122.                 }
  1123.                 storage.length = _length;
  1124.                 _skipSave = false;
  1125.             }
  1126.         }
  1127.         function _sessionStoragePolyfillUpdate() {
  1128.             if (type != "session") {
  1129.                 return;
  1130.             }
  1131.             try {
  1132.                 storage_source = JSON.parse(window.name || "{}");
  1133.             }
  1134.             catch (E) {
  1135.                 storage_source = {};
  1136.             }
  1137.         }
  1138.  
  1139.         function _sessionStoragePolyfillSave() {
  1140.             if (type != "session") {
  1141.                 return;
  1142.             }
  1143.             window.name = JSON.stringify(storage_source);
  1144.         };
  1145.         storage.attachEvent("onpropertychange", function (e) {
  1146.             if (e.propertyName == "length") {
  1147.                 return;
  1148.             }
  1149.             if (_skipSave || e.propertyName == "length") {
  1150.                 return;
  1151.             }
  1152.             if (type == "local") {
  1153.                 if (!(e.propertyName in storage_source) && typeof storage[e.propertyName] != "undefined") {
  1154.                     _length++;
  1155.                 }
  1156.             }
  1157.             else if (type == "session") {
  1158.                 _sessionStoragePolyfillUpdate();
  1159.                 if (typeof storage[e.propertyName] != "undefined" && !(e.propertyName in storage_source)) {
  1160.                     storage_source[e.propertyName] = storage[e.propertyName];
  1161.                     _length++;
  1162.                 }
  1163.                 else if (typeof storage[e.propertyName] == "undefined" && e.propertyName in storage_source) {
  1164.                     delete storage_source[e.propertyName];
  1165.                     _length--;
  1166.                 }
  1167.                 else {
  1168.                     storage_source[e.propertyName] = storage[e.propertyName];
  1169.                 }
  1170.                 _sessionStoragePolyfillSave();
  1171.                 storage.length = _length;
  1172.                 return;
  1173.             }
  1174.             $.jStorage.set(e.propertyName, storage[e.propertyName]);
  1175.             storage.length = _length;
  1176.         });
  1177.         window[type + "Storage"] = storage;
  1178.     }
  1179.  
  1180.     function _reloadData() {
  1181.         var data = "{}";
  1182.         if (_backend == "userDataBehavior") {
  1183.             _storage_elm.load("jStorage");
  1184.             try {
  1185.                 data = _storage_elm.getAttribute("jStorage");
  1186.             }
  1187.             catch (E5) {
  1188.             }
  1189.             try {
  1190.                 _observer_update = _storage_elm.getAttribute("jStorage_update");
  1191.             }
  1192.             catch (E6) {
  1193.             }
  1194.             _storage_service.jStorage = data;
  1195.         }
  1196.         _load_storage();
  1197.         _handleTTL();
  1198.         _handlePubSub();
  1199.     }
  1200.  
  1201.     function _setupObserver() {
  1202.         if (_backend == "localStorage" || _backend == "globalStorage") {
  1203.             if ("addEventListener"in window) {
  1204.                 window.addEventListener("storage", _storageObserver, false);
  1205.             }
  1206.             else {
  1207.                 document.attachEvent("onstorage", _storageObserver);
  1208.             }
  1209.         }
  1210.         else if (_backend == "userDataBehavior") {
  1211.             setInterval(_storageObserver, 1000);
  1212.         }
  1213.     }
  1214.  
  1215.     function _storageObserver() {
  1216.         var updateTime;
  1217.         clearTimeout(_observer_timeout);
  1218.         _observer_timeout = setTimeout(function () {
  1219.             if (_backend == "localStorage" || _backend == "globalStorage") {
  1220.                 updateTime = _storage_service.jStorage_update;
  1221.             }
  1222.             else if (_backend == "userDataBehavior") {
  1223.                 _storage_elm.load("jStorage");
  1224.                 try {
  1225.                     updateTime = _storage_elm.getAttribute("jStorage_update");
  1226.                 }
  1227.                 catch (E5) {
  1228.                 }
  1229.             }
  1230.             if (updateTime && updateTime != _observer_update) {
  1231.                 _observer_update = updateTime;
  1232.                 _checkUpdatedKeys();
  1233.             }
  1234.         }, 25);
  1235.     }
  1236.  
  1237.     function _checkUpdatedKeys() {
  1238.         var oldCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32)), newCrc32List;
  1239.         _reloadData();
  1240.         newCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32));
  1241.         var key, updated = [], removed = [];
  1242.         for (key in oldCrc32List) {
  1243.             if (oldCrc32List.hasOwnProperty(key)) {
  1244.                 if (!newCrc32List[key]) {
  1245.                     removed.push(key);
  1246.                     continue;
  1247.                 }
  1248.                 if (oldCrc32List[key] != newCrc32List[key]) {
  1249.                     updated.push(key);
  1250.                 }
  1251.             }
  1252.         }
  1253.         for (key in newCrc32List) {
  1254.             if (newCrc32List.hasOwnProperty(key)) {
  1255.                 if (!oldCrc32List[key]) {
  1256.                     updated.push(key);
  1257.                 }
  1258.             }
  1259.         }
  1260.         _fireObservers(updated, "updated");
  1261.         _fireObservers(removed, "deleted");
  1262.     }
  1263.  
  1264.     function _fireObservers(keys, action) {
  1265.         keys = [].concat(keys || []);
  1266.         if (action == "flushed") {
  1267.             keys = [];
  1268.             for (var key in _observers) {
  1269.                 if (_observers.hasOwnProperty(key)) {
  1270.                     keys.push(key);
  1271.                 }
  1272.             }
  1273.             action = "deleted";
  1274.         }
  1275.         for (var i = 0, len = keys.length; i < len; i++) {
  1276.             if (_observers[keys[i]]) {
  1277.                 for (var j = 0, jlen = _observers[keys[i]].length; j < jlen; j++) {
  1278.                     _observers[keys[i]][j](keys[i], action);
  1279.                 }
  1280.             }
  1281.         }
  1282.     }
  1283.  
  1284.     function _publishChange() {
  1285.         var updateTime = (+new Date()).toString();
  1286.         if (_backend == "localStorage" || _backend == "globalStorage") {
  1287.             _storage_service.jStorage_update = updateTime;
  1288.         }
  1289.         else if (_backend == "userDataBehavior") {
  1290.             _storage_elm.setAttribute("jStorage_update", updateTime);
  1291.             _storage_elm.save("jStorage");
  1292.         }
  1293.         _storageObserver();
  1294.     }
  1295.  
  1296.     function _load_storage() {
  1297.         if (_storage_service.jStorage) {
  1298.             try {
  1299.                 _storage = JSON.parse(String(_storage_service.jStorage));
  1300.             }
  1301.             catch (E6) {
  1302.                 _storage_service.jStorage = "{}";
  1303.             }
  1304.         }
  1305.         else {
  1306.             _storage_service.jStorage = "{}";
  1307.         }
  1308.         _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
  1309.         if (!_storage.__jstorage_meta) {
  1310.             _storage.__jstorage_meta = {};
  1311.         }
  1312.         if (!_storage.__jstorage_meta.CRC32) {
  1313.             _storage.__jstorage_meta.CRC32 = {};
  1314.         }
  1315.     }
  1316.  
  1317.     function _save() {
  1318.         _dropOldEvents();
  1319.         try {
  1320.             _storage_service.jStorage = JSON.stringify(_storage);
  1321.             if (_storage_elm) {
  1322.                 _storage_elm.setAttribute("jStorage", _storage_service.jStorage);
  1323.                 _storage_elm.save("jStorage");
  1324.             }
  1325.             _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
  1326.         }
  1327.         catch (E7) {
  1328.         }
  1329.     }
  1330.  
  1331.     function _checkKey(key) {
  1332.         if (!key || (typeof key != "string" && typeof key != "number")) {
  1333.             throw new TypeError('Key name must be string or numeric');
  1334.         }
  1335.         if (key == "__jstorage_meta") {
  1336.             throw new TypeError('Reserved key name');
  1337.         }
  1338.         return true;
  1339.     }
  1340.  
  1341.     function _handleTTL() {
  1342.         var curtime, i, TTL, CRC32, nextExpire = Infinity, changed = false, deleted = [];
  1343.         clearTimeout(_ttl_timeout);
  1344.         if (!_storage.__jstorage_meta || typeof _storage.__jstorage_meta.TTL != "object") {
  1345.             return;
  1346.         }
  1347.         curtime = +new Date();
  1348.         TTL = _storage.__jstorage_meta.TTL;
  1349.         CRC32 = _storage.__jstorage_meta.CRC32;
  1350.         for (i in TTL) {
  1351.             if (TTL.hasOwnProperty(i)) {
  1352.                 if (TTL[i] <= curtime) {
  1353.                     delete TTL[i];
  1354.                     delete CRC32[i];
  1355.                     delete _storage[i];
  1356.                     changed = true;
  1357.                     deleted.push(i);
  1358.                 }
  1359.                 else if (TTL[i] < nextExpire) {
  1360.                     nextExpire = TTL[i];
  1361.                 }
  1362.             }
  1363.         }
  1364.         if (nextExpire != Infinity) {
  1365.             _ttl_timeout = setTimeout(_handleTTL, nextExpire - curtime);
  1366.         }
  1367.         if (changed) {
  1368.             _save();
  1369.             _publishChange();
  1370.             _fireObservers(deleted, "deleted");
  1371.         }
  1372.     }
  1373.  
  1374.     function _handlePubSub() {
  1375.         if (!_storage.__jstorage_meta.PubSub) {
  1376.             return;
  1377.         }
  1378.         var pubelm, _pubsubCurrent = _pubsub_last;
  1379.         for (var i = len = _storage.__jstorage_meta.PubSub.length - 1; i >= 0; i--) {
  1380.             pubelm = _storage.__jstorage_meta.PubSub[i];
  1381.             if (pubelm[0] > _pubsub_last) {
  1382.                 _pubsubCurrent = pubelm[0];
  1383.                 _fireSubscribers(pubelm[1], pubelm[2]);
  1384.             }
  1385.         }
  1386.         _pubsub_last = _pubsubCurrent;
  1387.     }
  1388.  
  1389.     function _fireSubscribers(channel, payload) {
  1390.         if (_pubsub_observers[channel]) {
  1391.             for (var i = 0, len = _pubsub_observers[channel].length; i < len; i++) {
  1392.                 _pubsub_observers[channel][i](channel, JSON.parse(JSON.stringify(payload)));
  1393.             }
  1394.         }
  1395.     }
  1396.  
  1397.     function _dropOldEvents() {
  1398.         if (!_storage.__jstorage_meta.PubSub) {
  1399.             return;
  1400.         }
  1401.         var retire = +new Date() - 2000;
  1402.         for (var i = 0, len = _storage.__jstorage_meta.PubSub.length; i < len; i++) {
  1403.             if (_storage.__jstorage_meta.PubSub[i][0] <= retire) {
  1404.                 _storage.__jstorage_meta.PubSub.splice(i, _storage.__jstorage_meta.PubSub.length - i);
  1405.                 break;
  1406.             }
  1407.         }
  1408.         if (!_storage.__jstorage_meta.PubSub.length) {
  1409.             delete _storage.__jstorage_meta.PubSub;
  1410.         }
  1411.     }
  1412.  
  1413.     function _publish(channel, payload) {
  1414.         if (!_storage.__jstorage_meta) {
  1415.             _storage.__jstorage_meta = {};
  1416.         }
  1417.         if (!_storage.__jstorage_meta.PubSub) {
  1418.             _storage.__jstorage_meta.PubSub = [];
  1419.         }
  1420.         _storage.__jstorage_meta.PubSub.unshift([+new Date, channel, payload]);
  1421.         _save();
  1422.         _publishChange();
  1423.     }
  1424.  
  1425.     function _crc32(str, crc) {
  1426.         crc = crc || 0;
  1427.         var n = 0, x = 0;
  1428.         crc = crc ^ (-1);
  1429.         for (var i = 0, len = str.length; i < len; i++) {
  1430.             n = (crc ^ str.charCodeAt(i)) & 0xFF;
  1431.             x = "0x" + _crc32Table.substr(n * 9, 8);
  1432.             crc = (crc >>> 8) ^ x;
  1433.         }
  1434.         return crc ^ (-1);
  1435.     }
  1436.  
  1437.     $.jStorage = {version: JSTORAGE_VERSION, set: function (key, value, options) {
  1438.         _checkKey(key);
  1439.         options = options || {};
  1440.         if (typeof value == "undefined") {
  1441.             this.deleteKey(key);
  1442.             return value;
  1443.         }
  1444.         if (_XMLService.isXML(value)) {
  1445.             value = {_is_xml: true, xml: _XMLService.encode(value)};
  1446.         }
  1447.         else if (typeof value == "function") {
  1448.             return undefined;
  1449.         }
  1450.         else if (value && typeof value == "object") {
  1451.             value = JSON.parse(JSON.stringify(value));
  1452.         }
  1453.         _storage[key] = value;
  1454.         _storage.__jstorage_meta.CRC32[key] = _crc32(JSON.stringify(value));
  1455.         this.setTTL(key, options.TTL || 0);
  1456.         _localStoragePolyfillSetKey(key, value);
  1457.         _fireObservers(key, "updated");
  1458.         return value;
  1459.     }, get: function (key, def) {
  1460.         _checkKey(key);
  1461.         if (key in _storage) {
  1462.             if (_storage[key] && typeof _storage[key] == "object" && _storage[key]._is_xml && _storage[key]._is_xml) {
  1463.                 return _XMLService.decode(_storage[key].xml);
  1464.             }
  1465.             else {
  1466.                 return _storage[key];
  1467.             }
  1468.         }
  1469.         return typeof(def) == 'undefined' ? null : def;
  1470.     }, deleteKey: function (key) {
  1471.         _checkKey(key);
  1472.         if (key in _storage) {
  1473.             delete _storage[key];
  1474.             if (typeof _storage.__jstorage_meta.TTL == "object" && key in _storage.__jstorage_meta.TTL) {
  1475.                 delete _storage.__jstorage_meta.TTL[key];
  1476.             }
  1477.             delete _storage.__jstorage_meta.CRC32[key];
  1478.             _localStoragePolyfillSetKey(key, undefined);
  1479.             _save();
  1480.             _publishChange();
  1481.             _fireObservers(key, "deleted");
  1482.             return true;
  1483.         }
  1484.         return false;
  1485.     }, setTTL: function (key, ttl) {
  1486.         var curtime = +new Date();
  1487.         _checkKey(key);
  1488.         ttl = Number(ttl) || 0;
  1489.         if (key in _storage) {
  1490.             if (!_storage.__jstorage_meta.TTL) {
  1491.                 _storage.__jstorage_meta.TTL = {};
  1492.             }
  1493.             if (ttl > 0) {
  1494.                 _storage.__jstorage_meta.TTL[key] = curtime + ttl;
  1495.             }
  1496.             else {
  1497.                 delete _storage.__jstorage_meta.TTL[key];
  1498.             }
  1499.             _save();
  1500.             _handleTTL();
  1501.             _publishChange();
  1502.             return true;
  1503.         }
  1504.         return false;
  1505.     }, getTTL: function (key) {
  1506.         var curtime = +new Date(), ttl;
  1507.         _checkKey(key);
  1508.         if (key in _storage && _storage.__jstorage_meta.TTL && _storage.__jstorage_meta.TTL[key]) {
  1509.             ttl = _storage.__jstorage_meta.TTL[key] - curtime;
  1510.             return ttl || 0;
  1511.         }
  1512.         return 0;
  1513.     }, flush: function () {
  1514.         _storage = {__jstorage_meta: {CRC32: {}}};
  1515.         _createPolyfillStorage("local", true);
  1516.         _save();
  1517.         _publishChange();
  1518.         _fireObservers(null, "flushed");
  1519.         return true;
  1520.     }, storageObj: function () {
  1521.         function F() {
  1522.         }
  1523.  
  1524.         F.prototype = _storage;
  1525.         return new F();
  1526.     }, index: function () {
  1527.         var index = [], i;
  1528.         for (i in _storage) {
  1529.             if (_storage.hasOwnProperty(i) && i != "__jstorage_meta") {
  1530.                 index.push(i);
  1531.             }
  1532.         }
  1533.         return index;
  1534.     }, storageSize: function () {
  1535.         return _storage_size;
  1536.     }, currentBackend: function () {
  1537.         return _backend;
  1538.     }, storageAvailable: function () {
  1539.         return!!_backend;
  1540.     }, listenKeyChange: function (key, callback) {
  1541.         _checkKey(key);
  1542.         if (!_observers[key]) {
  1543.             _observers[key] = [];
  1544.         }
  1545.         _observers[key].push(callback);
  1546.     }, stopListening: function (key, callback) {
  1547.         _checkKey(key);
  1548.         if (!_observers[key]) {
  1549.             return;
  1550.         }
  1551.         if (!callback) {
  1552.             delete _observers[key];
  1553.             return;
  1554.         }
  1555.         for (var i = _observers[key].length - 1; i >= 0; i--) {
  1556.             if (_observers[key][i] == callback) {
  1557.                 _observers[key].splice(i, 1);
  1558.             }
  1559.         }
  1560.     }, subscribe: function (channel, callback) {
  1561.         channel = (channel || "").toString();
  1562.         if (!channel) {
  1563.             throw new TypeError('Channel not defined');
  1564.         }
  1565.         if (!_pubsub_observers[channel]) {
  1566.             _pubsub_observers[channel] = [];
  1567.         }
  1568.         _pubsub_observers[channel].push(callback);
  1569.     }, publish: function (channel, payload) {
  1570.         channel = (channel || "").toString();
  1571.         if (!channel) {
  1572.             throw new TypeError('Channel not defined');
  1573.         }
  1574.         _publish(channel, payload);
  1575.     }, reInit: function () {
  1576.         _reloadData();
  1577.     }};
  1578.     _init();
  1579. })();
  1580. ;
  1581. ;
  1582. window.___ = function () {
  1583.     ___.history = ___.history || [];
  1584.     ___.history.push(arguments);
  1585.     if (this.console) {
  1586.         console.log(Array.prototype.slice.call(arguments));
  1587.     }
  1588. };
  1589. window.___l = function (str, str2) {
  1590.     if (this.console) {
  1591.         if (!B24_debug_status || !B24_debug_status.getMode('ga')) {
  1592.             return false;
  1593.         }
  1594.         var output = '';
  1595.         if (typeof(str2) == 'string') {
  1596.             output += '####### ' + str2 + ' #######';
  1597.         }
  1598.         if (typeof(str) == 'object') {
  1599.             output += ' :::::OBJECT at lifetime: ' + JSON.stringify(str);
  1600.         }
  1601.         if (typeof(str) == 'string') {
  1602.             output += ' :::::  ' + str;
  1603.         }
  1604.         console.log(output);
  1605.         if (typeof(str) == 'object') {
  1606.             console.log(str);
  1607.         }
  1608.         return true;
  1609.     }
  1610.     return false;
  1611. };
  1612. jQuery.debug = function (bool) {
  1613.     return bool
  1614. };
  1615. jQuery.log = window.___;
  1616. ;
  1617.  
  1618. (function ($) {
  1619.     $.getlocations = function (href_to_go, target, params) {
  1620.         if (typeof window.Get_Locations == 'undefined') {
  1621.             var loc_obj = window.location;
  1622.             var get_locations = new Object();
  1623.             get_locations['location'] = loc_obj;
  1624.             var base = $('base') ? $('base').attr('href') : '';
  1625.             if (typeof(base) == 'undefined' || base == null) {
  1626.                 base = "";
  1627.             }
  1628.             get_locations['baseref'] = base;
  1629.             get_locations['baseref_ie'] = get_locations['baseref'].replace(/([^\/])$|\/?[^\/]+\.(php|html|htm)$/i, '$1/');
  1630.             get_locations['hash'] = loc_obj.hash;
  1631.             get_locations['host'] = loc_obj.host;
  1632.             get_locations['hostname'] = loc_obj.hostname;
  1633.             get_locations['href'] = loc_obj.href;
  1634.             get_locations['pathname'] = loc_obj.pathname;
  1635.             get_locations['port'] = loc_obj.port;
  1636.             get_locations['protocol'] = loc_obj.protocol;
  1637.             get_locations['search'] = loc_obj.search;
  1638.             get_locations['ssl'] = loc_obj.protocol.match(/https/) == "https" ? true : false;
  1639.             get_locations['pathes'] = new Array();
  1640.             get_locations['pathes'] = loc_obj.pathname.split("/");
  1641.             get_locations['filename'] = get_locations['pathes'][get_locations['pathes'].length - 1];
  1642.             get_locations['topleveldomain'] = loc_obj.hostname.match(/[a-z]+$/i);
  1643.             get_locations['domain'] = loc_obj.hostname.match(/[^\.]+\.[a-z]+$/i);
  1644.             var params = loc_obj.search.substr(1, loc_obj.search.length).split("&");
  1645.             var key_value = new Object();
  1646.             for (var i = 0; i < params.length; i++) {
  1647.                 var param_split = params[i].split("=");
  1648.                 key_value[param_split[0]] = param_split[1];
  1649.             }
  1650.             get_locations['params'] = key_value;
  1651.             window.Get_Locations = get_locations;
  1652.         }
  1653.         if (typeof href_to_go == 'string' && href_to_go != '') {
  1654.             href_to_go = (href_to_go.match(/^\/|^http/i)) ? href_to_go : Get_Locations['baseref_ie'] + href_to_go;
  1655.             if (typeof params == 'string' && params != '') {
  1656.                 window.open(href_to_go, target, params);
  1657.             }
  1658.             else if (typeof target == 'string' && target != '') {
  1659.                 window.open(href_to_go, target);
  1660.             }
  1661.             else {
  1662.                 window.location.href = href_to_go;
  1663.             }
  1664.         }
  1665.         return window.Get_Locations;
  1666.     }
  1667. })(jQuery);
  1668. ;
  1669.  
  1670. (function ($) {
  1671.     $.uniqid = function () {
  1672.         return $.sha256(String(Math.random()));
  1673.     }
  1674. }(jQuery));
  1675. (function ($) {
  1676.     var chrsz = 8;
  1677.     var safe_add = function (x, y) {
  1678.         var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  1679.         var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  1680.         return(msw << 16) | (lsw & 0xFFFF);
  1681.     }
  1682.     var S = function (X, n) {
  1683.         return(X >>> n) | (X << (32 - n));
  1684.     }
  1685.     var R = function (X, n) {
  1686.         return(X >>> n);
  1687.     }
  1688.     var Ch = function (x, y, z) {
  1689.         return((x & y) ^ ((~x) & z));
  1690.     }
  1691.     var Maj = function (x, y, z) {
  1692.         return((x & y) ^ (x & z) ^ (y & z));
  1693.     }
  1694.     var Sigma0256 = function (x) {
  1695.         return(S(x, 2) ^ S(x, 13) ^ S(x, 22));
  1696.     }
  1697.     var Sigma1256 = function (x) {
  1698.         return(S(x, 6) ^ S(x, 11) ^ S(x, 25));
  1699.     }
  1700.     var Gamma0256 = function (x) {
  1701.         return(S(x, 7) ^ S(x, 18) ^ R(x, 3));
  1702.     }
  1703.     var Gamma1256 = function (x) {
  1704.         return(S(x, 17) ^ S(x, 19) ^ R(x, 10));
  1705.     }
  1706.     var core_sha256 = function (m, l) {
  1707.         var K = new Array(0x428A2F98,
  1708.                 0x71374491,
  1709.                 0xB5C0FBCF,
  1710.                 0xE9B5DBA5,
  1711.                 0x3956C25B,
  1712.                 0x59F111F1,
  1713.                 0x923F82A4,
  1714.                 0xAB1C5ED5,
  1715.                 0xD807AA98,
  1716.                 0x12835B01,
  1717.                 0x243185BE,
  1718.                 0x550C7DC3,
  1719.                 0x72BE5D74,
  1720.                 0x80DEB1FE,
  1721.                 0x9BDC06A7,
  1722.                 0xC19BF174,
  1723.                 0xE49B69C1,
  1724.                 0xEFBE4786,
  1725.                 0xFC19DC6,
  1726.                 0x240CA1CC,
  1727.                 0x2DE92C6F,
  1728.                 0x4A7484AA,
  1729.                 0x5CB0A9DC,
  1730.                 0x76F988DA,
  1731.                 0x983E5152,
  1732.                 0xA831C66D,
  1733.                 0xB00327C8,
  1734.                 0xBF597FC7,
  1735.                 0xC6E00BF3,
  1736.                 0xD5A79147,
  1737.                 0x6CA6351,
  1738.                 0x14292967,
  1739.                 0x27B70A85,
  1740.                 0x2E1B2138,
  1741.                 0x4D2C6DFC,
  1742.                 0x53380D13,
  1743.                 0x650A7354,
  1744.                 0x766A0ABB,
  1745.                 0x81C2C92E,
  1746.                 0x92722C85,
  1747.                 0xA2BFE8A1,
  1748.                 0xA81A664B,
  1749.                 0xC24B8B70,
  1750.                 0xC76C51A3,
  1751.                 0xD192E819,
  1752.                 0xD6990624,
  1753.                 0xF40E3585,
  1754.                 0x106AA070,
  1755.                 0x19A4C116,
  1756.                 0x1E376C08,
  1757.                 0x2748774C,
  1758.                 0x34B0BCB5,
  1759.                 0x391C0CB3,
  1760.                 0x4ED8AA4A,
  1761.                 0x5B9CCA4F,
  1762.                 0x682E6FF3,
  1763.                 0x748F82EE,
  1764.                 0x78A5636F,
  1765.                 0x84C87814,
  1766.                 0x8CC70208,
  1767.                 0x90BEFFFA,
  1768.                 0xA4506CEB,
  1769.                 0xBEF9A3F7,
  1770.                 0xC67178F2);
  1771.         var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);
  1772.         var W = new Array(64);
  1773.         var a, b, c, d, e, f, g, h, i, j;
  1774.         var T1, T2;
  1775.         m[l >> 5] |= 0x80 << (24 - l % 32);
  1776.         m[((l + 64 >> 9) << 4) + 15] = l;
  1777.         for (var i = 0; i < m.length; i += 16) {
  1778.             a = HASH[0];
  1779.             b = HASH[1];
  1780.             c = HASH[2];
  1781.             d = HASH[3];
  1782.             e = HASH[4];
  1783.             f = HASH[5];
  1784.             g = HASH[6];
  1785.             h = HASH[7];
  1786.             for (var j = 0; j < 64; j++) {
  1787.                 if (j < 16) {
  1788.                     W[j] = m[j + i];
  1789.                 }
  1790.                 else {
  1791.                     W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);
  1792.                 }
  1793.                 T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);
  1794.                 T2 = safe_add(Sigma0256(a), Maj(a, b, c));
  1795.                 h = g;
  1796.                 g = f;
  1797.                 f = e;
  1798.                 e = safe_add(d, T1);
  1799.                 d = c;
  1800.                 c = b;
  1801.                 b = a;
  1802.                 a = safe_add(T1, T2);
  1803.             }
  1804.             HASH[0] = safe_add(a, HASH[0]);
  1805.             HASH[1] = safe_add(b, HASH[1]);
  1806.             HASH[2] = safe_add(c, HASH[2]);
  1807.             HASH[3] = safe_add(d, HASH[3]);
  1808.             HASH[4] = safe_add(e, HASH[4]);
  1809.             HASH[5] = safe_add(f, HASH[5]);
  1810.             HASH[6] = safe_add(g, HASH[6]);
  1811.             HASH[7] = safe_add(h, HASH[7]);
  1812.         }
  1813.         return HASH;
  1814.     }
  1815.     var str2binb = function (str) {
  1816.         var bin = Array();
  1817.         var mask = (1 << chrsz) - 1;
  1818.         for (var i = 0; i < str.length * chrsz; i += chrsz) {
  1819.             bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i % 32);
  1820.         }
  1821.         return bin;
  1822.     }
  1823.     var binb2hex = function (binarray) {
  1824.         var hex_tab = "0123456789abcdef";
  1825.         var str = "";
  1826.         for (var i = 0; i < binarray.length * 4; i++) {
  1827.             str += hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8)) & 0xF);
  1828.         }
  1829.         return str;
  1830.     }
  1831.     var core_hmac_sha256 = function (key, data) {
  1832.         var bkey = str2binb(key);
  1833.         if (bkey.length > 16) {
  1834.             bkey = core_sha1(bkey, key.length * chrsz);
  1835.         }
  1836.         var ipad = Array(16), opad = Array(16);
  1837.         for (var i = 0; i < 16; i++) {
  1838.             ipad[i] = bkey[i] ^ 0x36363636;
  1839.             opad[i] = bkey[i] ^ 0x5C5C5C5C;
  1840.         }
  1841.         var hash = core_sha256(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
  1842.         return core_sha256(opad.concat(hash), 512 + 256);
  1843.     }
  1844.     var prep = function (string) {
  1845.         string = typeof string == 'object' ? $(string).val() : string.toString();
  1846.         return string;
  1847.     }
  1848.     $.extend({sha256: function (string) {
  1849.         string = prep(string);
  1850.         return binb2hex(core_sha256(str2binb(string), string.length * chrsz));
  1851.     }, sha256hmac: function (key, data) {
  1852.         key = prep(key);
  1853.         data = prep(data);
  1854.         return binb2hex(core_hmac_sha256(key, data));
  1855.     }, sha256config: function (bits) {
  1856.         chrsz = parseInt(bits) || 8;
  1857.     }});
  1858.     $.fn.sha256 = function (bits) {
  1859.         $.sha256config(bits);
  1860.         var string = prep($(this).val());
  1861.         var val = $.sha256(string);
  1862.         $.sha256config(8);
  1863.         return val;
  1864.     };
  1865. })(jQuery);
  1866. ;
  1867.  
  1868. (function ($, document, undefined) {
  1869.     var pluses = /\+/g;
  1870.  
  1871.     function raw(s) {
  1872.         return s;
  1873.     }
  1874.  
  1875.     function decoded(s) {
  1876.         return decodeURIComponent(s.replace(pluses, ' '));
  1877.     }
  1878.  
  1879.     var config = $.cookie = function (key, value, options) {
  1880.         if (value !== undefined) {
  1881.             options = $.extend({}, config.defaults, options);
  1882.             if (value === null) {
  1883.                 options.expires = -1;
  1884.             }
  1885.             if (typeof options.expires === 'number') {
  1886.                 var days = options.expires, t = options.expires = new Date();
  1887.                 t.setDate(t.getDate() + days);
  1888.             }
  1889.             value = config.json ? JSON.stringify(value) : String(value);
  1890.             return(document.cookie =
  1891.                     [encodeURIComponent(key),
  1892.                         '=',
  1893.                         config.raw ? value : encodeURIComponent(value),
  1894.                         options.expires ? '; expires=' + options.expires.toUTCString() : '',
  1895.                         options.path ? '; path=' + options.path : '',
  1896.                         options.domain ? '; domain=' + options.domain : '',
  1897.                         options.secure ? '; secure' : ''].join(''));
  1898.         }
  1899.         var decode = config.raw ? raw : decoded;
  1900.         var cookies = document.cookie.split('; ');
  1901.         for (var i = 0, l = cookies.length; i < l; i++) {
  1902.             var parts = cookies[i].split('=');
  1903.             if (decode(parts.shift()) === key) {
  1904.                 var cookie = decode(parts.join('='));
  1905.                 return config.json ? JSON.parse(cookie) : cookie;
  1906.             }
  1907.         }
  1908.         return null;
  1909.     };
  1910.     config.defaults = {};
  1911.     $.removeCookie = function (key, options) {
  1912.         if ($.cookie(key) !== null) {
  1913.             $.cookie(key, null, options);
  1914.             return true;
  1915.         }
  1916.         return false;
  1917.     };
  1918. })(jQuery, document);
  1919. ;
  1920.  
  1921. (function ($) {
  1922.     $.extend({metadata: {defaults: {type: 'class', name: 'metadata', cre: /({.*})/, single: 'metadata'}, setType: function (type, name) {
  1923.         this.defaults.type = type;
  1924.         this.defaults.name = name;
  1925.     }, get: function (elem, opts) {
  1926.         var settings = $.extend({}, this.defaults, opts);
  1927.         if (!settings.single.length) {
  1928.             settings.single = 'metadata';
  1929.         }
  1930.         var data = $.data(elem, settings.single);
  1931.         if (data) {
  1932.             return data;
  1933.         }
  1934.         data = "{}";
  1935.         if (settings.type == "class") {
  1936.             var m = settings.cre.exec(elem.className);
  1937.             if (m) {
  1938.                 data = m[1];
  1939.             }
  1940.         }
  1941.         else if (settings.type == "elem") {
  1942.             if (!elem.getElementsByTagName) {
  1943.                 return;
  1944.             }
  1945.             var e = elem.getElementsByTagName(settings.name);
  1946.             if (e.length) {
  1947.                 data = $.trim(e[0].innerHTML);
  1948.             }
  1949.         }
  1950.         else if (elem.getAttribute != undefined) {
  1951.             var attr = elem.getAttribute(settings.name);
  1952.             if (attr) {
  1953.                 data = attr;
  1954.             }
  1955.         }
  1956.         if (data.indexOf('{') < 0) {
  1957.             data = "{" + data + "}";
  1958.         }
  1959.         data = eval("(" + data + ")");
  1960.         $.data(elem, settings.single, data);
  1961.         return data;
  1962.     }}});
  1963.     $.fn.metadata = function (opts) {
  1964.         return $.metadata.get(this[0], opts);
  1965.     };
  1966. })(jQuery);
  1967. ;
  1968. /**
  1969.  * jQuery Unveil
  1970.  * A very lightweight jQuery plugin to lazy load images
  1971.  * http://luis-almeida.github.com/unveil
  1972.  *
  1973.  * Licensed under the MIT license.
  1974.  * Copyright 2013 Luís Almeida
  1975.  * https://github.com/luis-almeida
  1976.  */
  1977.  
  1978. ;
  1979. (function ($) {
  1980.  
  1981.     $.fn.unveil = function (threshold, callback) {
  1982.  
  1983.         var $w = $(window), th = threshold || 0, retina = window.devicePixelRatio > 1, attrib = retina ? "data-src-retina" :
  1984.                         "data-src", images = this, loaded;
  1985.  
  1986.         this.one("unveil", function () {
  1987.             var source = this.getAttribute(attrib);
  1988.             source = source || this.getAttribute("data-src");
  1989.             if (source) {
  1990.                 this.setAttribute("src", source);
  1991.                 if (typeof callback === "function") {
  1992.                     callback.call(this);
  1993.                 }
  1994.             }
  1995.         });
  1996.  
  1997.         function unveil() {
  1998.             var inview = images.filter(function () {
  1999.                 var $e = $(this);
  2000.                 if ($e.is(":hidden")) {
  2001.                     return;
  2002.                 }
  2003.  
  2004.                 var wt = $w.scrollTop(), wb = wt + $w.height(), et = $e.offset().top, eb = et + $e.height();
  2005.  
  2006.                 return eb >= wt - th && et <= wb + th;
  2007.             });
  2008.  
  2009.             loaded = inview.trigger("unveil");
  2010.             images = images.not(loaded);
  2011.         }
  2012.  
  2013.         $w.on("scroll.unveil resize.unveil lookup.unveil", unveil);
  2014.  
  2015.         unveil();
  2016.  
  2017.         return this;
  2018.  
  2019.     };
  2020.  
  2021. })(window.jQuery || window.Zepto);
  2022. ;
  2023. var B24_debug_status = (function (window, $) {
  2024.     var pub = {};
  2025.     var storageName = '___b24debug14', modePattern = RegExp('^b24_debug_'), stopKey = 'b24_debug_stop', initMode = {'js': null, 'qa': null, 'ga': null, 'success': null, 'tracking': null, 'live': null, 'layout': null, 'abtest': null, 'divolution': null}, mode = {}, debugSuccessCookieName = 'b24_debug_success';
  2026.     var init = function () {
  2027.         initMode.live = !!location.hostname.match(/(www\.brille24\.)/i);
  2028.         initMode.qa = !!location.hostname.match(/(qa\.dev-b24\.)|(www\.brille24\.)/i);
  2029.         initMode.tracking = getTrackingMode();
  2030.         initMode.divolution = getTrackingMode();
  2031.         $.extend(mode, initMode);
  2032.         mode = extendWidthStorage(mode);
  2033.         mode = extendWidthParams(mode);
  2034.         displayMode();
  2035.         storageMode(mode);
  2036.     };
  2037.     var getTrackingMode = function () {
  2038.         var ok = true;
  2039.         try {
  2040.             ok = initMode.live ? true : null;
  2041.             var ip = '0.0.0.0';
  2042.             if ($.cookie('_b24remip')) {
  2043.                 ip = $.cookie('_b24remip');
  2044.             }
  2045.             if (!!ip.match(/(217\.92\.254\.84)|(213\.20\.103\.41)|(192\.168\.100\.)/i)) {
  2046.                 ok = null;
  2047.             }
  2048.         }
  2049.         catch (e) {
  2050.             ok = true;
  2051.         }
  2052.         return ok;
  2053.     };
  2054.     var displayMode = function () {
  2055.         try {
  2056.             $('#b24_debug_display').remove();
  2057.             var $diplay = $('<div />').attr('id', 'b24_debug_display');
  2058.             var $tempalte = $('<div />').css({'borderBottom': '1px solid white', 'padding': '1px 3px'});
  2059.             var someThingDisabled = false;
  2060.             if (!mode.tracking) {
  2061.                 someThingDisabled = true;
  2062.                 var $tracking = $tempalte.clone();
  2063.                 $diplay.append($tracking.html('Tracking Disabled: <a href="javascript: B24_debug_status.setMode({tracking:true})">Enable Tracking</a>'));
  2064.             }
  2065.             if (!mode.divolution) {
  2066.                 var $abtest = $tempalte.clone();
  2067.                 someThingDisabled = true;
  2068.                 $diplay.append($abtest.html('AB-Test Disabled: <a href="javascript: B24_debug_status.setMode({divolution:true})">Enable AB-Test</a>'));
  2069.             }
  2070.             if (someThingDisabled) {
  2071.                 $(function () {
  2072.                     $('body').append($diplay);
  2073.                     $diplay.css({position: 'fixed', zIndex: '10000', color: 'white !important', backgroundColor: '#CDCDCD', bottom: '0', left: '0', fontSize: '10px', margin: '10px', boxShadow: '6px 6px 5px #888888'});
  2074.                 });
  2075.             }
  2076.         }
  2077.         catch (err) {
  2078.             var message = err;
  2079.         }
  2080.         return true;
  2081.     };
  2082.     pub.setMode = function (modeExtented) {
  2083.         $.extend(mode, modeExtented);
  2084.         displayMode();
  2085.         storageMode(mode);
  2086.     };
  2087.     pub.setFullMode = function () {
  2088.         $.each(mode, function (key, value) {
  2089.             if (value == null) {
  2090.                 mode[key] = true;
  2091.             }
  2092.         });
  2093.         displayMode();
  2094.         storageMode(mode);
  2095.     };
  2096.     pub.getMode = function (which) {
  2097.         if (!mode[which]) {
  2098.             return false;
  2099.         }
  2100.         return mode[which];
  2101.     };
  2102.     pub.getFullMode = function () {
  2103.         return mode;
  2104.     };
  2105.     var stopDebug = function () {
  2106.         mode = $.extend({}, initMode);
  2107.         deletStorage();
  2108.         displayMode();
  2109.         return mode;
  2110.     };
  2111.     pub.stopDebug = stopDebug;
  2112.     var extendWidthStorage = function (m) {
  2113.         var mode = {};
  2114.         var content = $.cookie(storageName);
  2115.         if (!!content) {
  2116.             try {
  2117.                 mode = JSON.parse(content);
  2118.             }
  2119.             catch (err) {
  2120.             }
  2121.         }
  2122.         $.extend(m, mode);
  2123.         return m;
  2124.     };
  2125.     var storageMode = function () {
  2126.         if (!!mode.success) {
  2127.             $.cookie(debugSuccessCookieName, 'true', {path: '/'});
  2128.         }
  2129.         else {
  2130.             $.removeCookie(debugSuccessCookieName, {path: '/'});
  2131.         }
  2132.         return $.cookie(storageName, JSON.stringify(mode), {path: '/'});
  2133.     };
  2134.     var extendWidthParams = function (m) {
  2135.         var params = $.getlocations().params;
  2136.         if (!!params[stopKey]) {
  2137.             deletStorage();
  2138.             return initMode;
  2139.         }
  2140.         var pMode = {};
  2141.         $.each(params, function (key, value) {
  2142.             if (!!key.match(modePattern)) {
  2143.                 value = (value == 'true' || value == '1') ? true : false;
  2144.                 pMode[key.replace(modePattern, '')] = value;
  2145.             }
  2146.         });
  2147.         $.extend(m, pMode);
  2148.         return m;
  2149.     };
  2150.     var deletStorage = function () {
  2151.         $.removeCookie(debugSuccessCookieName, {path: '/'});
  2152.         return $.removeCookie(storageName, {path: '/'});
  2153.     };
  2154.     init();
  2155.     return pub;
  2156. })(window, jQuery, undefined);
  2157. ;
  2158. ;
  2159. var B24_shoplocation = (function ($) {
  2160.     var pub = {};
  2161.     var loc = null;
  2162.     var category = null;
  2163.     var categoryID = null;
  2164.     var system = null;
  2165.     var modus = null;
  2166.     var staticModus = null;
  2167.     var productType = null;
  2168.     var mageParams = null;
  2169.     init = function () {
  2170.         pub.get();
  2171.         return true;
  2172.     };
  2173.     pub.get = function () {
  2174.         if (loc != null) {
  2175.             return loc;
  2176.         }
  2177.         loc = 'other';
  2178.         var path = location.pathname;
  2179.         var domain = location.hostname;
  2180.         if (domain.match(/^start/i) != null) {
  2181.             loc = 'start';
  2182.         }
  2183.         else if (path.match(/\bcart\b/i) != null) {
  2184.             if (path.match(/\bconfigure\b/i)) {
  2185.                 loc = 'configure';
  2186.             }
  2187.             else {
  2188.                 loc = 'cart';
  2189.             }
  2190.         }
  2191.         else if (path.match(/\b(success|placement|(paypal\/standard\/redirect))\b/i) != null) {
  2192.             loc = 'success';
  2193.         }
  2194.         else if (path.match(/\bcheckout\b/i) != null) {
  2195.             loc = 'checkout';
  2196.         }
  2197.         else if (path.match(/\bwishlist\b/i) != null) {
  2198.             loc = 'wishlist';
  2199.         }
  2200.         else if (path.match(/^\/shop\/(([^\/]+)\/)?(.*)\.html$/i) != null) {
  2201.             loc = 'detail';
  2202.         }
  2203.         else if (path.match(/^\/shop\/?(([^\/]+)\/?)?(filter\/?.*)?$/i) != null) {
  2204.             loc = 'listing';
  2205.         }
  2206.         else if (path.match(/^\/?$/i) != null) {
  2207.             loc = 'homepage';
  2208.         }
  2209.         return loc;
  2210.     };
  2211.     pub.getCategory = function (upperCase) {
  2212.         var path = location.pathname;
  2213.         category = 'cms';
  2214.         if (path.match(/^\/shop\//i)) {
  2215.             category = 'shop';
  2216.         }
  2217.         if (path.match(/^\/shop\/[^\.\/]+$/i) != null) {
  2218.             path += '/';
  2219.         }
  2220.         if (path.match(/^\/shop\/([^\/]+)\/(([^\/\.]+).html)?$/i) != null) {
  2221.             category = path.replace(/^\/shop\/([^\/]+)\/(([^\/\.]+).html)?$/i, '$1').toLowerCase();
  2222.         }
  2223.         if ($.type(upperCase) === 'boolean' && upperCase) {
  2224.             category = category.replace(/([^- \t]+)/g, function (_, word) {
  2225.                 return word.capitalize();
  2226.             });
  2227.         }
  2228.         return category;
  2229.     };
  2230.     var getCategoryID = function () {
  2231.         if (categoryID != null) {
  2232.             return categoryID;
  2233.         }
  2234.         categoryID = '-1';
  2235.         categoryID = $('body').attr('class').replace(/^.*category\-id\-(\d)+ .*$/i, '$1');
  2236.         return categoryID;
  2237.     };
  2238.     pub.getCategoryID = getCategoryID;
  2239.     pub.getSystem = function () {
  2240.         if (system != null) {
  2241.             return system;
  2242.         }
  2243.         system = 'cms';
  2244.         var path = location.pathname;
  2245.         if (path.match(/^\/shop\//i)) {
  2246.             system = 'shop';
  2247.         }
  2248.         return system;
  2249.     };
  2250.     pub.getModus = function () {
  2251.         if (modus != null) {
  2252.             return modus;
  2253.         }
  2254.         modus = 'dev';
  2255.         if (B24_debug_status.getMode('live')) {
  2256.             modus = 'live';
  2257.             return modus;
  2258.         }
  2259.         var host = location.hostname;
  2260.         if (!!host.match(/^(start|www)\.brille24\.de$/i)) {
  2261.             modus = 'live';
  2262.         }
  2263.         else if (!!host.match(/^qa\.dev-b24\.net$/i)) {
  2264.             modus = 'qa';
  2265.         }
  2266.         $('html').addClass('system_modus_' + modus);
  2267.         return modus;
  2268.     };
  2269.     pub.getStaticModus = function () {
  2270.         if (staticModus != null) {
  2271.             return staticModus;
  2272.         }
  2273.         staticModus = 'dev';
  2274.         var host = location.hostname;
  2275.         if (!!host.match(/^(start|www)\.brille24\.de$/i)) {
  2276.             staticModus = 'live';
  2277.         }
  2278.         else if (!!host.match(/^qa\.dev-b24\.net$/i)) {
  2279.             staticModus = 'qa';
  2280.         }
  2281.         $('html').addClass('system_static_modus_' + staticModus);
  2282.         return staticModus;
  2283.     };
  2284.     pub.getProductType = function () {
  2285.         if (productType != null) {
  2286.             return productType;
  2287.         }
  2288.         productType = 'glasses';
  2289.         var path = location.pathname;
  2290.         if (!!path.match(/kontaktlinse/i)) {
  2291.             productType = 'contactlens';
  2292.         }
  2293.         if (!!path.match(/eyestyle/i)) {
  2294.             productType = 'eyestyle';
  2295.         }
  2296.         return productType;
  2297.     };
  2298.     pub.getMageParams = function () {
  2299.         if (mageParams != null) {
  2300.             return mageParams;
  2301.         }
  2302.         mageParams = getMageParamsFromCookie();
  2303.         return mageParams;
  2304.     };
  2305.     putMageParamsToCookie = function (mg) {
  2306.         mg.empty = false;
  2307.         $.cookie('b24_mage_params', JSON.stringify(mg), {path: '/'});
  2308.         return true;
  2309.     };
  2310.     getMageParamsFromCookie = function () {
  2311.         var storeID = '1';
  2312.         if (pub.getStaticModus() != 'live') {
  2313.             storeID = '9999';
  2314.         }
  2315.         var customerID = false;
  2316.         if (!!jQuery.getlocations().params && !!jQuery.getlocations().params.cidb24 && jQuery.getlocations().params.cidb24 != '0') {
  2317.             customerID = jQuery.getlocations().params.cidb24;
  2318.         }
  2319.         if ($.cookie('personalisation') == null) {
  2320.             return{'empty': true, 'C': customerID, 'S': storeID};
  2321.         }
  2322.         var personalisationJSON = JSON.parse($.cookie('personalisation'), {path: '/'});
  2323.         return{'empty': false, 'Q': personalisationJSON.quote_id, 'S': storeID, 'C': (!!personalisationJSON.customer_id ?
  2324.                 personalisationJSON.customer_id : customerID)};
  2325.     };
  2326.     init();
  2327.     return pub;
  2328. })(jQuery);
  2329. ;
  2330. ;
  2331. var ___b24 = ___b24 || {};
  2332. ___b24.loadscript = (function (window, $) {
  2333.     var pub = {};
  2334.     var load = function (source, sync, utf8) {
  2335.         var script = document.createElement('script');
  2336.         script.type = 'text/javascript';
  2337.         if (typeof(sync) == 'boolean' && sync) {
  2338.             script.async = true;
  2339.         }
  2340.         else {
  2341.             script.async = false;
  2342.         }
  2343.         if (typeof(utf8) == 'boolean' && utf8) {
  2344.             script.charset = 'utf-8';
  2345.         }
  2346.         script.src = source;
  2347.         var scriptDOM = document.getElementsByTagName('script')[0];
  2348.         scriptDOM.parentNode.insertBefore(script, scriptDOM);
  2349.     };
  2350.     pub.load = load;
  2351.     var loadImg = function (url, params, subsitute) {
  2352.         if (typeof(params) == 'object') {
  2353.             url = makeURL(url, params);
  2354.         }
  2355.         try {
  2356.             if (typeof(subsitute) == 'string' && !!subsitute) {
  2357.                 url = url.replace(/\?/i, subsitute);
  2358.             }
  2359.         }
  2360.         catch (err) {
  2361.             ___b24.tracking.error('loadscript.loadImg', err);
  2362.         }
  2363.         var $img = $('<img />').attr({'class': 'visuallyhidden', 'src': url})
  2364.         var $dyn = $('#dynamic');
  2365.         if (!$('#dynamic').length) {
  2366.             $dyn = $('<div />').attr({'class': 'visuallyhidden', id: 'dynamic'});
  2367.             $('body').append(dyn);
  2368.         }
  2369.         $dyn.append($img);
  2370.     };
  2371.     pub.loadImg = loadImg;
  2372.     var putDOM = function (part) {
  2373.         var $dyn = $('#dynamic');
  2374.         if (!$('#dynamic').length) {
  2375.             $dyn = $('<div />').attr({'class': 'visuallyhidden', id: 'dynamic'});
  2376.             $('body').append(dyn);
  2377.         }
  2378.         $dyn.append(part);
  2379.     };
  2380.     pub.putDOM = putDOM;
  2381.     var loadIFrame = function (url, params) {
  2382.         if (typeof(params) == 'object') {
  2383.             url = makeURL(url, param);
  2384.         }
  2385.         $('<iframe />').attr({'class': 'visuallyhidden', 'src': url}).appendTo('body');
  2386.     };
  2387.     pub.loadIFrame = loadIFrame;
  2388.     var makeURL = function (url, params) {
  2389.         if (typeof(params) == 'object') {
  2390.             params = $.param(params);
  2391.         }
  2392.         else {
  2393.             return url;
  2394.         }
  2395.         if (!!url.match(/\?/i)) {
  2396.             url += '&';
  2397.         }
  2398.         else {
  2399.             url += '?';
  2400.         }
  2401.         url += params;
  2402.         return url;
  2403.     };
  2404.     return pub;
  2405. })(window, jQuery, undefined);
  2406. ;
  2407. ;
  2408. var ___b24 = ___b24 || {};
  2409. ___b24.experiment = function (name, ids, pageId, defaultID) {
  2410.     ___b24.tracking = ___b24.tracking || {error: function () {
  2411.         ;
  2412.     }};
  2413.     var pub = {};
  2414.     var $ = jQuery;
  2415.     var expClID = 'so_s195_EF5nhCtp4hx07';
  2416.     var linkclid = 'divoluso_s195_EF5nhCtp4hx07';
  2417.     var storageName = 'b24_experiment1408';
  2418.     var expName = name;
  2419.     var storedTime = 0;
  2420.     var paramName = 'b24_exp_' + name;
  2421.     var expVariants = ids;
  2422.     var actualVariant = 0;
  2423.     var callCycle = 60;
  2424.     var expTTL = 30;
  2425.     var overload = false;
  2426.     var virgin = true;
  2427.     var init = function () {
  2428.         try {
  2429.             if (!B24_debug_status.getMode('divolution')) {
  2430.                 virgin = false;
  2431.                 actualVariant = expVariants[0];
  2432.                 $('html').addClass('b24exp_' + name + '_' + actualVariant);
  2433.                 return false;
  2434.             }
  2435.             if (isExpStored()) {
  2436.                 virgin = false;
  2437.                 actualVariant = defaultID || getVariant();
  2438.                 actualVariant = actualVariant.toString();
  2439.                 storeExp();
  2440.             }
  2441.             else {
  2442.                 actualVariant = defaultID || getVariantByRandom();
  2443.                 actualVariant = actualVariant.toString();
  2444.                 storeExp();
  2445.             }
  2446.             $('html').addClass('b24exp_' + name + '_' + actualVariant);
  2447.             if (typeof(pageId) != 'undefined') {
  2448.                 if (typeof(window['rt_pageid' + pageId]) != 'undefined') {
  2449.                     ___('################################DIVOLUTION################################PROBLEM##################');
  2450.                     throw'there is allready an Experiment registered: ' + expName + 'pageIde' + pageId;
  2451.                     return false;
  2452.                 }
  2453.                 window['rt_pageid' + pageId] = actualVariant;
  2454.             }
  2455.             else {
  2456.                 if (parseInt(actualVariant, 10) > 0) {
  2457.                     window.rt_clid = 'divolu' + expClID + '|sitedivolu';
  2458.                     if (typeof(window.rt_pageid) == 'undefined') {
  2459.                         window.rt_pageid = actualVariant;
  2460.                         pageId = 1;
  2461.                     }
  2462.                     else {
  2463.                         overload = true;
  2464.                         for (var i = 2; i < 7; i++) {
  2465.                             if (typeof(window['rt_pageid' + i]) == 'undefined') {
  2466.                                 window['rt_pageid' + i] = actualVariant;
  2467.                                 overload = false;
  2468.                                 pageId = i;
  2469.                                 break;
  2470.                             }
  2471.                         }
  2472.                     }
  2473.                 }
  2474.             }
  2475.             registerEvents();
  2476.             callScript();
  2477.         }
  2478.         catch (err) {
  2479.             ___b24.tracking.error('divolution.experiment.init', err);
  2480.         }
  2481.     };
  2482.     var callScript = function () {
  2483.         var actualTime = Math.round(new Date().getTime() / 1000 / 60);
  2484.         var olderAsAnHour = (actualTime - callCycle) > storedTime;
  2485.         if (virgin || olderAsAnHour) {
  2486.             storeExp(actualTime);
  2487.             window.rt_async = true;
  2488.             ___b24.loadscript.load('//rt.divolution.com/js/site/' + expClID + '.js');
  2489.             return true;
  2490.         }
  2491.         return false;
  2492.     };
  2493.     var getVariantByRandom = function () {
  2494.         var param = paramExp();
  2495.         if (param != 'none') {
  2496.             return param;
  2497.         }
  2498.         return expVariants[Math.floor((Math.random() * expVariants.length) + 0)].toString();
  2499.     };
  2500.     pub.setExperiment = function (which) {
  2501.         if (typeof(which) == 'undefined') {
  2502.             return false;
  2503.         }
  2504.         $('html').removeClass('b24exp_' + name + '_' + actualVariant);
  2505.         actualVariant = which.toString();
  2506.         $('html').addClass('b24exp_' + name + '_' + actualVariant);
  2507.         storeExp();
  2508.     };
  2509.     var isExpStored = function () {
  2510.         if (!!$.cookie(storageName)) {
  2511.             var storedObj = JSON.parse($.cookie(storageName));
  2512.             if (typeof(storedObj) == 'object' && typeof(storedObj[name]) != 'undefined') {
  2513.                 return true;
  2514.             }
  2515.         }
  2516.         return false;
  2517.     };
  2518.     pub.isExpStored = isExpStored;
  2519.     var paramExp = function () {
  2520.         if (!!$.getlocations().params && !!$.getlocations().params[paramName] && $.inArray($.getlocations().params[paramName], expVariants)) {
  2521.             return $.getlocations().params[paramName];
  2522.         }
  2523.         else {
  2524.             return'none';
  2525.         }
  2526.     };
  2527.     var getVariant = function () {
  2528.         try {
  2529.             if (!!actualVariant) {
  2530.                 return actualVariant;
  2531.             }
  2532.             var param = paramExp();
  2533.             if (param != 'none') {
  2534.                 actualVariant = param;
  2535.                 storeExp();
  2536.             }
  2537.             var storedObj = JSON.parse($.cookie(storageName));
  2538.             actualVariant = storedObj[name].variant;
  2539.             return actualVariant;
  2540.         }
  2541.         catch (err) {
  2542.             ___b24.tracking.error('divolution.experiment.getVariant', err);
  2543.         }
  2544.     };
  2545.     pub.getExperiment = getVariant;
  2546.     var storeExp = function (t) {
  2547.         try {
  2548.             var storedObj = {};
  2549.             if (!!$.cookie(storageName)) {
  2550.                 storedObj = JSON.parse($.cookie(storageName));
  2551.             }
  2552.             if (typeof(t) != 'undefined') {
  2553.                 storedTime = t;
  2554.             }
  2555.             else if (typeof(storedObj[name]) != 'undefined') {
  2556.                 storedTime = storedObj[name].time;
  2557.             }
  2558.             else {
  2559.                 storedTime = Math.round(new Date().getTime() / 1000 / 60);
  2560.             }
  2561.             var newStore = {};
  2562.             newStore[name] = {variant: actualVariant, time: storedTime};
  2563.             var toStoredObj = $.extend(storedObj, newStore);
  2564.             toStoredObj = JSON.stringify(toStoredObj);
  2565.             $.cookie(storageName, toStoredObj, {'path': '/', 'expires': expTTL});
  2566.             return true;
  2567.         }
  2568.         catch (err) {
  2569.             ___b24.tracking.error('divolution.experiment.storeExp', err);
  2570.         }
  2571.     };
  2572.     var getExperimentInfo = function () {
  2573.         return{ExperimentName: name, ExperimentVariants: expVariants, ExperimentActualVariant: actualVariant, ExperimentLastCallTime: storedTime, ExperimentPageID: pageId};
  2574.     };
  2575.     pub.getExperimentInfo = getExperimentInfo;
  2576.     var registerEvents = function () {
  2577.         $(document).on('click', '.DVCLICK', function () {
  2578.             var url = $(this).attr('href');
  2579.             var clickText;
  2580.             if ($(this).attr('alt') != null) {
  2581.                 clickText = $(this).attr('alt');
  2582.             }
  2583.             else {
  2584.                 clickText = url;
  2585.             }
  2586.             var mr = Math.random();
  2587.             var num = mr * 1000000000000000000;
  2588.             var encname = encodeURIComponent(clickText);
  2589.             var image1 = new Image();
  2590.             image1.src = '//rt.divolution.com/cgi-bin/rt.cgi?rt_clid=' + linkclid + '|sitedivoluAction_' + encname + '&rt_typ=2&mt=' + num;
  2591.             var rt_zaehler = 0;
  2592.             var rt_max_repeat = 50;
  2593.             var rt_timeout = function () {
  2594.                 var rt_kontrolle = image1.height;
  2595.                 if (rt_kontrolle > 0 | rt_zaehler > rt_max_repeat) {
  2596.                     location.href = url;
  2597.                 }
  2598.                 else {
  2599.                     rt_zaehler++;
  2600.                     window.setTimeout(rt_timeout, 500);
  2601.                 }
  2602.             };
  2603.             window.setTimeout(rt_timeout, 500);
  2604.             return false;
  2605.         });
  2606.     };
  2607.     var call = function (what) {
  2608.         if (!B24_debug_status.getMode('divolution')) {
  2609.             return false;
  2610.         }
  2611.         var mr = Math.random();
  2612.         var num = mr * 1000000000000000000;
  2613.         var image1 = new Image();
  2614.         image1.src = '//rt.divolution.com/cgi-bin/rt.cgi?rt_clid=' + linkclid + '|sitedivoluAction_' + what + '&rt_typ=2&mt=' + num;
  2615.         return true;
  2616.     };
  2617.     pub.call = call;
  2618.     init();
  2619.     if (overload) {
  2620.         return false;
  2621.     }
  2622.     else {
  2623.         return pub;
  2624.     }
  2625. };
  2626. ;
  2627. ;
  2628. var ___b24 = ___b24 || {};
  2629. ___b24.productmap = (function (window, $) {
  2630.     var pub = {};
  2631.     var map = {'undefined': 'error', '0': 'ClassicSinglevision', '1': 'ClassicProgressive', '2': 'ContactLens', '3': 'ClassicSinglevisionTransition', '4': 'ClassicProgressiveTransition', '5': 'ClassicSinglevisionPolarizer', '6': 'ClassicProgressivePolarizer', '10': 'EyestyleSinglevision', '11': 'EyestyleProgressive', '13': 'EyestyleSinglevisionTransition', '14': 'EyestyleProgressiveTransition', '15': 'EyestyleSinglevisionPolarizer', '16': 'EyestyleProgressivePolarizer', '30': 'ExclusiveSinglevision', '31': 'ExclusiveProgressive', '33': 'ExclusiveSinglevisionTransition', '34': 'ExclusiveProgressiveTransition', '35': 'ExclusiveSinglevisionPolarizer', '36': 'ExclusiveProgressivePolarizer', '40': 'SportSinglevision', '43': 'SportSinglevisionTransition', '45': 'SportSinglevisionPolarizer', '21': 'CareProduct', 'error': 'orderObjectIssue'};
  2632.     var extendedmap = {'undefined': 'error', '0': {'sort': 'Glass', 'group': 'Classic', 'lens': 'Singlevision'}, '1': {'sort': 'Glass', 'group': 'Classic', 'lens': 'Progressive'}, '2': {'sort': 'Lens', 'group': 'ContactLens'}, '3': {'sort': 'Glass', 'group': 'Classic', 'lens': 'Singlevision', 'lensext': 'Transition'}, '4': {'sort': 'Glass', 'group': 'Classic', 'lens': 'Progressive', 'lensext': 'Transition'}, '5': {'sort': 'Glass', 'group': 'Classic', 'lens': 'Singlevision', 'lensext': 'Polarizer'}, '6': {'sort': 'Glass', 'group': 'Classic', 'lens': 'Progressive', 'lensext': 'Polarizer'}, '10': {'sort': 'Glass', 'group': 'Eyestyle', 'lens': 'Singlevision'}, '11': {'sort': 'Glass', 'group': 'Eyestyle', 'lens': 'Progressive'}, '13': {'sort': 'Glass', 'group': 'Eyestyle', 'lens': 'Singlevision', 'lensext': 'Transition'}, '14': {'sort': 'Glass', 'group': 'Eyestyle', 'lens': 'Progressive', 'lensext': 'Transition'}, '15': {'sort': 'Glass', 'group': 'Eyestyle', 'lens': 'Singlevision', 'lensext': 'Polarizer'}, '16': {'sort': 'Glass', 'group': 'Eyestyle', 'lens': 'Progressive', 'lensext': 'Polarizer'}, '30': {'sort': 'Glass', 'group': 'Exclusive', 'lens': 'Singlevision'}, '31': {'sort': 'Glass', 'group': 'Exclusive', 'lens': 'Progressive'}, '33': {'sort': 'Glass', 'group': 'Exclusive', 'lens': 'Singlevision', 'lensext': 'Transition'}, '34': {'sort': 'Glass', 'group': 'Exclusive', 'lens': 'Progressive', 'lensext': 'Transition'}, '35': {'sort': 'Glass', 'group': 'Exclusive', 'lens': 'Singlevision', 'lensext': 'Polarizer'}, '36': {'sort': 'Glass', 'group': 'Exclusive', 'lens': 'Progressive', 'lensext': 'Polarizer'}, '40': {'sort': 'Glass', 'group': 'Sport', 'lens': 'Singlevision'}, '43': {'sort': 'Glass', 'group': 'Sport', 'lens': 'Singlevision', 'lensext': 'Transition'}, '45': {'sort': 'Glass', 'group': 'Sport', 'lens': 'Singlevision', 'lensext': 'Polarizer'}, '21': {'sort': 'Care', 'group': 'CareProduct'}, 'error': {'sort': 'orderObjectIssue', 'group': 'orderObjectIssue'}};
  2633.     pub.getExtentedMap = function () {
  2634.         return extendedmap;
  2635.     };
  2636.     pub.getMap = function () {
  2637.         return map;
  2638.     };
  2639.     pub.getExtented = function (num) {
  2640.         var out = {};
  2641.         if (typeof(num) != 'number' && typeof(num) != 'string') {
  2642.             out = extendedmap['error'];
  2643.             out['sort'] = map['sort'] + num.toString();
  2644.         }
  2645.         else {
  2646.             num.toString();
  2647.         }
  2648.         if (typeof(map[num]) == 'undefined') {
  2649.             out = extendedmap['error'];
  2650.             out['sort'] = out['sort'] + num.toString();
  2651.         }
  2652.         else {
  2653.             out = extendedmap[num];
  2654.         }
  2655.         return out;
  2656.     };
  2657.     pub.get = function (num) {
  2658.         if (typeof(num) != 'number' && typeof(num) != 'string') {
  2659.             num = 'error';
  2660.         }
  2661.         else {
  2662.             num.toString();
  2663.         }
  2664.         if (typeof(map[num]) == 'undefined') {
  2665.             return map['error'];
  2666.         }
  2667.         else {
  2668.             return map[num];
  2669.         }
  2670.     };
  2671.     return pub;
  2672. })(window, jQuery, undefined);
  2673. var B24_cart_object = (function ($) {
  2674.     var pub = {};
  2675.     var cart = null;
  2676.     var cartOld = null;
  2677.     var cartLength = null;
  2678.     var comparedCarts = null;
  2679.     var valid = null;
  2680.     var customerStatus = null;
  2681.     var cartStatus = null;
  2682.     var key = 'b24_cart';
  2683.     var ttl = 360000;
  2684.     var setCart = function (cartSource) {
  2685.         cartOld = getCartFromStorage();
  2686.         if (validCart(cartSource)) {
  2687.             cartSource = extendOrderItem(cartSource);
  2688.             cartSource = calculateNetto(cartSource);
  2689.             cartSource = mergeCart(cartSource);
  2690.         }
  2691.         else {
  2692.             cartSource = getEmptyCart(false);
  2693.         }
  2694.         putCartToStorage(cartSource);
  2695.         cart = getCartFromStorage();
  2696.         setCartStatus();
  2697.         return cart;
  2698.     };
  2699.     pub.setCart = setCart;
  2700.     var getEmptyCart = function (valid) {
  2701.         var emptyCart = {empty: true, order_items: []};
  2702.         if (typeof(valid) == 'boolean') {
  2703.             emptyCart.valid = valid;
  2704.         }
  2705.         else {
  2706.             emptyCart.valid = true;
  2707.         }
  2708.         return emptyCart;
  2709.     };
  2710.     var getCart = function () {
  2711.         return cart;
  2712.     };
  2713.     pub.getCart = getCart;
  2714.     pub.deleteCart = function () {
  2715.         return deleteStorage();
  2716.     };
  2717.     pub.getCartLength = function () {
  2718.         if (cartLength != null) {
  2719.             return cartLength;
  2720.         }
  2721.         if (cart == null) {
  2722.             pub.getCart();
  2723.         }
  2724.         if (typeof(cart.order_items) == 'object') {
  2725.             cartLength = cart.order_items.length;
  2726.         }
  2727.         else {
  2728.             cartLength = 0;
  2729.         }
  2730.         return cartLength;
  2731.     };
  2732.     pub.getCustomerStatus = function () {
  2733.         if (customerStatus != null) {
  2734.             return customerStatus;
  2735.         }
  2736.         customerStatus = 'obscureCustomer';
  2737.         var cart = pub.getCart();
  2738.         if (!!cart && typeof(cart.customer) == 'object' && typeof(cart.customer) != 'undefined') {
  2739.             if (typeof(cart.customer.segment_ids) == 'object') {
  2740.                 if (typeof(cart.customer.segment_ids[0]) != 'undefined' && cart.customer.segment_ids[0] == 1) {
  2741.                     customerStatus = 'newCustomer';
  2742.                 }
  2743.                 else {
  2744.                     customerStatus = 'existingCustomer';
  2745.                 }
  2746.             }
  2747.         }
  2748.         return customerStatus;
  2749.     };
  2750.     var setCartStatus = function () {
  2751.         cartStatus = 'empty';
  2752.         if (!cart.empty) {
  2753.             var positions = cart.order_items.length;
  2754.             var positionsOld = cartOld.order_items.length;
  2755.             if (!positions) {
  2756.                 if (positionsOld > 0) {
  2757.                     cartStatus = 'terminated';
  2758.                 }
  2759.                 else {
  2760.                     cartStatus = 'stillEmpty';
  2761.                 }
  2762.             }
  2763.             else {
  2764.                 if (positionsOld > 0) {
  2765.                     if (positions > positionsOld) {
  2766.                         cartStatus = 'addPosition';
  2767.                     }
  2768.                     else if (positions < positionsOld) {
  2769.                         cartStatus = 'deletedPosition';
  2770.                     }
  2771.                     else {
  2772.                         cartStatus = 'haveaLook';
  2773.                     }
  2774.                 }
  2775.                 else {
  2776.                     cartStatus = 'addPositionFirstTime';
  2777.                 }
  2778.                 $.cookie('b24_cart', positions, {path: '/'});
  2779.             }
  2780.         }
  2781.         return cartStatus;
  2782.     };
  2783.     pub.getCartStatus = function () {
  2784.         if (!!cartStatus) {
  2785.             return cartStatus;
  2786.         }
  2787.         cartStatus = 'notincart';
  2788.         return cartStatus;
  2789.     };
  2790.     var validCart = function (cartSource) {
  2791.         var error = '';
  2792.         if (typeof(cartSource) != 'object') {
  2793.             error = 'cart is not an object';
  2794.         }
  2795.         if (typeof(cartSource.order_items) != 'object') {
  2796.             error = 'order_item is not a object';
  2797.             if (typeof(cartSource.order_items) != 'object') {
  2798.                 error = 'there a zero order_items';
  2799.             }
  2800.         }
  2801.         if (!error) {
  2802.             valid = true;
  2803.             return valid;
  2804.         }
  2805.         valid = false;
  2806.         ___b24.tracking.error('B24_cart_object.validCart', error);
  2807.         return valid;
  2808.     };
  2809.     var mergeCart = function (sourceCart) {
  2810.         var mageParams = B24_shoplocation.getMageParams();
  2811.         if (!!mageParams.Q) {
  2812.             sourceCart.quoteID = mageParams.Q;
  2813.         }
  2814.         if (!!mageParams.S) {
  2815.             sourceCart.shopID = mageParams.S;
  2816.         }
  2817.         if (!!mageParams.C) {
  2818.             sourceCart.customerID = mageParams.C;
  2819.         }
  2820.         sourceCart.empty = false;
  2821.         sourceCart.valid = true;
  2822.         return sourceCart;
  2823.     };
  2824.     var calculateNetto = function (sourceCart) {
  2825.         var netTotal = 0;
  2826.         $.each(sourceCart.order_items, function (index, value) {
  2827.             var netTotalItem = value.qty_ordered * value.price - value.discount_amount;
  2828.             var netTotalItemSingle = value.price - value.discount_amount;
  2829.             netTotalItem = Math.round(netTotalItem * 100) / 100;
  2830.             var netTotalItemShippment = netTotalItem;
  2831.             if (value.product_type_extended.sort == 'Glass') {
  2832.                 var shippment = value.qty_ordered * 5;
  2833.                 netTotalItemShippment += shippment;
  2834.             }
  2835.             netTotalItemSingle = Math.round(netTotalItemSingle * 100) / 100;
  2836.             var netTotalItemSingleShipping = netTotalItemSingle;
  2837.             if (value.product_type_extended.sort == 'Glass') {
  2838.                 var shippment = 5;
  2839.                 netTotalItemSingleShipping += shippment;
  2840.             }
  2841.             sourceCart.order_items[index].netTotal = netTotalItem;
  2842.             sourceCart.order_items[index].netTotalSingle = netTotalItemSingle;
  2843.             sourceCart.order_items[index].netTotalItemShippment = netTotalItemShippment;
  2844.             sourceCart.order_items[index].netTotalItemSingleShipping = netTotalItemSingleShipping;
  2845.             netTotal += netTotalItem;
  2846.         });
  2847.         netTotal = netTotal / 1.19;
  2848.         netTotal = Math.round(netTotal * 100) / 100;
  2849.         if (typeof(sourceCart.payment) != 'object') {
  2850.             sourceCart.payment = {};
  2851.         }
  2852.         sourceCart.payment.netTotal = netTotal;
  2853.         return sourceCart;
  2854.     };
  2855.     var extendOrderItem = function (sourceCart) {
  2856.         $.each(sourceCart.order_items, function (index, value) {
  2857.             var pType = parseInt(value.product_type).toString();
  2858.             sourceCart.order_items[index].product_type_name = ___b24.productmap.get(pType);
  2859.             sourceCart.order_items[index].product_type_extended = ___b24.productmap.getExtented(pType);
  2860.             var fgid = value.product_sku;
  2861.             if (typeof(___b24.productmap.getExtented(pType).lens) == 'string') {
  2862.                 fgid += '-' + (___b24.productmap.getExtented(pType).lens.toLowerCase());
  2863.             }
  2864.             if (typeof(___b24.productmap.getExtented(pType).lensext) == 'string') {
  2865.                 fgid += '_' + (___b24.productmap.getExtented(pType).lensext.toLowerCase());
  2866.             }
  2867.             if (typeof(value.lensvalues) == 'object' && typeof(value.lensvalues.LColor) == 'string') {
  2868.                 fgid += '-' + value.lensvalues.LColor;
  2869.             }
  2870.             sourceCart.order_items[index].product_sku_extended = fgid;
  2871.             sourceCart.order_items[index].product_sku_extended_index = fgid;
  2872.             if (typeof(value.product_upselling) != 'undefined' && !!value.product_upselling) {
  2873.                 var glassindex = value.product_upselling.toString().match(/[\d\.]+/i);
  2874.                 sourceCart.order_items[index].product_sku_extended_index += !!glassindex ? '-i' + glassindex[0] : '';
  2875.             }
  2876.             sourceCart.order_items[index].product_sku_extended_clean = fgid.replace(/[-_]/gi, '');
  2877.         });
  2878.         return sourceCart;
  2879.     };
  2880.     var putCartToStorage = function (cartParam) {
  2881.         $.jStorage.set(key, cart_order_object, {'TTL': ttl});
  2882.         return true;
  2883.     };
  2884.     var getCartFromStorage = function () {
  2885.         return $.jStorage.get(key, getEmptyCart());
  2886.     };
  2887.     var getOldCart = function () {
  2888.         return cartOld;
  2889.     };
  2890.     pub.getOldCart = getOldCart;
  2891.     var deleteStorage = function () {
  2892.         $.jStorage.deleteKey(key);
  2893.         return getEmptyCart();
  2894.     };
  2895.     pub.getCartAction = function () {
  2896.         if (!!comparedCarts) {
  2897.             return comparedCarts;
  2898.         }
  2899.         comparedCarts = compareCarts();
  2900.         return comparedCarts;
  2901.     };
  2902.     var compareCarts = function () {
  2903.         if (!cart) {
  2904.             cart = getCart();
  2905.         }
  2906.         if (!cartOld) {
  2907.             cartOld = getOldCart();
  2908.         }
  2909.         var balance = {'action': 'view', 'balance': [], 'balanceId': []};
  2910.         var cartIds = [];
  2911.         $.each(cart.order_items, function (index, value) {
  2912.             cartIds.push(value.id);
  2913.         });
  2914.         var cartOldIds = [];
  2915.         $.each(cartOld.order_items, function (index, value) {
  2916.             cartOldIds.push(value.id);
  2917.         });
  2918.         $.each(cartIds, function (index, value) {
  2919.             if ($.inArray(value, cartOldIds) < 0) {
  2920.                 balance.balanceId.push(value);
  2921.                 balance.balance.push(cart.order_items[index]);
  2922.                 balance.action = 'add';
  2923.             }
  2924.         });
  2925.         if (balance.action == 'view') {
  2926.             $.each(cartOldIds, function (index, value) {
  2927.                 if ($.inArray(value, cartIds) < 0) {
  2928.                     balance.balanceId.push(value);
  2929.                     balance.balance.push(cartOld.order_items[index]);
  2930.                     balance.action = 'del';
  2931.                 }
  2932.             });
  2933.         }
  2934.         if (balance.action == 'view') {
  2935.             $.each(cart.order_items, function (index, value) {
  2936.                 var itemsQty = value.qty_ordered;
  2937.                 var itemsOtyOld = cartOld.order_items[index].qty_ordered;
  2938.                 var differ = itemsQty - itemsOtyOld;
  2939.                 if (differ > 0) {
  2940.                     balance.action = 'add';
  2941.                     balance.balanceId.push(value.id);
  2942.                     var item = $.extend({}, value);
  2943.                     item.qty_ordered = differ;
  2944.                     balance.balance.push(item);
  2945.                 }
  2946.                 else if (differ < 0) {
  2947.                     balance.action = 'del';
  2948.                     balance.balanceId.push(value.id);
  2949.                     var item = $.extend({}, value);
  2950.                     item.qty_ordered = differ;
  2951.                     balance.balance.push(item);
  2952.                 }
  2953.             });
  2954.         }
  2955.         return balance;
  2956.     };
  2957.     pub.compareCarts = compareCarts;
  2958.     return pub;
  2959. })(jQuery);
  2960. var B24_order_object = (function ($) {
  2961.     var pub = {};
  2962.     var order = null;
  2963.     var shortCut = false;
  2964.     pub.getOrder = function (persistent, regex) {
  2965.         if ($.type(persistent) === "regexp") {
  2966.             regex = persistent;
  2967.         }
  2968.         if (shortCut) {
  2969.             return order;
  2970.         }
  2971.         if (B24_shoplocation.get() != 'success') {
  2972.             order = null;
  2973.             return order;
  2974.         }
  2975.         if ($.type(persistent) !== "boolean" || persistent !== true) {
  2976.             if (typeof(order_object) != 'object' || !order_object.virgin) {
  2977.                 order = null;
  2978.                 return order;
  2979.             }
  2980.         }
  2981.         try {
  2982.             if (typeof(regex) == 'object' && !B24_cpid_object.testCpid(regex)) {
  2983.                 return null;
  2984.             }
  2985.         }
  2986.         catch (err) {
  2987.             ___(err);
  2988.         }
  2989.         if (order != null) {
  2990.             return order;
  2991.         }
  2992.         order = B24_cart_object.getCart();
  2993.         order = mergeOrderWithCart(order);
  2994.         if (!B24_debug_status.getMode('success')) {
  2995.             B24_cart_object.deleteCart();
  2996.         }
  2997.         return order;
  2998.     }
  2999.     pub.setOrder = function (ord) {
  3000.         order = null;
  3001.         if (typeof(ord) == 'object') {
  3002.             order = ord;
  3003.         }
  3004.         else {
  3005.             order = B24_cart_object.getCart();
  3006.         }
  3007.         shortCut = true;
  3008.         return order;
  3009.     }
  3010.     pub.deleteOrder = function () {
  3011.         order = null;
  3012.         return order;
  3013.     }
  3014.     var setQuantity = function (ord) {
  3015.         var qty = 0;
  3016.         $.each(ord.order_items, function (index, value) {
  3017.             qty += parseInt(value.qty_ordered, 10);
  3018.         });
  3019.         ord.quantity = qty;
  3020.         return ord;
  3021.     };
  3022.     var mergeOrderWithCart = function (ord) {
  3023.         var orderObject = extendOrderItem(order_object);
  3024.         orderObject = calculateNetto(orderObject);
  3025.         orderObject = calculateBrutto(orderObject);
  3026.         orderObject = stopTrackingByConversionComment(orderObject);
  3027.         orderObject = setQuantity(orderObject);
  3028.         return orderObject;
  3029.     };
  3030.     var calculateNetto = function (sourceCart) {
  3031.         var netTotal = 0;
  3032.         $.each(sourceCart.order_items, function (index, value) {
  3033.             var netTotalItem = value.qty_ordered * value.price - value.discount_amount;
  3034.             var netTotalItemSingle = value.price - value.discount_amount;
  3035.             netTotalItem = Math.round(netTotalItem * 100) / 100;
  3036.             var netTotalItemShippment = netTotalItem;
  3037.             if (value.product_type_extended.sort == 'Glass') {
  3038.                 var shippment = value.qty_ordered * 5;
  3039.                 netTotalItemShippment += shippment;
  3040.             }
  3041.             netTotalItemSingle = Math.round(netTotalItemSingle * 100) / 100;
  3042.             var netTotalItemSingleShipping = netTotalItemSingle;
  3043.             if (value.product_type_extended.sort == 'Glass') {
  3044.                 var shippment = 5;
  3045.                 netTotalItemSingleShipping += shippment;
  3046.             }
  3047.             sourceCart.order_items[index].netTotal = netTotalItem;
  3048.             sourceCart.order_items[index].netTotalSingle = netTotalItemSingle;
  3049.             sourceCart.order_items[index].netTotalItemShippment = netTotalItemShippment;
  3050.             sourceCart.order_items[index].netTotalItemSingleShipping = netTotalItemSingleShipping;
  3051.             netTotal += netTotalItem;
  3052.         });
  3053.         sourceCart.payment.totalClean = Math.round(netTotal * 100) / 100;
  3054.         netTotal = netTotal / 1.19;
  3055.         netTotal = Math.round(netTotal * 100) / 100;
  3056.         if (typeof(sourceCart.payment) != 'object') {
  3057.             sourceCart.payment = {};
  3058.         }
  3059.         sourceCart.payment.netTotal = netTotal;
  3060.         return sourceCart;
  3061.     };
  3062.     var calculateBrutto = function (sourceCart) {
  3063.         $.each(sourceCart.order_items, function (index, value) {
  3064.             sourceCart.order_items[index].bruttoTotal = value.netTotal;
  3065.             if (value.product_type_extended.sort == 'Glass') {
  3066.                 var shipping = 5 * parseInt(value.qty_ordered, 10);
  3067.                 sourceCart.order_items[index].bruttoTotal += shipping;
  3068.             }
  3069.         });
  3070.         return sourceCart;
  3071.     };
  3072.     var extendOrderItem = function (sourceCart) {
  3073.         $.each(sourceCart.order_items, function (index, value) {
  3074.             var pType = value.product_type + '';
  3075.             sourceCart.order_items[index].product_type_name = ___b24.productmap.get(pType);
  3076.             sourceCart.order_items[index].product_type_extended = ___b24.productmap.getExtented(pType);
  3077.             var fgid = value.product_sku;
  3078.             if (typeof(___b24.productmap.getExtented(pType).lens) == 'string') {
  3079.                 fgid += '-' + (___b24.productmap.getExtented(pType).lens.toLowerCase());
  3080.             }
  3081.             if (typeof(___b24.productmap.getExtented(pType).lensext) == 'string') {
  3082.                 fgid += '_' + (___b24.productmap.getExtented(pType).lensext.toLowerCase());
  3083.             }
  3084.             if (typeof(value.lensvalues) == 'object' && typeof(value.lensvalues.LColor) == 'string') {
  3085.                 fgid += '-' + value.lensvalues.LColor;
  3086.             }
  3087.             sourceCart.order_items[index].product_sku_extended = fgid;
  3088.             sourceCart.order_items[index].product_sku_extended_index = fgid;
  3089.             if (typeof(value.product_upselling) != 'undefined' && !!value.product_upselling) {
  3090.                 var glassindex = value.product_upselling.toString().match(/[\d\.]+/i);
  3091.                 sourceCart.order_items[index].product_sku_extended_index += !!glassindex ? '-i' + glassindex[0] : '';
  3092.             }
  3093.             sourceCart.order_items[index].product_sku_extended_clean = fgid.replace(/[-_]/gi, '');
  3094.         });
  3095.         return sourceCart;
  3096.     };
  3097.     var stopTrackingByConversionComment = function (ord) {
  3098.         ord.tracking = true;
  3099.         if (!!ord && typeof(ord.customer_comment) == 'string' && !!ord.customer_comment.match(/\#test\#/i)) {
  3100.             ord.tracking = false;
  3101.         }
  3102.         return ord;
  3103.     };
  3104.     return pub;
  3105. })(jQuery);
  3106. var B24_cpid_object = (function ($) {
  3107.     var pub = {};
  3108.     var cpid = null;
  3109.     var source = null;
  3110.     var domain = null;
  3111.     var init = function () {
  3112.         domain = $.getlocations().hostname;
  3113.         if (domain.match(/(start|www)\.brille24\.de/i) != null) {
  3114.             domain = 'brille24.de';
  3115.         }
  3116.         setUpCpids();
  3117.     };
  3118.     pub.init = init;
  3119.     var getCpid = function () {
  3120.         cpid = $.cookie('b24_entrycpid');
  3121.         if (cpid == null) {
  3122.             cpid = '';
  3123.         }
  3124.         return cpid;
  3125.     };
  3126.     pub.getCpid = getCpid;
  3127.     var testCpid = function (regex) {
  3128.         if (typeof(regex) != 'object') {
  3129.             return false;
  3130.         }
  3131.         if (typeof(regex.test) != 'function') {
  3132.             return false;
  3133.         }
  3134.         if (cpid == null) {
  3135.             getCpid();
  3136.         }
  3137.         return(cpid.match(regex) != null);
  3138.     };
  3139.     pub.testCpid = testCpid;
  3140.     var setUpCpids = function () {
  3141.         var b24_cpid = '';
  3142.         if (typeof($.getlocations().params.b24_cpid) == "string") {
  3143.             b24_cpid = $.getlocations().params.b24_cpid;
  3144.         }
  3145.         else if (!!getCpid()) {
  3146.             return false;
  3147.         }
  3148.         else {
  3149.             b24_cpid = getSource();
  3150.         }
  3151.         var exdays = 30;
  3152.         if (b24_cpid.match(/^(direct|organic|referrer)$/i) != null) {
  3153.             exdays = 1;
  3154.         }
  3155.         if (b24_cpid == 'null') {
  3156.             b24_cpid = null;
  3157.         }
  3158.         $.cookie("B24_CampaignId", b24_cpid, {'path': '/', 'expires': 30, 'domain': domain});
  3159.         $.cookie("b24_entrycpid", b24_cpid, {'path': '/', 'expires': exdays, 'domain': domain});
  3160.         return true;
  3161.     };
  3162.     var getSource = function () {
  3163.         if (source != null) {
  3164.             return source;
  3165.         }
  3166.         var referrer = document.referrer;
  3167.         var paramarray = referrer.replace(/^[^?]+\?/i, '').split('&');
  3168.         var params = {};
  3169.         $.each(paramarray, function (index, value) {
  3170.             var arr = value.split('=');
  3171.             params[arr[0]] = arr[1];
  3172.         });
  3173.         if (referrer == '') {
  3174.             source = 'direct';
  3175.         }
  3176.         else if (typeof(params.esrc) == 'string') {
  3177.             source = 'organic';
  3178.         }
  3179.         else {
  3180.             source = 'referrer';
  3181.         }
  3182.         return source;
  3183.     };
  3184.     pub.getSource = getSource;
  3185.     pub.init();
  3186.     return pub;
  3187. })(jQuery);
  3188. var B24_product_object = (function ($) {
  3189.     var pub = {};
  3190.     var product = null;
  3191.     pub.getList = function (num) {
  3192.         var sku = [];
  3193.         $('.products .canvas>span a').each(function () {
  3194.             var skuext = '';
  3195.             var url = $(this).attr('href');
  3196.             var matches = url.match(/frame\=([0-9a-z]+).*glass\=([0-9a-z]+)?/i);
  3197.             if (!!matches) {
  3198.                 matches.shift();
  3199.                 skuext = matches.join('') + '0000';
  3200.                 sku.push(skuext);
  3201.             }
  3202.         });
  3203.         if (typeof(num) == 'number') {
  3204.             sku = sku.slice(0, num);
  3205.         }
  3206.         return sku;
  3207.     };
  3208.     pub.get = function () {
  3209.         product = {};
  3210.         product.sku = 'undefined';
  3211.         product.sku_extended = 'undefined';
  3212.         product.name = 'undefined';
  3213.         product.price = 'undefined';
  3214.         product.netPrice = 'undefined';
  3215.         product.typeName = 'undefined';
  3216.         product.sku_extended_clean = 'undefined';
  3217.         try {
  3218.             if (typeof(bundleMap) == 'object') {
  3219.                 product.sku = $.b24_get_sku();
  3220.                 var tinting = $.b24_get_lenscolor();
  3221.                 var kind = $.b24_get_glasstype();
  3222.                 product.sku_extended = product.sku;
  3223.                 product.sku_extended = product.sku + '-' + kind + '-' + tinting;
  3224.                 product.sku_extended_clean = product.sku_extended.replace(/[^a-z0-9]/ig, '');
  3225.                 product.name = $.b24_get_product_name();
  3226.                 product.price = $.b24_get_total_price();
  3227.                 product.typeName = 'Brille';
  3228.             }
  3229.             else if (typeof(b24_product_info) == 'object') {
  3230.                 product.name = b24_product_info.name;
  3231.                 product.sku = b24_product_info.sku;
  3232.                 product.price = optionsPrice.productPrice;
  3233.                 product.sku_extended = product.sku;
  3234.                 product.sku_extended_clean = product.sku_extended.replace(/[^a-z0-9]/ig, '');
  3235.             }
  3236.             if (product.price != 'undefined') {
  3237.                 try {
  3238.                     product.netPrice = Math.round(product.price / 1.19 * 100) / 100;
  3239.                 }
  3240.                 catch (err) {
  3241.                     ___b24.tracking.error('B24_product_object.get', err);
  3242.                 }
  3243.             }
  3244.         }
  3245.         catch (err) {
  3246.             ___b24.tracking.error('B24_product_object.get.sku_extended', err);
  3247.         }
  3248.         return product;
  3249.     }
  3250.     return pub;
  3251. })(jQuery);
  3252. var B24_customer_object = (function ($) {
  3253.     var pub = {};
  3254.     var customer = null;
  3255.     var loggedIn = function () {
  3256.         if (customer != null) {
  3257.             return customer;
  3258.         }
  3259.         customer = false;
  3260.         if (typeof($.cookie) != 'undefined' && $.cookie('shoploggedin') == 1) {
  3261.             customer = true;
  3262.         }
  3263.         return customer;
  3264.     }
  3265.     pub.loggedIn = loggedIn;
  3266.     var getCustomerId = function () {
  3267.         return B24_shoplocation.getMageParams().C;
  3268.     };
  3269.     pub.getCustomerId = getCustomerId;
  3270.     return pub;
  3271. })(jQuery);
  3272. ;
  3273.  
  3274. (function ($) {
  3275.     $.fn.nivoSlider = function (options) {
  3276.         var settings = $.extend({}, $.fn.nivoSlider.defaults, options);
  3277.         return this.each(function () {
  3278.             var vars = {currentSlide: 0, currentImage: '', totalSlides: 0, randAnim: '', running: false, paused: false, stop: false};
  3279.             var slider = $(this);
  3280.             slider.data('nivo:vars', vars);
  3281.             slider.css('position', 'relative');
  3282.             slider.width('1px');
  3283.             slider.height('1px');
  3284.             slider.addClass('nivoSlider');
  3285.             var kids = slider.children();
  3286.             kids.each(function () {
  3287.                 var child = $(this);
  3288.                 if (!child.is('img')) {
  3289.                     if (child.is('a')) {
  3290.                         child.addClass('nivo-imageLink')
  3291.                     }
  3292.                     child = child.find('img:first')
  3293.                 }
  3294.                 var childWidth = child.width();
  3295.                 if (childWidth == 0) {
  3296.                     childWidth = child.attr('width');
  3297.                 }
  3298.                 var childHeight = child.height();
  3299.                 if (childHeight == 0) {
  3300.                     childHeight = child.attr('height');
  3301.                 }
  3302.                 if (childWidth > slider.width()) {
  3303.                     slider.width(childWidth)
  3304.                 }
  3305.                 if (childHeight > slider.height()) {
  3306.                     slider.height(childHeight)
  3307.                 }
  3308.                 child.css('display', 'none');
  3309.                 vars.totalSlides++
  3310.             });
  3311.             if (settings.startSlide > 0) {
  3312.                 if (settings.startSlide >= vars.totalSlides) {
  3313.                     settings.startSlide = vars.totalSlides - 1;
  3314.                 }
  3315.                 vars.currentSlide = settings.startSlide
  3316.             }
  3317.             if ($(kids[vars.currentSlide]).is('img')) {
  3318.                 vars.currentImage = $(kids[vars.currentSlide])
  3319.             }
  3320.             else {
  3321.                 vars.currentImage = $(kids[vars.currentSlide]).find('img:first')
  3322.             }
  3323.             if ($(kids[vars.currentSlide]).is('a')) {
  3324.                 $(kids[vars.currentSlide]).css('display', 'block')
  3325.             }
  3326.             slider.css('background', 'url(' + vars.currentImage.attr('src') + ') no-repeat');
  3327.             for (var i = 0; i < settings.slices; i++) {
  3328.                 var sliceWidth = Math.round(slider.width() / settings.slices);
  3329.                 if (i == settings.slices - 1) {
  3330.                     slider.append($('<div class="nivo-slice"></div>').css({left: (sliceWidth * i) + 'px', width: (slider.width() - (sliceWidth * i))
  3331.                             + 'px'}))
  3332.                 }
  3333.                 else {
  3334.                     slider.append($('<div class="nivo-slice"></div>').css({left: (sliceWidth * i) + 'px', width: sliceWidth + 'px'}))
  3335.                 }
  3336.             }
  3337.             slider.append($('<div class="nivo-caption"><p></p></div>').css({display: 'none', opacity: settings.captionOpacity}));
  3338.             if (vars.currentImage.attr('title') != '') {
  3339.                 $('.nivo-caption p', slider).html(vars.currentImage.attr('title'));
  3340.                 $('.nivo-caption', slider).fadeIn(settings.animSpeed)
  3341.             }
  3342.             var timer = 0;
  3343.             if (!settings.manualAdvance) {
  3344.                 timer = setInterval(function () {
  3345.                     nivoRun(slider, kids, settings, false)
  3346.                 }, settings.pauseTime)
  3347.             }
  3348.             if (settings.directionNav) {
  3349.                 slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav">Prev</a><a class="nivo-nextNav">Next</a></div>');
  3350.                 if (settings.directionNavHide) {
  3351.                     $('.nivo-directionNav', slider).hide();
  3352.                     slider.hover(function () {
  3353.                         $('.nivo-directionNav', slider).show();
  3354.                     }, function () {
  3355.                         $('.nivo-directionNav', slider).hide();
  3356.                     })
  3357.                 }
  3358.                 $('a.nivo-prevNav', slider).live('click', function () {
  3359.                     if (vars.running) {
  3360.                         return false;
  3361.                     }
  3362.                     clearInterval(timer);
  3363.                     timer = '';
  3364.                     vars.currentSlide -= 2;
  3365.                     nivoRun(slider, kids, settings, 'prev')
  3366.                 });
  3367.                 $('a.nivo-nextNav', slider).live('click', function () {
  3368.                     if (vars.running) {
  3369.                         return false;
  3370.                     }
  3371.                     clearInterval(timer);
  3372.                     timer = '';
  3373.                     nivoRun(slider, kids, settings, 'next')
  3374.                 })
  3375.             }
  3376.             if (settings.controlNav) {
  3377.                 var nivoControl = $('<div class="nivo-controlNav"></div>');
  3378.                 slider.append(nivoControl);
  3379.                 for (var i = 0; i < kids.length; i++) {
  3380.                     var u = i + 1;
  3381.                     if (settings.controlNavThumbs) {
  3382.                         var child = kids.eq(i);
  3383.                         if (!child.is('img')) {
  3384.                             child = child.find('img:first')
  3385.                         }
  3386.                         nivoControl.append('<a class="nivo-control" rel="' + i + '"><img src="'
  3387.                                 + child.attr('src').replace(settings.controlNavThumbsSearch, settings.controlNavThumbsReplace) + '"></a>')
  3388.                     }
  3389.                     else {
  3390.                         nivoControl.append('<a class="nivo-control" rel="' + i + '">' + u + '</a>')
  3391.                     }
  3392.                 }
  3393.                 $('.nivo-controlNav a:eq(' + vars.currentSlide + ')', slider).addClass('active');
  3394.                 $(document).on("click", ".nivo-controlNav a, " + slider, function () {
  3395.                     if (vars.running) {
  3396.                         return false;
  3397.                     }
  3398.                     if ($(this).hasClass('active')) {
  3399.                         return false;
  3400.                     }
  3401.                     clearInterval(timer);
  3402.                     timer = '';
  3403.                     slider.css('background', 'url(' + vars.currentImage.attr('src') + ') no-repeat');
  3404.                     vars.currentSlide = $(this).attr('rel') - 1;
  3405.                     nivoRun(slider, kids, settings, 'control')
  3406.                 })
  3407.             }
  3408.             if (settings.keyboardNav) {
  3409.                 $(window).keypress(function (event) {
  3410.                     if (event.keyCode == '37') {
  3411.                         if (vars.running) {
  3412.                             return false;
  3413.                         }
  3414.                         clearInterval(timer);
  3415.                         timer = '';
  3416.                         vars.currentSlide -= 2;
  3417.                         nivoRun(slider, kids, settings, 'prev')
  3418.                     }
  3419.                     if (event.keyCode == '39') {
  3420.                         if (vars.running) {
  3421.                             return false;
  3422.                         }
  3423.                         clearInterval(timer);
  3424.                         timer = '';
  3425.                         nivoRun(slider, kids, settings, 'next')
  3426.                     }
  3427.                 })
  3428.             }
  3429.             if (settings.pauseOnHover) {
  3430.                 slider.hover(function () {
  3431.                     vars.paused = true;
  3432.                     clearInterval(timer);
  3433.                     timer = ''
  3434.                 }, function () {
  3435.                     vars.paused = false;
  3436.                     if (timer == '' && !settings.manualAdvance) {
  3437.                         timer = setInterval(function () {
  3438.                             nivoRun(slider, kids, settings, false)
  3439.                         }, settings.pauseTime)
  3440.                     }
  3441.                 })
  3442.             }
  3443.             slider.bind('nivo:animFinished', function () {
  3444.                 vars.running = false;
  3445.                 $(kids).each(function () {
  3446.                     if ($(this).is('a')) {
  3447.                         $(this).css('display', 'none')
  3448.                     }
  3449.                 });
  3450.                 if ($(kids[vars.currentSlide]).is('a')) {
  3451.                     $(kids[vars.currentSlide]).css('display', 'block')
  3452.                 }
  3453.                 if (timer == '' && !vars.paused && !settings.manualAdvance) {
  3454.                     timer = setInterval(function () {
  3455.                         nivoRun(slider, kids, settings, false)
  3456.                     }, settings.pauseTime)
  3457.                 }
  3458.                 settings.afterChange.call(this)
  3459.             })
  3460.         });
  3461.         function nivoRun(slider, kids, settings, nudge) {
  3462.             var vars = slider.data('nivo:vars');
  3463.             if ((!vars || vars.stop) && !nudge) {
  3464.                 return false;
  3465.             }
  3466.             settings.beforeChange.call(this);
  3467.             if (!nudge) {
  3468.                 slider.css('background', 'url(' + vars.currentImage.attr('src') + ') no-repeat')
  3469.             }
  3470.             else {
  3471.                 if (nudge == 'prev') {
  3472.                     slider.css('background', 'url(' + vars.currentImage.attr('src') + ') no-repeat')
  3473.                 }
  3474.                 if (nudge == 'next') {
  3475.                     slider.css('background', 'url(' + vars.currentImage.attr('src') + ') no-repeat')
  3476.                 }
  3477.             }
  3478.             vars.currentSlide++;
  3479.             if (vars.currentSlide == vars.totalSlides) {
  3480.                 vars.currentSlide = 0;
  3481.                 settings.slideshowEnd.call(this)
  3482.             }
  3483.             if (vars.currentSlide < 0) {
  3484.                 vars.currentSlide = (vars.totalSlides - 1);
  3485.             }
  3486.             if ($(kids[vars.currentSlide]).is('img')) {
  3487.                 vars.currentImage = $(kids[vars.currentSlide])
  3488.             }
  3489.             else {
  3490.                 vars.currentImage = $(kids[vars.currentSlide]).find('img:first')
  3491.             }
  3492.             if (settings.controlNav) {
  3493.                 $('.nivo-controlNav a', slider).removeClass('active');
  3494.                 $('.nivo-controlNav a:eq(' + vars.currentSlide + ')', slider).addClass('active')
  3495.             }
  3496.             if (vars.currentImage.attr('title') != '') {
  3497.                 if ($('.nivo-caption', slider).css('display') == 'block') {
  3498.                     $('.nivo-caption p', slider).fadeOut(settings.animSpeed, function () {
  3499.                         $(this).html(vars.currentImage.attr('title'));
  3500.                         $(this).fadeIn(settings.animSpeed)
  3501.                     })
  3502.                 }
  3503.                 else {
  3504.                     $('.nivo-caption p', slider).html(vars.currentImage.attr('title'))
  3505.                 }
  3506.                 $('.nivo-caption', slider).fadeIn(settings.animSpeed)
  3507.             }
  3508.             else {
  3509.                 $('.nivo-caption', slider).fadeOut(settings.animSpeed)
  3510.             }
  3511.             var i = 0;
  3512.             $('.nivo-slice', slider).each(function () {
  3513.                 var sliceWidth = Math.round(slider.width() / settings.slices);
  3514.                 $(this).css({height: '0px', opacity: '0', background: 'url(' + vars.currentImage.attr('src') + ') no-repeat -' + ((sliceWidth + (i
  3515.                         * sliceWidth)) - sliceWidth) + 'px 0%'});
  3516.                 i++
  3517.             });
  3518.             if (settings.effect == 'random') {
  3519.                 var anims = new Array("sliceDownRight",
  3520.                         "sliceDownLeft",
  3521.                         "sliceUpRight",
  3522.                         "sliceUpLeft",
  3523.                         "sliceUpDown",
  3524.                         "sliceUpDownLeft",
  3525.                         "fold",
  3526.                         "fade");
  3527.                 vars.randAnim = anims[Math.floor(Math.random() * (anims.length + 1))];
  3528.                 if (vars.randAnim == undefined) {
  3529.                     vars.randAnim = 'fade'
  3530.                 }
  3531.             }
  3532.             vars.running = true;
  3533.             if (settings.effect == 'sliceDown' || settings.effect == 'sliceDownRight' || vars.randAnim == 'sliceDownRight' || settings.effect
  3534.                     == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft') {
  3535.                 var timeBuff = 0;
  3536.                 var i = 0;
  3537.                 var slices = $('.nivo-slice', slider);
  3538.                 if (settings.effect == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft') {
  3539.                     slices = $('.nivo-slice', slider).reverse();
  3540.                 }
  3541.                 slices.each(function () {
  3542.                     var slice = $(this);
  3543.                     slice.css('top', '0px');
  3544.                     if (i == settings.slices - 1) {
  3545.                         setTimeout(function () {
  3546.                             slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed, '', function () {
  3547.                                 slider.trigger('nivo:animFinished')
  3548.                             })
  3549.                         }, (100 + timeBuff))
  3550.                     }
  3551.                     else {
  3552.                         setTimeout(function () {
  3553.                             slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed)
  3554.                         }, (100 + timeBuff))
  3555.                     }
  3556.                     timeBuff += 50;
  3557.                     i++
  3558.                 })
  3559.             }
  3560.             else if (settings.effect == 'sliceUp' || settings.effect == 'sliceUpRight' || vars.randAnim == 'sliceUpRight' || settings.effect
  3561.                     == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft') {
  3562.                 var timeBuff = 0;
  3563.                 var i = 0;
  3564.                 var slices = $('.nivo-slice', slider);
  3565.                 if (settings.effect == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft') {
  3566.                     slices = $('.nivo-slice', slider).reverse();
  3567.                 }
  3568.                 slices.each(function () {
  3569.                     var slice = $(this);
  3570.                     slice.css('bottom', '0px');
  3571.                     if (i == settings.slices - 1) {
  3572.                         setTimeout(function () {
  3573.                             slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed, '', function () {
  3574.                                 slider.trigger('nivo:animFinished')
  3575.                             })
  3576.                         }, (100 + timeBuff))
  3577.                     }
  3578.                     else {
  3579.                         setTimeout(function () {
  3580.                             slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed)
  3581.                         }, (100 + timeBuff))
  3582.                     }
  3583.                     timeBuff += 50;
  3584.                     i++
  3585.                 })
  3586.             }
  3587.             else if (settings.effect == 'sliceUpDown' || settings.effect == 'sliceUpDownRight' || vars.randAnim == 'sliceUpDown' || settings.effect
  3588.                     == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft') {
  3589.                 var timeBuff = 0;
  3590.                 var i = 0;
  3591.                 var v = 0;
  3592.                 var slices = $('.nivo-slice', slider);
  3593.                 if (settings.effect == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft') {
  3594.                     slices = $('.nivo-slice', slider).reverse();
  3595.                 }
  3596.                 slices.each(function () {
  3597.                     var slice = $(this);
  3598.                     if (i == 0) {
  3599.                         slice.css('top', '0px');
  3600.                         i++
  3601.                     }
  3602.                     else {
  3603.                         slice.css('bottom', '0px');
  3604.                         i = 0
  3605.                     }
  3606.                     if (v == settings.slices - 1) {
  3607.                         setTimeout(function () {
  3608.                             slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed, '', function () {
  3609.                                 slider.trigger('nivo:animFinished')
  3610.                             })
  3611.                         }, (100 + timeBuff))
  3612.                     }
  3613.                     else {
  3614.                         setTimeout(function () {
  3615.                             slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed)
  3616.                         }, (100 + timeBuff))
  3617.                     }
  3618.                     timeBuff += 50;
  3619.                     v++
  3620.                 })
  3621.             }
  3622.             else if (settings.effect == 'fold' || vars.randAnim == 'fold') {
  3623.                 var timeBuff = 0;
  3624.                 var i = 0;
  3625.                 $('.nivo-slice', slider).each(function () {
  3626.                     var slice = $(this);
  3627.                     var origWidth = slice.width();
  3628.                     slice.css({top: '0px', height: '100%', width: '0px'});
  3629.                     if (i == settings.slices - 1) {
  3630.                         setTimeout(function () {
  3631.                             slice.animate({width: origWidth, opacity: '1.0'}, settings.animSpeed, '', function () {
  3632.                                 slider.trigger('nivo:animFinished')
  3633.                             })
  3634.                         }, (100 + timeBuff))
  3635.                     }
  3636.                     else {
  3637.                         setTimeout(function () {
  3638.                             slice.animate({width: origWidth, opacity: '1.0'}, settings.animSpeed)
  3639.                         }, (100 + timeBuff))
  3640.                     }
  3641.                     timeBuff += 50;
  3642.                     i++
  3643.                 })
  3644.             }
  3645.             else if (settings.effect == 'fade' || vars.randAnim == 'fade') {
  3646.                 var i = 0;
  3647.                 $('.nivo-slice', slider).each(function () {
  3648.                     $(this).css('height', '100%');
  3649.                     if (i == settings.slices - 1) {
  3650.                         $(this).animate({opacity: '1.0'}, (settings.animSpeed * 2), '', function () {
  3651.                             slider.trigger('nivo:animFinished')
  3652.                         })
  3653.                     }
  3654.                     else {
  3655.                         $(this).animate({opacity: '1.0'}, (settings.animSpeed * 2))
  3656.                     }
  3657.                     i++
  3658.                 })
  3659.             }
  3660.         }
  3661.     };
  3662.     $.fn.nivoSlider.defaults =
  3663.     {effect: 'fade', slices: 15, animSpeed: 700, pauseTime: 4700, startSlide: 0, directionNav: false, directionNavHide: true, controlNav: true, controlNavThumbs: false, controlNavThumbsSearch: '.jpg', controlNavThumbsReplace: '_thumb.jpg', keyboardNav: true, pauseOnHover: true, manualAdvance: false, captionOpacity: 0.8, beforeChange: function () {
  3664.     }, afterChange: function () {
  3665.     }, slideshowEnd: function () {
  3666.     }};
  3667.     $.fn.reverse = [].reverse
  3668. })(jQuery);
  3669. ;
  3670. /*!
  3671.  * jQuery Tools v1.2.7 - The missing UI library for the Web
  3672.  *
  3673.  * overlay/overlay.js
  3674.  * toolbox/toolbox.expose.js
  3675.  *
  3676.  * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
  3677.  *
  3678.  * http://flowplayer.org/tools/
  3679.  *
  3680.  */
  3681. (function (a) {
  3682.     a.tools = a.tools || {version: "v1.2.7"}, a.tools.overlay = {addEffect: function (a, b, d) {
  3683.         c[a] = [b, d]
  3684.     }, conf: {close: null, closeOnClick: !0, closeOnEsc: !0, closeSpeed: "fast", effect: "default", fixed: !a.browser.msie || a.browser.version
  3685.             > 6, left: "center", load: !1, mask: null, oneInstance: !0, speed: "normal", target: null, top: "10%"}};
  3686.     var b = [], c = {};
  3687.     a.tools.overlay.addEffect("default", function (b, c) {
  3688.         var d = this.getConf(), e = a(window);
  3689.         d.fixed || (b.top += e.scrollTop(), b.left += e.scrollLeft()), b.position =
  3690.                 d.fixed ? "fixed" : "absolute", this.getOverlay().css(b).fadeIn(d.speed, c)
  3691.     }, function (a) {
  3692.         this.getOverlay().fadeOut(this.getConf().closeSpeed, a)
  3693.     });
  3694.     function d(d, e) {
  3695.         var f = this, g = d.add(f), h = a(window), i, j, k, l = a.tools.expose && (e.mask || e.expose), m = Math.random().toString().slice(10);
  3696.         l && (typeof l == "string" && (l = {color: l}), l.closeOnClick = l.closeOnEsc = !1);
  3697.         var n = e.target || d.attr("rel");
  3698.         j = n ? a(n) : null || d;
  3699.         if (!j.length) {
  3700.             throw"Could not find Overlay: " + n;
  3701.         }
  3702.         d && d.index(j) == -1 && d.click(function (a) {
  3703.             f.load(a);
  3704.             return a.preventDefault()
  3705.         }), a.extend(f, {load: function (d) {
  3706.             if (f.isOpened()) {
  3707.                 return f;
  3708.             }
  3709.             var i = c[e.effect];
  3710.             if (!i) {
  3711.                 throw"Overlay: cannot find effect : \"" + e.effect + "\"";
  3712.             }
  3713.             e.oneInstance && a.each(b, function () {
  3714.                 this.close(d)
  3715.             }), d = d || a.Event(), d.type = "onBeforeLoad", g.trigger(d);
  3716.             if (d.isDefaultPrevented()) {
  3717.                 return f;
  3718.             }
  3719.             k = !0, l && a(j).expose(l);
  3720.             var n = e.top, o = e.left, p = j.outerWidth({margin: !0}), q = j.outerHeight({margin: !0});
  3721.             typeof n == "string" && (n = n == "center" ? Math.max((h.height() - q) / 2, 0) : parseInt(n, 10) / 100 * h.height()), o == "center"
  3722.                     && (o = Math.max((h.width() - p) / 2, 0)), i[0].call(f, {top: n, left: o}, function () {
  3723.                 k && (d.type = "onLoad", g.trigger(d))
  3724.             }), l && e.closeOnClick && a.mask.getMask().one("click", f.close), e.closeOnClick && a(document).on("click." + m, function (b) {
  3725.                 a(b.target).parents(j).length || f.close(b)
  3726.             }), e.closeOnEsc && a(document).on("keydown." + m, function (a) {
  3727.                 a.keyCode == 27 && f.close(a)
  3728.             });
  3729.             return f
  3730.         }, close: function (b) {
  3731.             if (!f.isOpened()) {
  3732.                 return f;
  3733.             }
  3734.             b = b || a.Event(), b.type = "onBeforeClose", g.trigger(b);
  3735.             if (!b.isDefaultPrevented()) {
  3736.                 k = !1, c[e.effect][1].call(f, function () {
  3737.                     b.type = "onClose", g.trigger(b)
  3738.                 }), a(document).off("click." + m + " keydown." + m), l && a.mask.close();
  3739.                 return f
  3740.             }
  3741.         }, getOverlay: function () {
  3742.             return j
  3743.         }, getTrigger: function () {
  3744.             return d
  3745.         }, getClosers: function () {
  3746.             return i
  3747.         }, isOpened: function () {
  3748.             return k
  3749.         }, getConf: function () {
  3750.             return e
  3751.         }}), a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","), function (b, c) {
  3752.             a.isFunction(e[c]) && a(f).on(c, e[c]), f[c] = function (b) {
  3753.                 b && a(f).on(c, b);
  3754.                 return f
  3755.             }
  3756.         }), i = j.find(e.close || ".close"), !i.length && !e.close && (i = a("<a class=\"close\"></a>"), j.prepend(i)), i.click(function (a) {
  3757.             f.close(a)
  3758.         }), e.load && f.load()
  3759.     }
  3760.  
  3761.     a.fn.overlay = function (c) {
  3762.         var e = this.data("overlay");
  3763.         if (e) {
  3764.             return e;
  3765.         }
  3766.         a.isFunction(c) && (c = {onBeforeLoad: c}), c = a.extend(!0, {}, a.tools.overlay.conf, c), this.each(function () {
  3767.             e = new d(a(this), c), b.push(e), a(this).data("overlay", e)
  3768.         });
  3769.         return c.api ? e : this
  3770.     }
  3771. })(jQuery);
  3772. (function (a) {
  3773.     a.tools = a.tools || {version: "v1.2.7"};
  3774.     var b;
  3775.     b =
  3776.             a.tools.expose =
  3777.             {conf: {maskId: "exposeMask", loadSpeed: "slow", closeSpeed: "fast", closeOnClick: !0, closeOnEsc: !0, zIndex: 9998, opacity: .8, startOpacity: 0, color: "#fff", onLoad: null, onClose: null}};
  3778.     function c() {
  3779.         if (a.browser.msie) {
  3780.             var b = a(document).height(), c = a(window).height();
  3781.             return[window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, b - c < 20 ? c : b]
  3782.         }
  3783.         return[a(document).width(), a(document).height()]
  3784.     }
  3785.  
  3786.     function d(b) {
  3787.         if (b) {
  3788.             return b.call(a.mask)
  3789.         }
  3790.     }
  3791.  
  3792.     var e, f, g, h, i;
  3793.     a.mask = {load: function (j, k) {
  3794.         if (g) {
  3795.             return this;
  3796.         }
  3797.         typeof j == "string" && (j = {color: j}), j = j || h, h = j = a.extend(a.extend({}, b.conf), j), e = a("#" + j.maskId), e.length || (e =
  3798.                 a("<div/>").attr("id", j.maskId), a("body").append(e));
  3799.         var l = c();
  3800.         e.css({position: "absolute", top: 0, left: 0, width: l[0], height: l[1], display: "none", opacity: j.startOpacity, zIndex: j.zIndex}), j.color
  3801.                 && e.css("backgroundColor", j.color);
  3802.         if (d(j.onBeforeLoad) === !1) {
  3803.             return this;
  3804.         }
  3805.         j.closeOnEsc && a(document).on("keydown.mask", function (b) {
  3806.             b.keyCode == 27 && a.mask.close(b)
  3807.         }), j.closeOnClick && e.on("click.mask", function (b) {
  3808.             a.mask.close(b)
  3809.         }), a(window).on("resize.mask", function () {
  3810.             a.mask.fit()
  3811.         }), k && k.length && (i = k.eq(0).css("zIndex"), a.each(k, function () {
  3812.             var b = a(this);
  3813.             /relative|absolute|fixed/i.test(b.css("position")) || b.css("position", "relative")
  3814.         }), f = k.css({zIndex: Math.max(j.zIndex + 1, i == "auto" ? 0 : i)})), e.css({display: "block"}).fadeTo(j.loadSpeed, j.opacity, function () {
  3815.             a.mask.fit(), d(j.onLoad), g = "full"
  3816.         }), g = !0;
  3817.         return this
  3818.     }, close: function () {
  3819.         if (g) {
  3820.             if (d(h.onBeforeClose) === !1) {
  3821.                 return this;
  3822.             }
  3823.             e.fadeOut(h.closeSpeed, function () {
  3824.                 d(h.onClose), f && f.css({zIndex: i}), g = !1
  3825.             }), a(document).off("keydown.mask"), e.off("click.mask"), a(window).off("resize.mask")
  3826.         }
  3827.         return this
  3828.     }, fit: function () {
  3829.         if (g) {
  3830.             var a = c();
  3831.             e.css({width: a[0], height: a[1]})
  3832.         }
  3833.     }, getMask: function () {
  3834.         return e
  3835.     }, isLoaded: function (a) {
  3836.         return a ? g == "full" : g
  3837.     }, getConf: function () {
  3838.         return h
  3839.     }, getExposed: function () {
  3840.         return f
  3841.     }}, a.fn.mask = function (b) {
  3842.         a.mask.load(b);
  3843.         return this
  3844.     }, a.fn.expose = function (b) {
  3845.         a.mask.load(b, this);
  3846.         return this
  3847.     }
  3848. })(jQuery);
  3849.  
  3850. ;
  3851. (function ($) {
  3852.     $(document).on('click', '.OVERLAYBOX', function (e) {
  3853.         if (!$('#overlayBox').length) {
  3854.             $('body').append('<div id="overlayBox"><div class="head grad_grey"><span class="headline"></span><a class="close"><span><strong>X</strong></span></a></div><div class="error"></div><div class="contentWrap"></div></div>');
  3855.         }
  3856.         e.preventDefault();
  3857.         var OK = true;
  3858.         window.$overlay =
  3859.                 $(this).overlay({target: '#overlayBox', api: true, load: true, fixed: false, mask: {color: '#000', opacity: 0.6, loadSpeed: 0, closeSpeed: 0, }, onClose: function () {
  3860.                     $thisOverlay = this.getOverlay();
  3861.                     $thisOverlay.removeClass('smallOverlay bigOverlay');
  3862.                 }, onBeforeLoad: function () {
  3863.                     $thisOverlay = this.getOverlay();
  3864.                     var url = this.getTrigger().attr('href');
  3865.                     if (this.getTrigger().hasClass('SMALL')) {
  3866.                         $thisOverlay.addClass("smallOverlay");
  3867.                     }
  3868.                     if (this.getTrigger().hasClass('BIG')) {
  3869.                         $thisOverlay.addClass("bigOverlay");
  3870.                     }
  3871.                     if (this.getTrigger().hasClass('OPENNEWWINDOW')) {
  3872.                         $thisOverlay.find('.headline').after('<a class="opennewwindow" href="' + url
  3873.                                 + '" target="_blank"><span><strong>-></strong></span></a>');
  3874.                     }
  3875.                     var $container = $($thisOverlay.find(".contentWrap"));
  3876.                     $container.html("").addClass('indicator');
  3877.                     $thisOverlay.find('.headline').text(this.getTrigger().text());
  3878.                     var selector = url.match(/\#[^\?\#]+/i);
  3879.                     if (selector == null) {
  3880.                         selector = "#contentkernel";
  3881.                     }
  3882.                     else {
  3883.                         selector = selector[0];
  3884.                     }
  3885.                     $.log(selector);
  3886.                     var baseURL = "/";
  3887.                     var rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
  3888.                     $.ajax({url: url, type: 'GET', dataType: "html", cache: false, complete: function (jqXHR, status, responseText) {
  3889.                         if (status != "success") {
  3890.                             $.log('AJAX failed: ' + status);
  3891.                             $.getlocations(url);
  3892.                             return false;
  3893.                         }
  3894.                         responseText = jqXHR.responseText;
  3895.                         if (jqXHR.done()) {
  3896.                             jqXHR.done(function (r) {
  3897.                                 responseText = r;
  3898.                             });
  3899.                             responseText = responseText.replace(rscript, "");
  3900.                             window.$extract = $();
  3901.                             window.$response = $();
  3902.                             try {
  3903.                                 var xmlResponse = $.parseXML(responseText);
  3904.                                 $response = $(xmlResponse);
  3905.                             }
  3906.                             catch (e) {
  3907.                                 $.log('overlay:XML')
  3908.                                 $.log(e);
  3909.                             }
  3910.                             finally {
  3911.                                 ;
  3912.                             }
  3913.                             if (!$response.length) {
  3914.                                 $response = jQuery("<div>").append(responseText);
  3915.                             }
  3916.                             $extract = $(selector, $response);
  3917.                             if (!$extract.length) {
  3918.                                 $extract = $response;
  3919.                             }
  3920.                             $extract = $('<div id="' + selector.replace(/\#/i, '') + '" />').append($extract.html());
  3921.                             $extract.hide();
  3922.                             if (!$extract.children().length) {
  3923.                                 $response = jQuery("<div>").append(responseText);
  3924.                                 $extract = $(selector, $response);
  3925.                                 $extract = $('<div id="' + selector.replace(/\#/i, '') + '" />').append($extract.html());
  3926.                                 $extract.hide();
  3927.                             }
  3928.                             if (!$extract.children().length) {
  3929.                                 OK = false;
  3930.                             }
  3931.                             try {
  3932.                                 ___b24.tracking.page(url)
  3933.                                 $container.html('').removeClass('indicator').append($extract.show()).show();
  3934.                             }
  3935.                             catch (e) {
  3936.                                 OK = false;
  3937.                                 $.log('overlay:INPUT')
  3938.                                 $.log(e);
  3939.                             }
  3940.                             if (!OK) {
  3941.                                 $.getlocations(url);
  3942.                             }
  3943.                         }
  3944.                     }});
  3945.                 }});
  3946.     });
  3947.     $(document).on('click', '.IMAGE_OVERLAYBOX', function (e) {
  3948.         if (!$('#overlayBox').length) {
  3949.             $('body').append('<div id="overlayBox"><div class="head grad_grey"><span class="headline"></span><a class="close"><span><strong>X</strong></span></a></div><div class="error"></div><div class="contentWrap"></div></div>');
  3950.         }
  3951.         e.preventDefault();
  3952.         window.$overlay =
  3953.                 $(this).overlay({target: '#overlayBox', avpi: true, load: true, fixed: false, mask: {color: '#000', opacity: 0.6, loadSpeed: 0, closeSpeed: 0, }, onClose: function () {
  3954.                     $thisOverlay = this.getOverlay();
  3955.                     $thisOverlay.removeClass('IMAGE');
  3956.                 }, onBeforeLoad: function () {
  3957.                     $thisOverlay = this.getOverlay();
  3958.                     $thisOverlay.addClass("IMAGE");
  3959.                     var url = this.getTrigger().attr('href');
  3960.                     var $container = $($thisOverlay.find(".contentWrap"));
  3961.                     $container.html("").addClass('indicator');
  3962.                     $thisOverlay.find('.headline').text(this.getTrigger().find('img').attr('alt'));
  3963.                     $container.html('<div class="overlay_image"><img src="' + url + '" id="overlayImage" /></div>').removeClass('indicator');
  3964.                 }});
  3965.     });
  3966. })(jQuery);
  3967. ;
  3968.  
  3969. var Swiper = function (selector, params) {
  3970.     if (document.body.__defineGetter__) {
  3971.         if (HTMLElement) {
  3972.             var element = HTMLElement.prototype;
  3973.             if (element.__defineGetter__) {
  3974.                 element.__defineGetter__("outerHTML", function () {
  3975.                     return new XMLSerializer().serializeToString(this);
  3976.                 });
  3977.             }
  3978.         }
  3979.     }
  3980.     if (!window.getComputedStyle) {
  3981.         window.getComputedStyle = function (el, pseudo) {
  3982.             this.el = el;
  3983.             this.getPropertyValue = function (prop) {
  3984.                 var re = /(\-([a-z]){1})/g;
  3985.                 if (prop === 'float') {
  3986.                     prop = 'styleFloat';
  3987.                 }
  3988.                 if (re.test(prop)) {
  3989.                     prop = prop.replace(re, function () {
  3990.                         return arguments[2].toUpperCase();
  3991.                     });
  3992.                 }
  3993.                 return el.currentStyle[prop] ? el.currentStyle[prop] : null;
  3994.             }
  3995.             return this;
  3996.         }
  3997.     }
  3998.     if (!Array.prototype.indexOf) {
  3999.         Array.prototype.indexOf = function (obj, start) {
  4000.             for (var i = (start || 0), j = this.length; i < j; i++) {
  4001.                 if (this[i] === obj) {
  4002.                     return i;
  4003.                 }
  4004.             }
  4005.             return-1;
  4006.         }
  4007.     }
  4008.     if (!document.querySelectorAll) {
  4009.         if (!window.jQuery) {
  4010.             return;
  4011.         }
  4012.     }
  4013.     function $$(selector, context) {
  4014.         if (document.querySelectorAll) {
  4015.             return(context || document).querySelectorAll(selector);
  4016.         }
  4017.         else {
  4018.             return jQuery(selector, context);
  4019.         }
  4020.     }
  4021.  
  4022.     if (typeof selector === 'undefined') {
  4023.         return;
  4024.     }
  4025.     if (!(selector.nodeType)) {
  4026.         if ($$(selector).length === 0) {
  4027.             return;
  4028.         }
  4029.     }
  4030.     var _this = this;
  4031.     _this.touches = {start: 0, startX: 0, startY: 0, current: 0, currentX: 0, currentY: 0, diff: 0, abs: 0};
  4032.     _this.positions = {start: 0, abs: 0, diff: 0, current: 0};
  4033.     _this.times = {start: 0, end: 0};
  4034.     _this.id = (new Date()).getTime();
  4035.     _this.container = (selector.nodeType) ? selector : $$(selector)[0];
  4036.     _this.isTouched = false;
  4037.     _this.isMoved = false;
  4038.     _this.activeIndex = 0;
  4039.     _this.activeLoaderIndex = 0;
  4040.     _this.activeLoopIndex = 0;
  4041.     _this.previousIndex = null;
  4042.     _this.velocity = 0;
  4043.     _this.snapGrid = [];
  4044.     _this.slidesGrid = [];
  4045.     _this.imagesToLoad = [];
  4046.     _this.imagesLoaded = 0;
  4047.     _this.wrapperLeft = 0;
  4048.     _this.wrapperRight = 0;
  4049.     _this.wrapperTop = 0;
  4050.     _this.wrapperBottom = 0;
  4051.     var wrapper, slideSize, wrapperSize, direction, isScrolling, containerSize;
  4052.     var defaults = {mode: 'horizontal', touchRatio: 1, speed: 300, freeMode: false, freeModeFluid: false, momentumRatio: 1, momentumBounce: true, momentumBounceRatio: 1, slidesPerView: 1, slidesPerGroup: 1, simulateTouch: true, followFinger: true, shortSwipes: true, moveStartThreshold: false, autoplay: false, onlyExternal: false, createPagination: true, pagination: false, paginationElement: 'span', paginationClickable: false, paginationAsRange: true, resistance: true, scrollContainer: false, preventLinks: true, noSwiping: false, noSwipingClass: 'swiper-no-swiping', initialSlide: 0, keyboardControl: false, mousewheelControl: false, mousewheelDebounce: 600, useCSS3Transforms: true, loop: false, loopAdditionalSlides: 0, calculateHeight: false, updateOnImagesReady: true, releaseFormElements: true, watchActiveIndex: false, visibilityFullFit: false, offsetPxBefore: 0, offsetPxAfter: 0, offsetSlidesBefore: 0, offsetSlidesAfter: 0, centeredSlides: false, queueStartCallbacks: false, queueEndCallbacks: false, autoResize: true, resizeReInit: false, DOMAnimation: true, loader: {slides: [], slidesHTMLType: 'inner', surroundGroups: 1, logic: 'reload', loadAllSlides: false}, slideElement: 'div', slideClass: 'swiper-slide', slideActiveClass: 'swiper-slide-active', slideVisibleClass: 'swiper-slide-visible', wrapperClass: 'swiper-wrapper', paginationElementClass: 'swiper-pagination-switch', paginationActiveClass: 'swiper-active-switch', paginationVisibleClass: 'swiper-visible-switch'}
  4053.     params = params || {};
  4054.     for (var prop in defaults) {
  4055.         if (prop in params && typeof params[prop] === 'object') {
  4056.             for (var subProp in defaults[prop]) {
  4057.                 if (!(subProp in params[prop])) {
  4058.                     params[prop][subProp] = defaults[prop][subProp];
  4059.                 }
  4060.             }
  4061.         }
  4062.         else if (!(prop in params)) {
  4063.             params[prop] = defaults[prop]
  4064.         }
  4065.     }
  4066.     _this.params = params;
  4067.     if (params.scrollContainer) {
  4068.         params.freeMode = true;
  4069.         params.freeModeFluid = true;
  4070.     }
  4071.     if (params.loop) {
  4072.         params.resistance = '100%';
  4073.     }
  4074.     var isH = params.mode === 'horizontal';
  4075.     _this.touchEvents =
  4076.     {touchStart: _this.support.touch || !params.simulateTouch ? 'touchstart' :
  4077.             (_this.browser.ie10 ? 'MSPointerDown' : 'mousedown'), touchMove: _this.support.touch || !params.simulateTouch ? 'touchmove' :
  4078.             (_this.browser.ie10 ? 'MSPointerMove' : 'mousemove'), touchEnd: _this.support.touch || !params.simulateTouch ? 'touchend' :
  4079.             (_this.browser.ie10 ? 'MSPointerUp' : 'mouseup')};
  4080.     for (var i = _this.container.childNodes.length - 1; i >= 0; i--) {
  4081.         if (_this.container.childNodes[i].className) {
  4082.             var _wrapperClasses = _this.container.childNodes[i].className.split(' ')
  4083.             for (var j = 0; j < _wrapperClasses.length; j++) {
  4084.                 if (_wrapperClasses[j] === params.wrapperClass) {
  4085.                     wrapper = _this.container.childNodes[i];
  4086.                 }
  4087.             }
  4088.             ;
  4089.         }
  4090.     }
  4091.     ;
  4092.     _this.wrapper = wrapper;
  4093.     _this._extendSwiperSlide = function (el) {
  4094.         el.append = function () {
  4095.             if (params.loop) {
  4096.                 el.insertAfter(_this.slides.length - _this.loopedSlides);
  4097.                 _this.removeLoopedSlides();
  4098.                 _this.calcSlides();
  4099.                 _this.createLoop();
  4100.             }
  4101.             else {
  4102.                 _this.wrapper.appendChild(el);
  4103.             }
  4104.             _this.reInit();
  4105.             return el;
  4106.         }
  4107.         el.prepend = function () {
  4108.             if (params.loop) {
  4109.                 _this.wrapper.insertBefore(el, _this.slides[_this.loopedSlides]);
  4110.                 _this.removeLoopedSlides();
  4111.                 _this.calcSlides();
  4112.                 _this.createLoop();
  4113.             }
  4114.             else {
  4115.                 _this.wrapper.insertBefore(el, _this.wrapper.firstChild);
  4116.             }
  4117.             _this.reInit();
  4118.             return el;
  4119.         }
  4120.         el.insertAfter = function (index) {
  4121.             if (typeof index === 'undefined') {
  4122.                 return false;
  4123.             }
  4124.             var beforeSlide;
  4125.             if (params.loop) {
  4126.                 beforeSlide = _this.slides[index + 1 + _this.loopedSlides];
  4127.                 _this.wrapper.insertBefore(el, beforeSlide);
  4128.                 _this.removeLoopedSlides();
  4129.                 _this.calcSlides();
  4130.                 _this.createLoop();
  4131.             }
  4132.             else {
  4133.                 beforeSlide = _this.slides[index + 1];
  4134.                 _this.wrapper.insertBefore(el, beforeSlide)
  4135.             }
  4136.             _this.reInit();
  4137.             return el;
  4138.         }
  4139.         el.clone = function () {
  4140.             return _this._extendSwiperSlide(el.cloneNode(true))
  4141.         }
  4142.         el.remove = function () {
  4143.             _this.wrapper.removeChild(el);
  4144.             _this.reInit();
  4145.         }
  4146.         el.html = function (html) {
  4147.             if (typeof html === 'undefined') {
  4148.                 return el.innerHTML;
  4149.             }
  4150.             else {
  4151.                 el.innerHTML = html;
  4152.                 return el;
  4153.             }
  4154.         }
  4155.         el.index = function () {
  4156.             var index;
  4157.             for (var i = _this.slides.length - 1; i >= 0; i--) {
  4158.                 if (el === _this.slides[i]) {
  4159.                     index = i;
  4160.                 }
  4161.             }
  4162.             return index;
  4163.         }
  4164.         el.isActive = function () {
  4165.             if (el.index() === _this.activeIndex) {
  4166.                 return true;
  4167.             }
  4168.             else {
  4169.                 return false;
  4170.             }
  4171.         }
  4172.         if (!el.swiperSlideDataStorage) {
  4173.             el.swiperSlideDataStorage = {};
  4174.         }
  4175.         el.getData = function (name) {
  4176.             return el.swiperSlideDataStorage[name];
  4177.         }
  4178.         el.setData = function (name, value) {
  4179.             el.swiperSlideDataStorage[name] = value;
  4180.             return el;
  4181.         }
  4182.         el.data = function (name, value) {
  4183.             if (!value) {
  4184.                 return el.getAttribute('data-' + name);
  4185.             }
  4186.             else {
  4187.                 el.setAttribute('data-' + name, value);
  4188.                 return el;
  4189.             }
  4190.         }
  4191.         el.getWidth = function (outer) {
  4192.             return _this.h.getWidth(el, outer);
  4193.         }
  4194.         el.getHeight = function (outer) {
  4195.             return _this.h.getHeight(el, outer);
  4196.         }
  4197.         el.getOffset = function () {
  4198.             return _this.h.getOffset(el);
  4199.         }
  4200.         return el;
  4201.     }
  4202.     _this.calcSlides = function (forceCalcSlides) {
  4203.         var oldNumber = _this.slides ? _this.slides.length : false;
  4204.         _this.slides = [];
  4205.         _this.displaySlides = [];
  4206.         for (var i = 0; i < _this.wrapper.childNodes.length; i++) {
  4207.             if (_this.wrapper.childNodes[i].className) {
  4208.                 var _className = _this.wrapper.childNodes[i].className;
  4209.                 var _slideClasses = _className.split(' ');
  4210.                 for (var j = 0; j < _slideClasses.length; j++) {
  4211.                     if (_slideClasses[j] === params.slideClass) {
  4212.                         _this.slides.push(_this.wrapper.childNodes[i]);
  4213.                     }
  4214.                 }
  4215.             }
  4216.         }
  4217.         for (i = _this.slides.length - 1; i >= 0; i--) {
  4218.             _this._extendSwiperSlide(_this.slides[i]);
  4219.         }
  4220.         if (!oldNumber) {
  4221.             return;
  4222.         }
  4223.         if (oldNumber !== _this.slides.length || forceCalcSlides) {
  4224.             removeSlideEvents();
  4225.             addSlideEvents();
  4226.             _this.updateActiveSlide();
  4227.             if (params.createPagination && _this.params.pagination) {
  4228.                 _this.createPagination();
  4229.             }
  4230.             _this.callPlugins('numberOfSlidesChanged');
  4231.         }
  4232.     }
  4233.     _this.createSlide = function (html, slideClassList, el) {
  4234.         var slideClassList = slideClassList || _this.params.slideClass;
  4235.         var el = el || params.slideElement;
  4236.         var newSlide = document.createElement(el);
  4237.         newSlide.innerHTML = html || '';
  4238.         newSlide.className = slideClassList;
  4239.         return _this._extendSwiperSlide(newSlide);
  4240.     }
  4241.     _this.appendSlide = function (html, slideClassList, el) {
  4242.         if (!html) {
  4243.             return;
  4244.         }
  4245.         if (html.nodeType) {
  4246.             return _this._extendSwiperSlide(html).append()
  4247.         }
  4248.         else {
  4249.             return _this.createSlide(html, slideClassList, el).append()
  4250.         }
  4251.     }
  4252.     _this.prependSlide = function (html, slideClassList, el) {
  4253.         if (!html) {
  4254.             return;
  4255.         }
  4256.         if (html.nodeType) {
  4257.             return _this._extendSwiperSlide(html).prepend()
  4258.         }
  4259.         else {
  4260.             return _this.createSlide(html, slideClassList, el).prepend()
  4261.         }
  4262.     }
  4263.     _this.insertSlideAfter = function (index, html, slideClassList, el) {
  4264.         if (typeof index === 'undefined') {
  4265.             return false;
  4266.         }
  4267.         if (html.nodeType) {
  4268.             return _this._extendSwiperSlide(html).insertAfter(index);
  4269.         }
  4270.         else {
  4271.             return _this.createSlide(html, slideClassList, el).insertAfter(index);
  4272.         }
  4273.     }
  4274.     _this.removeSlide = function (index) {
  4275.         if (_this.slides[index]) {
  4276.             if (params.loop) {
  4277.                 if (!_this.slides[index + _this.loopedSlides]) {
  4278.                     return false;
  4279.                 }
  4280.                 _this.slides[index + _this.loopedSlides].remove();
  4281.                 _this.removeLoopedSlides();
  4282.                 _this.calcSlides();
  4283.                 _this.createLoop();
  4284.             }
  4285.             else {
  4286.                 _this.slides[index].remove();
  4287.             }
  4288.             return true;
  4289.         }
  4290.         else {
  4291.             return false;
  4292.         }
  4293.     }
  4294.     _this.removeLastSlide = function () {
  4295.         if (_this.slides.length > 0) {
  4296.             if (params.loop) {
  4297.                 _this.slides[_this.slides.length - 1 - _this.loopedSlides].remove();
  4298.                 _this.removeLoopedSlides();
  4299.                 _this.calcSlides();
  4300.                 _this.createLoop();
  4301.             }
  4302.             else {
  4303.                 _this.slides[(_this.slides.length - 1)].remove();
  4304.             }
  4305.             return true;
  4306.         }
  4307.         else {
  4308.             return false;
  4309.         }
  4310.     }
  4311.     _this.removeAllSlides = function () {
  4312.         for (var i = _this.slides.length - 1; i >= 0; i--) {
  4313.             _this.slides[i].remove()
  4314.         }
  4315.     }
  4316.     _this.getSlide = function (index) {
  4317.         return _this.slides[index]
  4318.     }
  4319.     _this.getLastSlide = function () {
  4320.         return _this.slides[_this.slides.length - 1]
  4321.     }
  4322.     _this.getFirstSlide = function () {
  4323.         return _this.slides[0]
  4324.     }
  4325.     _this.activeSlide = function () {
  4326.         return _this.slides[_this.activeIndex]
  4327.     }
  4328.     var _plugins = [];
  4329.     for (var plugin in _this.plugins) {
  4330.         if (params[plugin]) {
  4331.             var p = _this.plugins[plugin](_this, params[plugin]);
  4332.             if (p) {
  4333.                 _plugins.push(p);
  4334.             }
  4335.         }
  4336.     }
  4337.     _this.callPlugins = function (method, args) {
  4338.         if (!args) {
  4339.             args = {}
  4340.         }
  4341.         for (var i = 0; i < _plugins.length; i++) {
  4342.             if (method in _plugins[i]) {
  4343.                 _plugins[i][method](args);
  4344.             }
  4345.         }
  4346.     }
  4347.     if (_this.browser.ie10 && !params.onlyExternal) {
  4348.         _this.wrapper.classList.add('swiper-wp8-' + (isH ? 'horizontal' : 'vertical'));
  4349.     }
  4350.     if (params.freeMode) {
  4351.         _this.container.className += ' swiper-free-mode';
  4352.     }
  4353.     _this.initialized = false;
  4354.     _this.init = function (force, forceCalcSlides) {
  4355.         var _width = _this.h.getWidth(_this.container);
  4356.         var _height = _this.h.getHeight(_this.container);
  4357.         if (_width === _this.width && _height === _this.height && !force) {
  4358.             return;
  4359.         }
  4360.         _this.width = _width;
  4361.         _this.height = _height;
  4362.         containerSize = isH ? _width : _height;
  4363.         var wrapper = _this.wrapper;
  4364.         if (force) {
  4365.             _this.calcSlides(forceCalcSlides);
  4366.         }
  4367.         if (params.slidesPerView === 'auto') {
  4368.             var slidesWidth = 0;
  4369.             var slidesHeight = 0;
  4370.             if (params.slidesOffset > 0) {
  4371.                 wrapper.style.paddingLeft = '';
  4372.                 wrapper.style.paddingRight = '';
  4373.                 wrapper.style.paddingTop = '';
  4374.                 wrapper.style.paddingBottom = '';
  4375.             }
  4376.             wrapper.style.width = '';
  4377.             wrapper.style.height = '';
  4378.             if (params.offsetPxBefore > 0) {
  4379.                 if (isH) {
  4380.                     _this.wrapperLeft = params.offsetPxBefore;
  4381.                 }
  4382.                 else {
  4383.                     _this.wrapperTop = params.offsetPxBefore;
  4384.                 }
  4385.             }
  4386.             if (params.offsetPxAfter > 0) {
  4387.                 if (isH) {
  4388.                     _this.wrapperRight = params.offsetPxAfter;
  4389.                 }
  4390.                 else {
  4391.                     _this.wrapperBottom = params.offsetPxAfter;
  4392.                 }
  4393.             }
  4394.             if (params.centeredSlides) {
  4395.                 if (isH) {
  4396.                     _this.wrapperLeft = (containerSize - this.slides[0].getWidth(true)) / 2;
  4397.                     _this.wrapperRight = (containerSize - _this.slides[_this.slides.length - 1].getWidth(true)) / 2;
  4398.                 }
  4399.                 else {
  4400.                     _this.wrapperTop = (containerSize - _this.slides[0].getHeight(true)) / 2;
  4401.                     _this.wrapperBottom = (containerSize - _this.slides[_this.slides.length - 1].getHeight(true)) / 2;
  4402.                 }
  4403.             }
  4404.             if (isH) {
  4405.                 if (_this.wrapperLeft >= 0) {
  4406.                     wrapper.style.paddingLeft = _this.wrapperLeft + 'px';
  4407.                 }
  4408.                 if (_this.wrapperRight >= 0) {
  4409.                     wrapper.style.paddingRight = _this.wrapperRight + 'px';
  4410.                 }
  4411.             }
  4412.             else {
  4413.                 if (_this.wrapperTop >= 0) {
  4414.                     wrapper.style.paddingTop = _this.wrapperTop + 'px';
  4415.                 }
  4416.                 if (_this.wrapperBottom >= 0) {
  4417.                     wrapper.style.paddingBottom = _this.wrapperBottom + 'px';
  4418.                 }
  4419.             }
  4420.             var slideLeft = 0;
  4421.             var centeredSlideLeft = 0;
  4422.             _this.snapGrid = [];
  4423.             _this.slidesGrid = [];
  4424.             var slideMaxHeight = 0;
  4425.             for (var i = 0; i < _this.slides.length; i++) {
  4426.                 var slideWidth = _this.slides[i].getWidth(true);
  4427.                 var slideHeight = _this.slides[i].getHeight(true);
  4428.                 if (params.calculateHeight) {
  4429.                     slideMaxHeight = Math.max(slideMaxHeight, slideHeight)
  4430.                 }
  4431.                 var _slideSize = isH ? slideWidth : slideHeight;
  4432.                 if (params.centeredSlides) {
  4433.                     var nextSlideWidth = i === _this.slides.length - 1 ? 0 : _this.slides[i + 1].getWidth(true);
  4434.                     var nextSlideHeight = i === _this.slides.length - 1 ? 0 : _this.slides[i + 1].getHeight(true);
  4435.                     var nextSlideSize = isH ? nextSlideWidth : nextSlideHeight;
  4436.                     if (_slideSize > containerSize) {
  4437.                         for (var j = 0; j <= Math.floor(_slideSize / (containerSize + _this.wrapperLeft)); j++) {
  4438.                             if (j === 0) {
  4439.                                 _this.snapGrid.push(slideLeft + _this.wrapperLeft);
  4440.                             }
  4441.                             else {
  4442.                                 _this.snapGrid.push(slideLeft + _this.wrapperLeft + containerSize * j);
  4443.                             }
  4444.                         }
  4445.                         _this.slidesGrid.push(slideLeft + _this.wrapperLeft);
  4446.                     }
  4447.                     else {
  4448.                         _this.snapGrid.push(centeredSlideLeft);
  4449.                         _this.slidesGrid.push(centeredSlideLeft);
  4450.                     }
  4451.                     centeredSlideLeft += _slideSize / 2 + nextSlideSize / 2;
  4452.                 }
  4453.                 else {
  4454.                     if (_slideSize > containerSize) {
  4455.                         for (var j = 0; j <= Math.floor(_slideSize / containerSize); j++) {
  4456.                             _this.snapGrid.push(slideLeft + containerSize * j);
  4457.                         }
  4458.                     }
  4459.                     else {
  4460.                         _this.snapGrid.push(slideLeft);
  4461.                     }
  4462.                     _this.slidesGrid.push(slideLeft);
  4463.                 }
  4464.                 slideLeft += _slideSize;
  4465.                 slidesWidth += slideWidth;
  4466.                 slidesHeight += slideHeight;
  4467.             }
  4468.             if (params.calculateHeight) {
  4469.                 _this.height = slideMaxHeight;
  4470.             }
  4471.             if (isH) {
  4472.                 wrapperSize = slidesWidth + _this.wrapperRight + _this.wrapperLeft;
  4473.                 wrapper.style.width = (slidesWidth) + 'px';
  4474.                 wrapper.style.height = (_this.height) + 'px';
  4475.             }
  4476.             else {
  4477.                 wrapperSize = slidesHeight + _this.wrapperTop + _this.wrapperBottom;
  4478.                 wrapper.style.width = (_this.width) + 'px';
  4479.                 wrapper.style.height = (slidesHeight) + 'px';
  4480.             }
  4481.         }
  4482.         else if (params.scrollContainer) {
  4483.             wrapper.style.width = '';
  4484.             wrapper.style.height = '';
  4485.             var wrapperWidth = _this.slides[0].getWidth(true);
  4486.             var wrapperHeight = _this.slides[0].getHeight(true);
  4487.             wrapperSize = isH ? wrapperWidth : wrapperHeight;
  4488.             wrapper.style.width = wrapperWidth + 'px';
  4489.             wrapper.style.height = wrapperHeight + 'px';
  4490.             slideSize = isH ? wrapperWidth : wrapperHeight;
  4491.         }
  4492.         else {
  4493.             if (params.calculateHeight) {
  4494.                 var slideMaxHeight = 0;
  4495.                 var wrapperHeight = 0;
  4496.                 if (!isH) {
  4497.                     _this.container.style.height = '';
  4498.                 }
  4499.                 wrapper.style.height = '';
  4500.                 for (var i = 0; i < _this.slides.length; i++) {
  4501.                     _this.slides[i].style.height = '';
  4502.                     slideMaxHeight = Math.max(_this.slides[i].getHeight(true), slideMaxHeight);
  4503.                     if (!isH) {
  4504.                         wrapperHeight += _this.slides[i].getHeight(true);
  4505.                     }
  4506.                 }
  4507.                 var slideHeight = slideMaxHeight;
  4508.                 _this.height = slideHeight;
  4509.                 if (isH) {
  4510.                     wrapperHeight = slideHeight;
  4511.                 }
  4512.                 else {
  4513.                     containerSize = slideHeight, _this.container.style.height = containerSize + 'px';
  4514.                 }
  4515.             }
  4516.             else {
  4517.                 var slideHeight = isH ? _this.height : _this.height / params.slidesPerView;
  4518.                 var wrapperHeight = isH ? _this.height : _this.slides.length * slideHeight;
  4519.             }
  4520.             var slideWidth = isH ? _this.width / params.slidesPerView : _this.width;
  4521.             var wrapperWidth = isH ? _this.slides.length * slideWidth : _this.width;
  4522.             slideSize = isH ? slideWidth : slideHeight;
  4523.             if (params.offsetSlidesBefore > 0) {
  4524.                 if (isH) {
  4525.                     _this.wrapperLeft = slideSize * params.offsetSlidesBefore;
  4526.                 }
  4527.                 else {
  4528.                     _this.wrapperTop = slideSize * params.offsetSlidesBefore;
  4529.                 }
  4530.             }
  4531.             if (params.offsetSlidesAfter > 0) {
  4532.                 if (isH) {
  4533.                     _this.wrapperRight = slideSize * params.offsetSlidesAfter;
  4534.                 }
  4535.                 else {
  4536.                     _this.wrapperBottom = slideSize * params.offsetSlidesAfter;
  4537.                 }
  4538.             }
  4539.             if (params.offsetPxBefore > 0) {
  4540.                 if (isH) {
  4541.                     _this.wrapperLeft = params.offsetPxBefore;
  4542.                 }
  4543.                 else {
  4544.                     _this.wrapperTop = params.offsetPxBefore;
  4545.                 }
  4546.             }
  4547.             if (params.offsetPxAfter > 0) {
  4548.                 if (isH) {
  4549.                     _this.wrapperRight = params.offsetPxAfter;
  4550.                 }
  4551.                 else {
  4552.                     _this.wrapperBottom = params.offsetPxAfter;
  4553.                 }
  4554.             }
  4555.             if (params.centeredSlides) {
  4556.                 if (isH) {
  4557.                     _this.wrapperLeft = (containerSize - slideSize) / 2;
  4558.                     _this.wrapperRight = (containerSize - slideSize) / 2;
  4559.                 }
  4560.                 else {
  4561.                     _this.wrapperTop = (containerSize - slideSize) / 2;
  4562.                     _this.wrapperBottom = (containerSize - slideSize) / 2;
  4563.                 }
  4564.             }
  4565.             if (isH) {
  4566.                 if (_this.wrapperLeft > 0) {
  4567.                     wrapper.style.paddingLeft = _this.wrapperLeft + 'px';
  4568.                 }
  4569.                 if (_this.wrapperRight > 0) {
  4570.                     wrapper.style.paddingRight = _this.wrapperRight + 'px';
  4571.                 }
  4572.             }
  4573.             else {
  4574.                 if (_this.wrapperTop > 0) {
  4575.                     wrapper.style.paddingTop = _this.wrapperTop + 'px';
  4576.                 }
  4577.                 if (_this.wrapperBottom > 0) {
  4578.                     wrapper.style.paddingBottom = _this.wrapperBottom + 'px';
  4579.                 }
  4580.             }
  4581.             wrapperSize = isH ? wrapperWidth + _this.wrapperRight + _this.wrapperLeft : wrapperHeight + _this.wrapperTop + _this.wrapperBottom;
  4582.             wrapper.style.width = wrapperWidth + 'px';
  4583.             wrapper.style.height = wrapperHeight + 'px';
  4584.             var slideLeft = 0;
  4585.             _this.snapGrid = [];
  4586.             _this.slidesGrid = [];
  4587.             for (var i = 0; i < _this.slides.length; i++) {
  4588.                 _this.snapGrid.push(slideLeft);
  4589.                 _this.slidesGrid.push(slideLeft);
  4590.                 slideLeft += slideSize;
  4591.                 _this.slides[i].style.width = slideWidth + 'px';
  4592.                 _this.slides[i].style.height = slideHeight + 'px';
  4593.             }
  4594.         }
  4595.         if (!_this.initialized) {
  4596.             _this.callPlugins('onFirstInit');
  4597.             if (params.onFirstInit) {
  4598.                 params.onFirstInit(_this);
  4599.             }
  4600.         }
  4601.         else {
  4602.             _this.callPlugins('onInit');
  4603.             if (params.onInit) {
  4604.                 params.onInit(_this);
  4605.             }
  4606.         }
  4607.         _this.initialized = true;
  4608.     }
  4609.     _this.reInit = function (forceCalcSlides) {
  4610.         _this.init(true, forceCalcSlides);
  4611.     }
  4612.     _this.resizeFix = function (reInit) {
  4613.         _this.callPlugins('beforeResizeFix');
  4614.         _this.init(params.resizeReInit || reInit);
  4615.         if (!params.freeMode) {
  4616.             _this.swipeTo((params.loop ? _this.activeLoopIndex : _this.activeIndex), 0, false);
  4617.         }
  4618.         else if (_this.getWrapperTranslate() < -maxWrapperPosition()) {
  4619.             _this.setWrapperTransition(0);
  4620.             _this.setWrapperTranslate(-maxWrapperPosition());
  4621.         }
  4622.         _this.callPlugins('afterResizeFix');
  4623.     }
  4624.     function maxWrapperPosition() {
  4625.         var a = (wrapperSize - containerSize);
  4626.         if (params.freeMode) {
  4627.             a = wrapperSize - containerSize;
  4628.         }
  4629.         if (params.slidesPerView > _this.slides.length) {
  4630.             a = 0;
  4631.         }
  4632.         if (a < 0) {
  4633.             a = 0;
  4634.         }
  4635.         return a;
  4636.     }
  4637.  
  4638.     function minWrapperPosition() {
  4639.         var a = 0;
  4640.         return a;
  4641.     }
  4642.  
  4643.     function initEvents() {
  4644.         var bind = _this.h.addEventListener;
  4645.         if (!_this.browser.ie10) {
  4646.             if (_this.support.touch) {
  4647.                 bind(_this.wrapper, 'touchstart', onTouchStart);
  4648.                 bind(_this.wrapper, 'touchmove', onTouchMove);
  4649.                 bind(_this.wrapper, 'touchend', onTouchEnd);
  4650.             }
  4651.             if (params.simulateTouch) {
  4652.                 bind(_this.wrapper, 'mousedown', onTouchStart);
  4653.                 bind(document, 'mousemove', onTouchMove);
  4654.                 bind(document, 'mouseup', onTouchEnd);
  4655.             }
  4656.         }
  4657.         else {
  4658.             bind(_this.wrapper, _this.touchEvents.touchStart, onTouchStart);
  4659.             bind(document, _this.touchEvents.touchMove, onTouchMove);
  4660.             bind(document, _this.touchEvents.touchEnd, onTouchEnd);
  4661.         }
  4662.         if (params.autoResize) {
  4663.             bind(window, 'resize', _this.resizeFix);
  4664.         }
  4665.         addSlideEvents();
  4666.         _this._wheelEvent = false;
  4667.         if (params.mousewheelControl) {
  4668.             if (document.onmousewheel !== undefined) {
  4669.                 _this._wheelEvent = "mousewheel";
  4670.             }
  4671.             try {
  4672.                 WheelEvent("wheel");
  4673.                 _this._wheelEvent = "wheel";
  4674.             }
  4675.             catch (e) {
  4676.             }
  4677.             if (!_this._wheelEvent) {
  4678.                 _this._wheelEvent = "DOMMouseScroll";
  4679.             }
  4680.             if (_this._wheelEvent) {
  4681.                 bind(_this.container, _this._wheelEvent, handleMousewheel);
  4682.             }
  4683.         }
  4684.         if (params.keyboardControl) {
  4685.             bind(document, 'keydown', handleKeyboardKeys);
  4686.         }
  4687.         if (params.updateOnImagesReady) {
  4688.             _this.imagesToLoad = $$('img', _this.container);
  4689.             for (var i = 0; i < _this.imagesToLoad.length; i++) {
  4690.                 _loadImage(_this.imagesToLoad[i].getAttribute('src'))
  4691.             }
  4692.         }
  4693.         function _loadImage(src) {
  4694.             var image = new Image();
  4695.             image.onload = function () {
  4696.                 _this.imagesLoaded++;
  4697.                 if (_this.imagesLoaded == _this.imagesToLoad.length) {
  4698.                     _this.reInit();
  4699.                     if (params.onImagesReady) {
  4700.                         params.onImagesReady(_this);
  4701.                     }
  4702.                 }
  4703.             }
  4704.             image.src = src;
  4705.         }
  4706.     }
  4707.  
  4708.     _this.destroy = function (removeResizeFix) {
  4709.         var unbind = _this.h.removeEventListener;
  4710.         if (!_this.browser.ie10) {
  4711.             if (_this.support.touch) {
  4712.                 unbind(_this.wrapper, 'touchstart', onTouchStart);
  4713.                 unbind(_this.wrapper, 'touchmove', onTouchMove);
  4714.                 unbind(_this.wrapper, 'touchend', onTouchEnd);
  4715.             }
  4716.             if (params.simulateTouch) {
  4717.                 unbind(_this.wrapper, 'mousedown', onTouchStart);
  4718.                 unbind(document, 'mousemove', onTouchMove);
  4719.                 unbind(document, 'mouseup', onTouchEnd);
  4720.             }
  4721.         }
  4722.         else {
  4723.             unbind(_this.wrapper, _this.touchEvents.touchStart, onTouchStart);
  4724.             unbind(document, _this.touchEvents.touchMove, onTouchMove);
  4725.             unbind(document, _this.touchEvents.touchEnd, onTouchEnd);
  4726.         }
  4727.         if (params.autoResize) {
  4728.             unbind(window, 'resize', _this.resizeFix);
  4729.         }
  4730.         removeSlideEvents();
  4731.         if (params.paginationClickable) {
  4732.             removePaginationEvents();
  4733.         }
  4734.         if (params.mousewheelControl && _this._wheelEvent) {
  4735.             unbind(_this.container, _this._wheelEvent, handleMousewheel);
  4736.         }
  4737.         if (params.keyboardControl) {
  4738.             unbind(document, 'keydown', handleKeyboardKeys);
  4739.         }
  4740.         if (params.autoplay) {
  4741.             _this.stopAutoplay();
  4742.         }
  4743.         _this.callPlugins('onDestroy');
  4744.         _this = null;
  4745.     }
  4746.     function addSlideEvents() {
  4747.         var bind = _this.h.addEventListener, i;
  4748.         if (params.preventLinks) {
  4749.             var links = $$('a', _this.container);
  4750.             for (i = 0; i < links.length; i++) {
  4751.                 bind(links[i], 'click', preventClick);
  4752.             }
  4753.         }
  4754.         if (params.releaseFormElements) {
  4755.             var formElements = $$('input, textarea, select', _this.container);
  4756.             for (i = 0; i < formElements.length; i++) {
  4757.                 bind(formElements[i], _this.touchEvents.touchStart, releaseForms, true);
  4758.             }
  4759.         }
  4760.         if (params.onSlideClick) {
  4761.             for (i = 0; i < _this.slides.length; i++) {
  4762.                 bind(_this.slides[i], 'click', slideClick);
  4763.             }
  4764.         }
  4765.         if (params.onSlideTouch) {
  4766.             for (i = 0; i < _this.slides.length; i++) {
  4767.                 bind(_this.slides[i], _this.touchEvents.touchStart, slideTouch);
  4768.             }
  4769.         }
  4770.     }
  4771.  
  4772.     function removeSlideEvents() {
  4773.         var unbind = _this.h.removeEventListener, i;
  4774.         if (params.onSlideClick) {
  4775.             for (i = 0; i < _this.slides.length; i++) {
  4776.                 unbind(_this.slides[i], 'click', slideClick);
  4777.             }
  4778.         }
  4779.         if (params.onSlideTouch) {
  4780.             for (i = 0; i < _this.slides.length; i++) {
  4781.                 unbind(_this.slides[i], _this.touchEvents.touchStart, slideTouch);
  4782.             }
  4783.         }
  4784.         if (params.releaseFormElements) {
  4785.             var formElements = $$('input, textarea, select', _this.container);
  4786.             for (i = 0; i < formElements.length; i++) {
  4787.                 unbind(formElements[i], _this.touchEvents.touchStart, releaseForms, true);
  4788.             }
  4789.         }
  4790.         if (params.preventLinks) {
  4791.             var links = $$('a', _this.container);
  4792.             for (i = 0; i < links.length; i++) {
  4793.                 unbind(links[i], 'click', preventClick);
  4794.             }
  4795.         }
  4796.     }
  4797.  
  4798.     function handleKeyboardKeys(e) {
  4799.         var kc = e.keyCode || e.charCode;
  4800.         if (kc == 37 || kc == 39 || kc == 38 || kc == 40) {
  4801.             var inView = false;
  4802.             var swiperOffset = _this.h.getOffset(_this.container);
  4803.             var scrollLeft = _this.h.windowScroll().left;
  4804.             var scrollTop = _this.h.windowScroll().top;
  4805.             var windowWidth = _this.h.windowWidth();
  4806.             var windowHeight = _this.h.windowHeight();
  4807.             var swiperCoord = [
  4808.                 [swiperOffset.left, swiperOffset.top],
  4809.                 [swiperOffset.left + _this.width, swiperOffset.top],
  4810.                 [swiperOffset.left, swiperOffset.top + _this.height],
  4811.                 [swiperOffset.left + _this.width, swiperOffset.top + _this.height]
  4812.             ]
  4813.             for (var i = 0; i < swiperCoord.length; i++) {
  4814.                 var point = swiperCoord[i];
  4815.                 if (point[0] >= scrollLeft && point[0] <= scrollLeft + windowWidth && point[1] >= scrollTop && point[1] <= scrollTop + windowHeight) {
  4816.                     inView = true;
  4817.                 }
  4818.             }
  4819.             if (!inView) {
  4820.                 return;
  4821.             }
  4822.         }
  4823.         if (isH) {
  4824.             if (kc == 37 || kc == 39) {
  4825.                 if (e.preventDefault) {
  4826.                     e.preventDefault();
  4827.                 }
  4828.                 else {
  4829.                     e.returnValue = false;
  4830.                 }
  4831.             }
  4832.             if (kc == 39) {
  4833.                 _this.swipeNext();
  4834.             }
  4835.             if (kc == 37) {
  4836.                 _this.swipePrev();
  4837.             }
  4838.         }
  4839.         else {
  4840.             if (kc == 38 || kc == 40) {
  4841.                 if (e.preventDefault) {
  4842.                     e.preventDefault();
  4843.                 }
  4844.                 else {
  4845.                     e.returnValue = false;
  4846.                 }
  4847.             }
  4848.             if (kc == 40) {
  4849.                 _this.swipeNext();
  4850.             }
  4851.             if (kc == 38) {
  4852.                 _this.swipePrev();
  4853.             }
  4854.         }
  4855.     }
  4856.  
  4857.     var allowScrollChange = true;
  4858.  
  4859.     function handleMousewheel(e) {
  4860.         var we = _this._wheelEvent;
  4861.         var delta;
  4862.         if (e.detail) {
  4863.             delta = -e.detail;
  4864.         }
  4865.         else if (we == 'mousewheel') {
  4866.             delta = e.wheelDelta;
  4867.         }
  4868.         else if (we == 'DOMMouseScroll') {
  4869.             delta = -e.detail;
  4870.         }
  4871.         else if (we == 'wheel') {
  4872.             delta = Math.abs(e.deltaX) > Math.abs(e.deltaY) ? -e.deltaX : -e.deltaY;
  4873.         }
  4874.         if (!params.freeMode) {
  4875.             if (delta < 0) {
  4876.                 _this.swipeNext();
  4877.             }
  4878.             else {
  4879.                 _this.swipePrev();
  4880.             }
  4881.         }
  4882.         else {
  4883.             var position = _this.getWrapperTranslate() + delta;
  4884.             if (position > 0) {
  4885.                 position = 0;
  4886.             }
  4887.             if (position < -maxWrapperPosition()) {
  4888.                 position = -maxWrapperPosition();
  4889.             }
  4890.             _this.setWrapperTransition(0);
  4891.             _this.setWrapperTranslate(position);
  4892.             _this.updateActiveSlide(position);
  4893.         }
  4894.         if (params.autoplay) {
  4895.             _this.stopAutoplay();
  4896.         }
  4897.         if (e.preventDefault) {
  4898.             e.preventDefault();
  4899.         }
  4900.         else {
  4901.             e.returnValue = false;
  4902.         }
  4903.         return false;
  4904.     }
  4905.  
  4906.     if (params.grabCursor) {
  4907.         var containerStyle = _this.container.style;
  4908.         containerStyle.cursor = 'move';
  4909.         containerStyle.cursor = 'grab';
  4910.         containerStyle.cursor = '-moz-grab';
  4911.         containerStyle.cursor = '-webkit-grab';
  4912.     }
  4913.     _this.allowSlideClick = true;
  4914.     function slideClick(event) {
  4915.         if (_this.allowSlideClick) {
  4916.             setClickedSlide(event);
  4917.             params.onSlideClick(_this, event);
  4918.         }
  4919.     }
  4920.  
  4921.     function slideTouch(event) {
  4922.         setClickedSlide(event);
  4923.         params.onSlideTouch(_this, event);
  4924.     }
  4925.  
  4926.     function setClickedSlide(event) {
  4927.         if (!event.currentTarget) {
  4928.             var element = event.srcElement;
  4929.             do {
  4930.                 if (element.className.indexOf(params.slideClass) > -1) {
  4931.                     break;
  4932.                 }
  4933.             } while (element = element.parentNode);
  4934.             _this.clickedSlide = element;
  4935.         }
  4936.         else {
  4937.             _this.clickedSlide = event.currentTarget;
  4938.         }
  4939.         _this.clickedSlideIndex = _this.slides.indexOf(_this.clickedSlide);
  4940.         _this.clickedSlideLoopIndex = _this.clickedSlideIndex - (_this.loopedSlides || 0);
  4941.     }
  4942.  
  4943.     _this.allowLinks = true;
  4944.     function preventClick(e) {
  4945.         if (!_this.allowLinks) {
  4946.             if (e.preventDefault) {
  4947.                 e.preventDefault();
  4948.             }
  4949.             else {
  4950.                 e.returnValue = false;
  4951.             }
  4952.             return false;
  4953.         }
  4954.     }
  4955.  
  4956.     function releaseForms(e) {
  4957.         if (e.stopPropagation) {
  4958.             e.stopPropagation();
  4959.         }
  4960.         else {
  4961.             e.returnValue = false;
  4962.         }
  4963.         return false;
  4964.     }
  4965.  
  4966.     var isTouchEvent = false;
  4967.     var allowThresholdMove;
  4968.     var allowMomentumBounce = true;
  4969.  
  4970.     function onTouchStart(event) {
  4971.         if (params.preventLinks) {
  4972.             _this.allowLinks = true;
  4973.         }
  4974.         if (_this.isTouched || params.onlyExternal) {
  4975.             return false;
  4976.         }
  4977.         if (params.noSwiping && (event.target || event.srcElement) && noSwipingSlide(event.target || event.srcElement)) {
  4978.             return false;
  4979.         }
  4980.         allowMomentumBounce = false;
  4981.         _this.isTouched = true;
  4982.         isTouchEvent = event.type == 'touchstart';
  4983.         if (!isTouchEvent || event.targetTouches.length == 1) {
  4984.             _this.callPlugins('onTouchStartBegin');
  4985.             if (!isTouchEvent) {
  4986.                 if (event.preventDefault) {
  4987.                     event.preventDefault();
  4988.                 }
  4989.                 else {
  4990.                     event.returnValue = false;
  4991.                 }
  4992.             }
  4993.             var pageX = isTouchEvent ? event.targetTouches[0].pageX : (event.pageX || event.clientX);
  4994.             var pageY = isTouchEvent ? event.targetTouches[0].pageY : (event.pageY || event.clientY);
  4995.             _this.touches.startX = _this.touches.currentX = pageX;
  4996.             _this.touches.startY = _this.touches.currentY = pageY;
  4997.             _this.touches.start = _this.touches.current = isH ? pageX : pageY;
  4998.             _this.setWrapperTransition(0);
  4999.             _this.positions.start = _this.positions.current = _this.getWrapperTranslate();
  5000.             _this.setWrapperTranslate(_this.positions.start);
  5001.             _this.times.start = (new Date()).getTime();
  5002.             isScrolling = undefined;
  5003.             if (params.moveStartThreshold > 0) {
  5004.                 allowThresholdMove = false;
  5005.             }
  5006.             if (params.onTouchStart) {
  5007.                 params.onTouchStart(_this);
  5008.             }
  5009.             _this.callPlugins('onTouchStartEnd');
  5010.         }
  5011.     }
  5012.  
  5013.     var velocityPrevPosition, velocityPrevTime;
  5014.  
  5015.     function onTouchMove(event) {
  5016.         if (!_this.isTouched || params.onlyExternal) {
  5017.             return;
  5018.         }
  5019.         if (isTouchEvent && event.type == 'mousemove') {
  5020.             return;
  5021.         }
  5022.         var pageX = isTouchEvent ? event.targetTouches[0].pageX : (event.pageX || event.clientX);
  5023.         var pageY = isTouchEvent ? event.targetTouches[0].pageY : (event.pageY || event.clientY);
  5024.         if (typeof isScrolling === 'undefined' && isH) {
  5025.             isScrolling = !!(isScrolling || Math.abs(pageY - _this.touches.startY) > Math.abs(pageX - _this.touches.startX));
  5026.         }
  5027.         if (typeof isScrolling === 'undefined' && !isH) {
  5028.             isScrolling = !!(isScrolling || Math.abs(pageY - _this.touches.startY) < Math.abs(pageX - _this.touches.startX));
  5029.         }
  5030.         if (isScrolling) {
  5031.             _this.isTouched = false;
  5032.             return;
  5033.         }
  5034.         if (event.assignedToSwiper) {
  5035.             _this.isTouched = false;
  5036.             return;
  5037.         }
  5038.         event.assignedToSwiper = true;
  5039.         if (params.preventLinks) {
  5040.             _this.allowLinks = false;
  5041.         }
  5042.         if (params.onSlideClick) {
  5043.             _this.allowSlideClick = false;
  5044.         }
  5045.         if (params.autoplay) {
  5046.             _this.stopAutoplay();
  5047.         }
  5048.         if (!isTouchEvent || event.touches.length == 1) {
  5049.             if (!_this.isMoved) {
  5050.                 _this.callPlugins('onTouchMoveStart');
  5051.                 if (params.loop) {
  5052.                     _this.fixLoop();
  5053.                     _this.positions.start = _this.getWrapperTranslate();
  5054.                 }
  5055.                 if (params.onTouchMoveStart) {
  5056.                     params.onTouchMoveStart(_this);
  5057.                 }
  5058.             }
  5059.             _this.isMoved = true;
  5060.             if (event.preventDefault) {
  5061.                 event.preventDefault();
  5062.             }
  5063.             else {
  5064.                 event.returnValue = false;
  5065.             }
  5066.             _this.touches.current = isH ? pageX : pageY;
  5067.             _this.positions.current = (_this.touches.current - _this.touches.start) * params.touchRatio + _this.positions.start;
  5068.             if (_this.positions.current > 0 && params.onResistanceBefore) {
  5069.                 params.onResistanceBefore(_this, _this.positions.current);
  5070.             }
  5071.             if (_this.positions.current < -maxWrapperPosition() && params.onResistanceAfter) {
  5072.                 params.onResistanceAfter(_this, Math.abs(_this.positions.current + maxWrapperPosition()));
  5073.             }
  5074.             if (params.resistance && params.resistance != '100%') {
  5075.                 if (_this.positions.current > 0) {
  5076.                     var resistance = 1 - _this.positions.current / containerSize / 2;
  5077.                     if (resistance < 0.5) {
  5078.                         _this.positions.current = (containerSize / 2);
  5079.                     }
  5080.                     else {
  5081.                         _this.positions.current = _this.positions.current * resistance;
  5082.                     }
  5083.                 }
  5084.                 if (_this.positions.current < -maxWrapperPosition()) {
  5085.                     var diff = (_this.touches.current - _this.touches.start) * params.touchRatio + (maxWrapperPosition() + _this.positions.start);
  5086.                     var resistance = (containerSize + diff) / (containerSize);
  5087.                     var newPos = _this.positions.current - diff * (1 - resistance) / 2;
  5088.                     var stopPos = -maxWrapperPosition() - containerSize / 2;
  5089.                     if (newPos < stopPos || resistance <= 0) {
  5090.                         _this.positions.current = stopPos;
  5091.                     }
  5092.                     else {
  5093.                         _this.positions.current = newPos;
  5094.                     }
  5095.                 }
  5096.             }
  5097.             if (params.resistance && params.resistance == '100%') {
  5098.                 if (_this.positions.current > 0 && !(params.freeMode && !params.freeModeFluid)) {
  5099.                     _this.positions.current = 0;
  5100.                 }
  5101.                 if ((_this.positions.current) < -maxWrapperPosition() && !(params.freeMode && !params.freeModeFluid)) {
  5102.                     _this.positions.current = -maxWrapperPosition();
  5103.                 }
  5104.             }
  5105.             if (!params.followFinger) {
  5106.                 return;
  5107.             }
  5108.             if (!params.moveStartThreshold) {
  5109.                 _this.setWrapperTranslate(_this.positions.current);
  5110.             }
  5111.             else {
  5112.                 if (Math.abs(_this.touches.current - _this.touches.start) > params.moveStartThreshold || allowThresholdMove) {
  5113.                     allowThresholdMove = true;
  5114.                     _this.setWrapperTranslate(_this.positions.current);
  5115.                 }
  5116.                 else {
  5117.                     _this.positions.current = _this.positions.start;
  5118.                 }
  5119.             }
  5120.             if (params.freeMode || params.watchActiveIndex) {
  5121.                 _this.updateActiveSlide(_this.positions.current);
  5122.             }
  5123.             if (params.grabCursor) {
  5124.                 _this.container.style.cursor = 'move';
  5125.                 _this.container.style.cursor = 'grabbing';
  5126.                 _this.container.style.cursor = '-moz-grabbin';
  5127.                 _this.container.style.cursor = '-webkit-grabbing';
  5128.             }
  5129.             if (!velocityPrevPosition) {
  5130.                 velocityPrevPosition = _this.touches.current;
  5131.             }
  5132.             if (!velocityPrevTime) {
  5133.                 velocityPrevTime = (new Date).getTime();
  5134.             }
  5135.             _this.velocity = (_this.touches.current - velocityPrevPosition) / ((new Date).getTime() - velocityPrevTime) / 2;
  5136.             if (Math.abs(_this.touches.current - velocityPrevPosition) < 2) {
  5137.                 _this.velocity = 0;
  5138.             }
  5139.             velocityPrevPosition = _this.touches.current;
  5140.             velocityPrevTime = (new Date).getTime();
  5141.             _this.callPlugins('onTouchMoveEnd');
  5142.             if (params.onTouchMove) {
  5143.                 params.onTouchMove(_this);
  5144.             }
  5145.             return false;
  5146.         }
  5147.     }
  5148.  
  5149.     function onTouchEnd(event) {
  5150.         if (isScrolling) {
  5151.             _this.swipeReset();
  5152.         }
  5153.         if (params.onlyExternal || !_this.isTouched) {
  5154.             return;
  5155.         }
  5156.         _this.isTouched = false
  5157.         if (params.grabCursor) {
  5158.             _this.container.style.cursor = 'move';
  5159.             _this.container.style.cursor = 'grab';
  5160.             _this.container.style.cursor = '-moz-grab';
  5161.             _this.container.style.cursor = '-webkit-grab';
  5162.         }
  5163.         if (!_this.positions.current && _this.positions.current !== 0) {
  5164.             _this.positions.current = _this.positions.start
  5165.         }
  5166.         if (params.followFinger) {
  5167.             _this.setWrapperTranslate(_this.positions.current);
  5168.         }
  5169.         _this.times.end = (new Date()).getTime();
  5170.         _this.touches.diff = _this.touches.current - _this.touches.start
  5171.         _this.touches.abs = Math.abs(_this.touches.diff)
  5172.         _this.positions.diff = _this.positions.current - _this.positions.start
  5173.         _this.positions.abs = Math.abs(_this.positions.diff)
  5174.         var diff = _this.positions.diff;
  5175.         var diffAbs = _this.positions.abs;
  5176.         var timeDiff = _this.times.end - _this.times.start
  5177.         if (diffAbs < 5 && (timeDiff) < 300 && _this.allowLinks == false) {
  5178.             if (!params.freeMode && diffAbs != 0) {
  5179.                 _this.swipeReset()
  5180.             }
  5181.             if (params.preventLinks) {
  5182.                 _this.allowLinks = true;
  5183.             }
  5184.             if (params.onSlideClick) {
  5185.                 _this.allowSlideClick = true;
  5186.             }
  5187.         }
  5188.         setTimeout(function () {
  5189.             if (params.preventLinks) {
  5190.                 _this.allowLinks = true;
  5191.             }
  5192.             if (params.onSlideClick) {
  5193.                 _this.allowSlideClick = true;
  5194.             }
  5195.         }, 100);
  5196.         var maxPosition = maxWrapperPosition();
  5197.         if (!_this.isMoved && params.freeMode) {
  5198.             _this.isMoved = false;
  5199.             if (params.onTouchEnd) {
  5200.                 params.onTouchEnd(_this);
  5201.             }
  5202.             _this.callPlugins('onTouchEnd');
  5203.             return;
  5204.         }
  5205.         if (!_this.isMoved || _this.positions.current > 0 || _this.positions.current < -maxPosition) {
  5206.             _this.swipeReset();
  5207.             if (params.onTouchEnd) {
  5208.                 params.onTouchEnd(_this);
  5209.             }
  5210.             _this.callPlugins('onTouchEnd');
  5211.             return;
  5212.         }
  5213.         _this.isMoved = false;
  5214.         if (params.freeMode) {
  5215.             if (params.freeModeFluid) {
  5216.                 var momentumDuration = 1000 * params.momentumRatio;
  5217.                 var momentumDistance = _this.velocity * momentumDuration;
  5218.                 var newPosition = _this.positions.current + momentumDistance
  5219.                 var doBounce = false;
  5220.                 var afterBouncePosition;
  5221.                 var bounceAmount = Math.abs(_this.velocity) * 20 * params.momentumBounceRatio;
  5222.                 if (newPosition < -maxPosition) {
  5223.                     if (params.momentumBounce && _this.support.transitions) {
  5224.                         if (newPosition + maxPosition < -bounceAmount) {
  5225.                             newPosition = -maxPosition - bounceAmount;
  5226.                         }
  5227.                         afterBouncePosition = -maxPosition;
  5228.                         doBounce = true;
  5229.                         allowMomentumBounce = true;
  5230.                     }
  5231.                     else {
  5232.                         newPosition = -maxPosition;
  5233.                     }
  5234.                 }
  5235.                 if (newPosition > 0) {
  5236.                     if (params.momentumBounce && _this.support.transitions) {
  5237.                         if (newPosition > bounceAmount) {
  5238.                             newPosition = bounceAmount;
  5239.                         }
  5240.                         afterBouncePosition = 0
  5241.                         doBounce = true;
  5242.                         allowMomentumBounce = true;
  5243.                     }
  5244.                     else {
  5245.                         newPosition = 0;
  5246.                     }
  5247.                 }
  5248.                 if (_this.velocity != 0) {
  5249.                     momentumDuration = Math.abs((newPosition - _this.positions.current) / _this.velocity)
  5250.                 }
  5251.                 _this.setWrapperTranslate(newPosition);
  5252.                 _this.setWrapperTransition(momentumDuration);
  5253.                 if (params.momentumBounce && doBounce) {
  5254.                     _this.wrapperTransitionEnd(function () {
  5255.                         if (!allowMomentumBounce) {
  5256.                             return;
  5257.                         }
  5258.                         if (params.onMomentumBounce) {
  5259.                             params.onMomentumBounce(_this);
  5260.                         }
  5261.                         _this.setWrapperTranslate(afterBouncePosition);
  5262.                         _this.setWrapperTransition(300);
  5263.                     })
  5264.                 }
  5265.                 _this.updateActiveSlide(newPosition)
  5266.             }
  5267.             if (!params.freeModeFluid || timeDiff >= 300) {
  5268.                 _this.updateActiveSlide(_this.positions.current)
  5269.             }
  5270.             if (params.onTouchEnd) {
  5271.                 params.onTouchEnd(_this)
  5272.             }
  5273.             _this.callPlugins('onTouchEnd');
  5274.             return;
  5275.         }
  5276.         direction = diff < 0 ? "toNext" : "toPrev"
  5277.         if (direction == "toNext" && (timeDiff <= 300)) {
  5278.             if (diffAbs < 30 || !params.shortSwipes) {
  5279.                 _this.swipeReset()
  5280.             }
  5281.             else {
  5282.                 _this.swipeNext(true);
  5283.             }
  5284.         }
  5285.         if (direction == "toPrev" && (timeDiff <= 300)) {
  5286.             if (diffAbs < 30 || !params.shortSwipes) {
  5287.                 _this.swipeReset()
  5288.             }
  5289.             else {
  5290.                 _this.swipePrev(true);
  5291.             }
  5292.         }
  5293.         var targetSlideSize = 0;
  5294.         if (params.slidesPerView == 'auto') {
  5295.             var currentPosition = Math.abs(_this.getWrapperTranslate());
  5296.             var slidesOffset = 0;
  5297.             var _slideSize;
  5298.             for (var i = 0; i < _this.slides.length; i++) {
  5299.                 _slideSize = isH ? _this.slides[i].getWidth(true) : _this.slides[i].getHeight(true);
  5300.                 slidesOffset += _slideSize;
  5301.                 if (slidesOffset > currentPosition) {
  5302.                     targetSlideSize = _slideSize;
  5303.                     break;
  5304.                 }
  5305.             }
  5306.             if (targetSlideSize > containerSize) {
  5307.                 targetSlideSize = containerSize;
  5308.             }
  5309.         }
  5310.         else {
  5311.             targetSlideSize = slideSize * params.slidesPerView;
  5312.         }
  5313.         if (direction == "toNext" && (timeDiff > 300)) {
  5314.             if (diffAbs >= targetSlideSize * 0.5) {
  5315.                 _this.swipeNext(true)
  5316.             }
  5317.             else {
  5318.                 _this.swipeReset()
  5319.             }
  5320.         }
  5321.         if (direction == "toPrev" && (timeDiff > 300)) {
  5322.             if (diffAbs >= targetSlideSize * 0.5) {
  5323.                 _this.swipePrev(true);
  5324.             }
  5325.             else {
  5326.                 _this.swipeReset()
  5327.             }
  5328.         }
  5329.         if (params.onTouchEnd) {
  5330.             params.onTouchEnd(_this)
  5331.         }
  5332.         _this.callPlugins('onTouchEnd');
  5333.     }
  5334.  
  5335.     function noSwipingSlide(el) {
  5336.         var noSwiping = false;
  5337.         do {
  5338.             if (el.className.indexOf(params.noSwipingClass) > -1) {
  5339.                 noSwiping = true;
  5340.             }
  5341.             el = el.parentElement;
  5342.         } while (!noSwiping && el.parentElement && el.className.indexOf(params.wrapperClass) == -1);
  5343.         if (!noSwiping && el.className.indexOf(params.wrapperClass) > -1 && el.className.indexOf(params.noSwipingClass) > -1) {
  5344.             noSwiping = true;
  5345.         }
  5346.         return noSwiping;
  5347.     }
  5348.  
  5349.     _this.swipeNext = function (internal) {
  5350.         if (!internal && params.loop) {
  5351.             _this.fixLoop();
  5352.         }
  5353.         _this.callPlugins('onSwipeNext');
  5354.         var currentPosition = _this.getWrapperTranslate();
  5355.         var newPosition = currentPosition;
  5356.         if (params.slidesPerView == 'auto') {
  5357.             for (var i = 0; i < _this.snapGrid.length; i++) {
  5358.                 if (-currentPosition >= _this.snapGrid[i] && -currentPosition < _this.snapGrid[i + 1]) {
  5359.                     newPosition = -_this.snapGrid[i + 1]
  5360.                     break;
  5361.                 }
  5362.             }
  5363.         }
  5364.         else {
  5365.             var groupSize = slideSize * params.slidesPerGroup;
  5366.             newPosition = -(Math.floor(Math.abs(currentPosition) / Math.floor(groupSize)) * groupSize + groupSize);
  5367.         }
  5368.         if (newPosition < -maxWrapperPosition()) {
  5369.             newPosition = -maxWrapperPosition()
  5370.         }
  5371.         ;
  5372.         if (newPosition == currentPosition) {
  5373.             return false;
  5374.         }
  5375.         swipeToPosition(newPosition, 'next');
  5376.         return true
  5377.     }
  5378.     _this.swipePrev = function (internal) {
  5379.         if (!internal && params.loop) {
  5380.             _this.fixLoop();
  5381.         }
  5382.         if (!internal && params.autoplay) {
  5383.             _this.stopAutoplay();
  5384.         }
  5385.         _this.callPlugins('onSwipePrev');
  5386.         var currentPosition = Math.ceil(_this.getWrapperTranslate());
  5387.         var newPosition;
  5388.         if (params.slidesPerView == 'auto') {
  5389.             newPosition = 0;
  5390.             for (var i = 1; i < _this.snapGrid.length; i++) {
  5391.                 if (-currentPosition == _this.snapGrid[i]) {
  5392.                     newPosition = -_this.snapGrid[i - 1]
  5393.                     break;
  5394.                 }
  5395.                 if (-currentPosition > _this.snapGrid[i] && -currentPosition < _this.snapGrid[i + 1]) {
  5396.                     newPosition = -_this.snapGrid[i]
  5397.                     break;
  5398.                 }
  5399.             }
  5400.         }
  5401.         else {
  5402.             var groupSize = slideSize * params.slidesPerGroup;
  5403.             newPosition = -(Math.ceil(-currentPosition / groupSize) - 1) * groupSize;
  5404.         }
  5405.         if (newPosition > 0) {
  5406.             newPosition = 0;
  5407.         }
  5408.         if (newPosition == currentPosition) {
  5409.             return false;
  5410.         }
  5411.         swipeToPosition(newPosition, 'prev');
  5412.         return true;
  5413.     }
  5414.     _this.swipeReset = function () {
  5415.         _this.callPlugins('onSwipeReset');
  5416.         var currentPosition = _this.getWrapperTranslate();
  5417.         var groupSize = slideSize * params.slidesPerGroup;
  5418.         var newPosition;
  5419.         var maxPosition = -maxWrapperPosition();
  5420.         if (params.slidesPerView == 'auto') {
  5421.             newPosition = 0;
  5422.             for (var i = 0; i < _this.snapGrid.length; i++) {
  5423.                 if (-currentPosition === _this.snapGrid[i]) {
  5424.                     return;
  5425.                 }
  5426.                 if (-currentPosition >= _this.snapGrid[i] && -currentPosition < _this.snapGrid[i + 1]) {
  5427.                     if (_this.positions.diff > 0) {
  5428.                         newPosition = -_this.snapGrid[i + 1]
  5429.                     }
  5430.                     else {
  5431.                         newPosition = -_this.snapGrid[i]
  5432.                     }
  5433.                     break;
  5434.                 }
  5435.             }
  5436.             if (-currentPosition >= _this.snapGrid[_this.snapGrid.length - 1]) {
  5437.                 newPosition = -_this.snapGrid[_this.snapGrid.length - 1];
  5438.             }
  5439.             if (currentPosition <= -maxWrapperPosition()) {
  5440.                 newPosition = -maxWrapperPosition()
  5441.             }
  5442.         }
  5443.         else {
  5444.             newPosition = currentPosition < 0 ? Math.round(currentPosition / groupSize) * groupSize : 0
  5445.         }
  5446.         if (params.scrollContainer) {
  5447.             newPosition = currentPosition < 0 ? currentPosition : 0;
  5448.         }
  5449.         if (newPosition < -maxWrapperPosition()) {
  5450.             newPosition = -maxWrapperPosition()
  5451.         }
  5452.         if (params.scrollContainer && (containerSize > slideSize)) {
  5453.             newPosition = 0;
  5454.         }
  5455.         if (newPosition == currentPosition) {
  5456.             return false;
  5457.         }
  5458.         swipeToPosition(newPosition, 'reset');
  5459.         return true;
  5460.     }
  5461.     _this.swipeTo = function (index, speed, runCallbacks) {
  5462.         index = parseInt(index, 10);
  5463.         _this.callPlugins('onSwipeTo', {index: index, speed: speed});
  5464.         if (params.loop) {
  5465.             index = index + _this.loopedSlides;
  5466.         }
  5467.         var currentPosition = _this.getWrapperTranslate();
  5468.         if (index > (_this.slides.length - 1) || index < 0) {
  5469.             return;
  5470.         }
  5471.         var newPosition
  5472.         if (params.slidesPerView == 'auto') {
  5473.             newPosition = -_this.slidesGrid[index];
  5474.         }
  5475.         else {
  5476.             newPosition = -index * slideSize;
  5477.         }
  5478.         if (newPosition < -maxWrapperPosition()) {
  5479.             newPosition = -maxWrapperPosition();
  5480.         }
  5481.         ;
  5482.         if (newPosition == currentPosition) {
  5483.             return false;
  5484.         }
  5485.         runCallbacks = runCallbacks === false ? false : true;
  5486.         swipeToPosition(newPosition, 'to', {index: index, speed: speed, runCallbacks: runCallbacks});
  5487.         return true;
  5488.     }
  5489.     function swipeToPosition(newPosition, action, toOptions) {
  5490.         var speed = (action == 'to' && toOptions.speed >= 0) ? toOptions.speed : params.speed;
  5491.         if (_this.support.transitions || !params.DOMAnimation) {
  5492.             _this.setWrapperTranslate(newPosition);
  5493.             _this.setWrapperTransition(speed);
  5494.         }
  5495.         else {
  5496.             var currentPosition = _this.getWrapperTranslate();
  5497.             var animationStep = Math.ceil((newPosition - currentPosition) / speed * (1000 / 60));
  5498.             var direction = currentPosition > newPosition ? 'toNext' : 'toPrev';
  5499.             var condition = direction == 'toNext' ? currentPosition > newPosition : currentPosition < newPosition;
  5500.             if (_this._DOMAnimating) {
  5501.                 return;
  5502.             }
  5503.             anim();
  5504.         }
  5505.         function anim() {
  5506.             currentPosition += animationStep;
  5507.             condition = direction == 'toNext' ? currentPosition > newPosition : currentPosition < newPosition;
  5508.             if (condition) {
  5509.                 _this.setWrapperTranslate(Math.round(currentPosition));
  5510.                 _this._DOMAnimating = true
  5511.                 window.setTimeout(function () {
  5512.                     anim()
  5513.                 }, 1000 / 60)
  5514.             }
  5515.             else {
  5516.                 if (params.onSlideChangeEnd) {
  5517.                     params.onSlideChangeEnd(_this);
  5518.                 }
  5519.                 _this.setWrapperTranslate(newPosition);
  5520.                 _this._DOMAnimating = false;
  5521.             }
  5522.         }
  5523.  
  5524.         _this.updateActiveSlide(newPosition);
  5525.         if (params.onSlideNext && action == 'next') {
  5526.             params.onSlideNext(_this, newPosition);
  5527.         }
  5528.         if (params.onSlidePrev && action == 'prev') {
  5529.             params.onSlidePrev(_this, newPosition);
  5530.         }
  5531.         if (params.onSlideReset && action == 'reset') {
  5532.             params.onSlideReset(_this, newPosition);
  5533.         }
  5534.         if (action == 'next' || action == 'prev' || (action == 'to' && toOptions.runCallbacks == true)) {
  5535.             slideChangeCallbacks();
  5536.         }
  5537.     }
  5538.  
  5539.     _this._queueStartCallbacks = false;
  5540.     _this._queueEndCallbacks = false;
  5541.     function slideChangeCallbacks() {
  5542.         _this.callPlugins('onSlideChangeStart');
  5543.         if (params.onSlideChangeStart) {
  5544.             if (params.queueStartCallbacks && _this.support.transitions) {
  5545.                 if (_this._queueStartCallbacks) {
  5546.                     return;
  5547.                 }
  5548.                 _this._queueStartCallbacks = true;
  5549.                 params.onSlideChangeStart(_this)
  5550.                 _this.wrapperTransitionEnd(function () {
  5551.                     _this._queueStartCallbacks = false;
  5552.                 })
  5553.             }
  5554.             else {
  5555.                 params.onSlideChangeStart(_this)
  5556.             }
  5557.         }
  5558.         if (params.onSlideChangeEnd) {
  5559.             if (_this.support.transitions) {
  5560.                 if (params.queueEndCallbacks) {
  5561.                     if (_this._queueEndCallbacks) {
  5562.                         return;
  5563.                     }
  5564.                     _this._queueEndCallbacks = true;
  5565.                     _this.wrapperTransitionEnd(params.onSlideChangeEnd)
  5566.                 }
  5567.                 else {
  5568.                     _this.wrapperTransitionEnd(params.onSlideChangeEnd)
  5569.                 }
  5570.             }
  5571.             else {
  5572.                 if (!params.DOMAnimation) {
  5573.                     setTimeout(function () {
  5574.                         params.onSlideChangeEnd(_this)
  5575.                     }, 10)
  5576.                 }
  5577.             }
  5578.         }
  5579.     }
  5580.  
  5581.     _this.updateActiveSlide = function (position) {
  5582.         if (!_this.initialized) {
  5583.             return;
  5584.         }
  5585.         if (_this.slides.length == 0) {
  5586.             return;
  5587.         }
  5588.         _this.previousIndex = _this.activeIndex;
  5589.         if (typeof position == 'undefined') {
  5590.             position = _this.getWrapperTranslate();
  5591.         }
  5592.         if (position > 0) {
  5593.             position = 0;
  5594.         }
  5595.         if (params.slidesPerView == 'auto') {
  5596.             var slidesOffset = 0;
  5597.             _this.activeIndex = _this.slidesGrid.indexOf(-position);
  5598.             if (_this.activeIndex < 0) {
  5599.                 for (var i = 0; i < _this.slidesGrid.length - 1; i++) {
  5600.                     if (-position > _this.slidesGrid[i] && -position < _this.slidesGrid[i + 1]) {
  5601.                         break;
  5602.                     }
  5603.                 }
  5604.                 var leftDistance = Math.abs(_this.slidesGrid[i] + position)
  5605.                 var rightDistance = Math.abs(_this.slidesGrid[i + 1] + position)
  5606.                 if (leftDistance <= rightDistance) {
  5607.                     _this.activeIndex = i;
  5608.                 }
  5609.                 else {
  5610.                     _this.activeIndex = i + 1;
  5611.                 }
  5612.             }
  5613.         }
  5614.         else {
  5615.             _this.activeIndex = Math[params.visibilityFullFit ? 'ceil' : 'round'](-position / slideSize);
  5616.         }
  5617.         if (_this.activeIndex == _this.slides.length) {
  5618.             _this.activeIndex = _this.slides.length - 1;
  5619.         }
  5620.         if (_this.activeIndex < 0) {
  5621.             _this.activeIndex = 0;
  5622.         }
  5623.         if (!_this.slides[_this.activeIndex]) {
  5624.             return;
  5625.         }
  5626.         _this.calcVisibleSlides(position);
  5627.         var activeClassRegexp = new RegExp("\\s*" + params.slideActiveClass);
  5628.         var inViewClassRegexp = new RegExp("\\s*" + params.slideVisibleClass);
  5629.         for (var i = 0; i < _this.slides.length; i++) {
  5630.             _this.slides[i].className = _this.slides[i].className.replace(activeClassRegexp, '').replace(inViewClassRegexp, '');
  5631.             if (_this.visibleSlides.indexOf(_this.slides[i]) >= 0) {
  5632.                 _this.slides[i].className += ' ' + params.slideVisibleClass;
  5633.             }
  5634.         }
  5635.         _this.slides[_this.activeIndex].className += ' ' + params.slideActiveClass;
  5636.         if (params.loop) {
  5637.             var ls = _this.loopedSlides;
  5638.             _this.activeLoopIndex = _this.activeIndex - ls;
  5639.             if (_this.activeLoopIndex >= _this.slides.length - ls * 2) {
  5640.                 _this.activeLoopIndex = _this.slides.length - ls * 2 - _this.activeLoopIndex;
  5641.             }
  5642.             if (_this.activeLoopIndex < 0) {
  5643.                 _this.activeLoopIndex = _this.slides.length - ls * 2 + _this.activeLoopIndex;
  5644.             }
  5645.         }
  5646.         else {
  5647.             _this.activeLoopIndex = _this.activeIndex;
  5648.         }
  5649.         if (params.pagination) {
  5650.             _this.updatePagination(position);
  5651.         }
  5652.     }
  5653.     _this.createPagination = function (firstInit) {
  5654.         if (params.paginationClickable && _this.paginationButtons) {
  5655.             removePaginationEvents();
  5656.         }
  5657.         var paginationHTML = "";
  5658.         var numOfSlides = _this.slides.length;
  5659.         var numOfButtons = numOfSlides;
  5660.         if (params.loop) {
  5661.             numOfButtons -= _this.loopedSlides * 2
  5662.         }
  5663.         for (var i = 0; i < numOfButtons; i++) {
  5664.             paginationHTML += '<' + params.paginationElement + ' class="' + params.paginationElementClass + '"></' + params.paginationElement + '>'
  5665.         }
  5666.         _this.paginationContainer = params.pagination.nodeType ? params.pagination : $$(params.pagination)[0];
  5667.         _this.paginationContainer.innerHTML = paginationHTML;
  5668.         _this.paginationButtons = $$('.' + params.paginationElementClass, _this.paginationContainer);
  5669.         if (!firstInit) {
  5670.             _this.updatePagination()
  5671.         }
  5672.         _this.callPlugins('onCreatePagination');
  5673.         if (params.paginationClickable) {
  5674.             addPaginationEvents();
  5675.         }
  5676.     }
  5677.     function removePaginationEvents() {
  5678.         var pagers = _this.paginationButtons;
  5679.         for (var i = 0; i < pagers.length; i++) {
  5680.             _this.h.removeEventListener(pagers[i], 'click', paginationClick);
  5681.         }
  5682.     }
  5683.  
  5684.     function addPaginationEvents() {
  5685.         var pagers = _this.paginationButtons;
  5686.         for (var i = 0; i < pagers.length; i++) {
  5687.             _this.h.addEventListener(pagers[i], 'click', paginationClick);
  5688.         }
  5689.     }
  5690.  
  5691.     function paginationClick(e) {
  5692.         var index;
  5693.         var target = e.target || e.srcElement;
  5694.         var pagers = _this.paginationButtons;
  5695.         for (var i = 0; i < pagers.length; i++) {
  5696.             if (target === pagers[i]) {
  5697.                 index = i;
  5698.             }
  5699.         }
  5700.         _this.swipeTo(index)
  5701.     }
  5702.  
  5703.     _this.updatePagination = function (position) {
  5704.         if (!params.pagination) {
  5705.             return;
  5706.         }
  5707.         if (_this.slides.length < 1) {
  5708.             return;
  5709.         }
  5710.         var activePagers = $$('.' + params.paginationActiveClass, _this.paginationContainer);
  5711.         if (!activePagers) {
  5712.             return;
  5713.         }
  5714.         var pagers = _this.paginationButtons;
  5715.         if (pagers.length == 0) {
  5716.             return;
  5717.         }
  5718.         for (var i = 0; i < pagers.length; i++) {
  5719.             pagers[i].className = params.paginationElementClass
  5720.         }
  5721.         var indexOffset = params.loop ? _this.loopedSlides : 0;
  5722.         if (params.paginationAsRange) {
  5723.             if (!_this.visibleSlides) {
  5724.                 _this.calcVisibleSlides(position)
  5725.             }
  5726.             var visibleIndexes = [];
  5727.             for (var i = 0; i < _this.visibleSlides.length; i++) {
  5728.                 var visIndex = _this.slides.indexOf(_this.visibleSlides[i]) - indexOffset
  5729.                 if (params.loop && visIndex < 0) {
  5730.                     visIndex = _this.slides.length - _this.loopedSlides * 2 + visIndex;
  5731.                 }
  5732.                 if (params.loop && visIndex >= _this.slides.length - _this.loopedSlides * 2) {
  5733.                     visIndex = _this.slides.length - _this.loopedSlides * 2 - visIndex;
  5734.                     visIndex = Math.abs(visIndex)
  5735.                 }
  5736.                 visibleIndexes.push(visIndex)
  5737.             }
  5738.             for (i = 0; i < visibleIndexes.length; i++) {
  5739.                 if (pagers[visibleIndexes[i]]) {
  5740.                     pagers[visibleIndexes[i]].className += ' ' + params.paginationVisibleClass;
  5741.                 }
  5742.             }
  5743.             if (params.loop) {
  5744.                 pagers[_this.activeLoopIndex].className += ' ' + params.paginationActiveClass;
  5745.             }
  5746.             else {
  5747.                 pagers[_this.activeIndex].className += ' ' + params.paginationActiveClass;
  5748.             }
  5749.         }
  5750.         else {
  5751.             if (params.loop) {
  5752.                 pagers[_this.activeLoopIndex].className += ' ' + params.paginationActiveClass + ' ' + params.paginationVisibleClass;
  5753.             }
  5754.             else {
  5755.                 pagers[_this.activeIndex].className += ' ' + params.paginationActiveClass + ' ' + params.paginationVisibleClass;
  5756.             }
  5757.         }
  5758.     }
  5759.     _this.calcVisibleSlides = function (position) {
  5760.         var visibleSlides = [];
  5761.         var _slideLeft = 0, _slideSize = 0, _slideRight = 0;
  5762.         if (isH && _this.wrapperLeft > 0) {
  5763.             position = position + _this.wrapperLeft;
  5764.         }
  5765.         if (!isH && _this.wrapperTop > 0) {
  5766.             position = position + _this.wrapperTop;
  5767.         }
  5768.         for (var i = 0; i < _this.slides.length; i++) {
  5769.             _slideLeft += _slideSize;
  5770.             if (params.slidesPerView == 'auto') {
  5771.                 _slideSize = isH ? _this.h.getWidth(_this.slides[i], true) : _this.h.getHeight(_this.slides[i], true);
  5772.             }
  5773.             else {
  5774.                 _slideSize = slideSize;
  5775.             }
  5776.             _slideRight = _slideLeft + _slideSize;
  5777.             var isVisibile = false;
  5778.             if (params.visibilityFullFit) {
  5779.                 if (_slideLeft >= -position && _slideRight <= -position + containerSize) {
  5780.                     isVisibile = true;
  5781.                 }
  5782.                 if (_slideLeft <= -position && _slideRight >= -position + containerSize) {
  5783.                     isVisibile = true;
  5784.                 }
  5785.             }
  5786.             else {
  5787.                 if (_slideRight > -position && _slideRight <= ((-position + containerSize))) {
  5788.                     isVisibile = true;
  5789.                 }
  5790.                 if (_slideLeft >= -position && _slideLeft < ((-position + containerSize))) {
  5791.                     isVisibile = true;
  5792.                 }
  5793.                 if (_slideLeft < -position && _slideRight > ((-position + containerSize))) {
  5794.                     isVisibile = true;
  5795.                 }
  5796.             }
  5797.             if (isVisibile) {
  5798.                 visibleSlides.push(_this.slides[i])
  5799.             }
  5800.         }
  5801.         if (visibleSlides.length == 0) {
  5802.             visibleSlides = [_this.slides[_this.activeIndex]]
  5803.         }
  5804.         _this.visibleSlides = visibleSlides;
  5805.     }
  5806.     _this.autoPlayIntervalId = undefined;
  5807.     _this.startAutoplay = function () {
  5808.         if (typeof _this.autoPlayIntervalId !== 'undefined') {
  5809.             return false;
  5810.         }
  5811.         if (params.autoplay && !params.loop) {
  5812.             _this.autoPlayIntervalId = setInterval(function () {
  5813.                 if (!_this.swipeNext(true)) {
  5814.                     _this.swipeTo(0);
  5815.                 }
  5816.             }, params.autoplay)
  5817.         }
  5818.         if (params.autoplay && params.loop) {
  5819.             _this.autoPlayIntervalId = setInterval(function () {
  5820.                 _this.swipeNext();
  5821.             }, params.autoplay)
  5822.         }
  5823.         _this.callPlugins('onAutoplayStart');
  5824.     }
  5825.     _this.stopAutoplay = function () {
  5826.         if (_this.autoPlayIntervalId) {
  5827.             clearInterval(_this.autoPlayIntervalId);
  5828.         }
  5829.         _this.autoPlayIntervalId = undefined;
  5830.         _this.callPlugins('onAutoplayStop');
  5831.     }
  5832.     _this.loopCreated = false;
  5833.     _this.removeLoopedSlides = function () {
  5834.         if (_this.loopCreated) {
  5835.             for (var i = 0; i < _this.slides.length; i++) {
  5836.                 if (_this.slides[i].getData('looped') === true) {
  5837.                     _this.wrapper.removeChild(_this.slides[i]);
  5838.                 }
  5839.             }
  5840.         }
  5841.     }
  5842.     _this.createLoop = function () {
  5843.         if (_this.slides.length == 0) {
  5844.             return;
  5845.         }
  5846.         _this.loopedSlides = params.slidesPerView + params.loopAdditionalSlides;
  5847.         if (_this.loopedSlides > _this.slides.length) {
  5848.             _this.loopedSlides = _this.slides.length;
  5849.         }
  5850.         var slideFirstHTML = '', slideLastHTML = '', i;
  5851.         for (i = 0; i < _this.loopedSlides; i++) {
  5852.             slideFirstHTML += _this.slides[i].outerHTML;
  5853.         }
  5854.         for (i = _this.slides.length - _this.loopedSlides; i < _this.slides.length; i++) {
  5855.             slideLastHTML += _this.slides[i].outerHTML;
  5856.         }
  5857.         wrapper.innerHTML = slideLastHTML + wrapper.innerHTML + slideFirstHTML;
  5858.         _this.loopCreated = true;
  5859.         _this.calcSlides();
  5860.         for (i = 0; i < _this.slides.length; i++) {
  5861.             if (i < _this.loopedSlides || i >= _this.slides.length - _this.loopedSlides) {
  5862.                 _this.slides[i].setData('looped', true);
  5863.             }
  5864.         }
  5865.         _this.callPlugins('onCreateLoop');
  5866.     }
  5867.     _this.fixLoop = function () {
  5868.         var newIndex;
  5869.         if (_this.activeIndex < _this.loopedSlides) {
  5870.             newIndex = _this.slides.length - _this.loopedSlides * 3 + _this.activeIndex;
  5871.             _this.swipeTo(newIndex, 0, false);
  5872.         }
  5873.         else if (_this.activeIndex > _this.slides.length - params.slidesPerView * 2) {
  5874.             newIndex = -_this.slides.length + _this.activeIndex + _this.loopedSlides
  5875.             _this.swipeTo(newIndex, 0, false);
  5876.         }
  5877.     }
  5878.     _this.loadSlides = function () {
  5879.         var slidesHTML = '';
  5880.         _this.activeLoaderIndex = 0;
  5881.         var slides = params.loader.slides;
  5882.         var slidesToLoad = params.loader.loadAllSlides ? slides.length : params.slidesPerView * (1 + params.loader.surroundGroups);
  5883.         for (var i = 0; i < slidesToLoad; i++) {
  5884.             if (params.loader.slidesHTMLType == 'outer') {
  5885.                 slidesHTML += slides[i];
  5886.             }
  5887.             else {
  5888.                 slidesHTML +=
  5889.                         '<' + params.slideElement + ' class="' + params.slideClass + '" data-swiperindex="' + i + '">' + slides[i] + '</'
  5890.                         + params.slideElement + '>';
  5891.             }
  5892.         }
  5893.         _this.wrapper.innerHTML = slidesHTML;
  5894.         _this.calcSlides(true);
  5895.         if (!params.loader.loadAllSlides) {
  5896.             _this.wrapperTransitionEnd(_this.reloadSlides, true);
  5897.         }
  5898.     }
  5899.     _this.reloadSlides = function () {
  5900.         var slides = params.loader.slides;
  5901.         var newActiveIndex = parseInt(_this.activeSlide().data('swiperindex'), 10)
  5902.         if (newActiveIndex < 0 || newActiveIndex > slides.length - 1) {
  5903.             return
  5904.         }
  5905.         _this.activeLoaderIndex = newActiveIndex;
  5906.         var firstIndex = Math.max(0, newActiveIndex - params.slidesPerView * params.loader.surroundGroups)
  5907.         var lastIndex = Math.min(newActiveIndex + params.slidesPerView * (1 + params.loader.surroundGroups) - 1, slides.length - 1)
  5908.         if (newActiveIndex > 0) {
  5909.             var newTransform = -slideSize * (newActiveIndex - firstIndex)
  5910.             _this.setWrapperTranslate(newTransform);
  5911.             _this.setWrapperTransition(0);
  5912.         }
  5913.         if (params.loader.logic === 'reload') {
  5914.             _this.wrapper.innerHTML = '';
  5915.             var slidesHTML = '';
  5916.             for (var i = firstIndex; i <= lastIndex; i++) {
  5917.                 slidesHTML +=
  5918.                                 params.loader.slidesHTMLType == 'outer' ? slides[i] :
  5919.                         '<' + params.slideElement + ' class="' + params.slideClass + '" data-swiperindex="' + i + '">' + slides[i] + '</'
  5920.                         + params.slideElement + '>';
  5921.             }
  5922.             _this.wrapper.innerHTML = slidesHTML;
  5923.         }
  5924.         else {
  5925.             var minExistIndex = 1000;
  5926.             var maxExistIndex = 0;
  5927.             for (var i = 0; i < _this.slides.length; i++) {
  5928.                 var index = _this.slides[i].data('swiperindex');
  5929.                 if (index < firstIndex || index > lastIndex) {
  5930.                     _this.wrapper.removeChild(_this.slides[i]);
  5931.                 }
  5932.                 else {
  5933.                     minExistIndex = Math.min(index, minExistIndex)
  5934.                     maxExistIndex = Math.max(index, maxExistIndex)
  5935.                 }
  5936.             }
  5937.             for (var i = firstIndex; i <= lastIndex; i++) {
  5938.                 if (i < minExistIndex) {
  5939.                     var newSlide = document.createElement(params.slideElement);
  5940.                     newSlide.className = params.slideClass;
  5941.                     newSlide.setAttribute('data-swiperindex', i);
  5942.                     newSlide.innerHTML = slides[i];
  5943.                     _this.wrapper.insertBefore(newSlide, _this.wrapper.firstChild);
  5944.                 }
  5945.                 if (i > maxExistIndex) {
  5946.                     var newSlide = document.createElement(params.slideElement);
  5947.                     newSlide.className = params.slideClass;
  5948.                     newSlide.setAttribute('data-swiperindex', i);
  5949.                     newSlide.innerHTML = slides[i];
  5950.                     _this.wrapper.appendChild(newSlide);
  5951.                 }
  5952.             }
  5953.         }
  5954.         _this.reInit(true);
  5955.     }
  5956.     function makeSwiper() {
  5957.         _this.calcSlides();
  5958.         if (params.loader.slides.length > 0 && _this.slides.length == 0) {
  5959.             _this.loadSlides();
  5960.         }
  5961.         if (params.loop) {
  5962.             _this.createLoop();
  5963.         }
  5964.         _this.init();
  5965.         initEvents();
  5966.         if (params.pagination && params.createPagination) {
  5967.             _this.createPagination(true);
  5968.         }
  5969.         if (params.loop || params.initialSlide > 0) {
  5970.             _this.swipeTo(params.initialSlide, 0, false);
  5971.         }
  5972.         else {
  5973.             _this.updateActiveSlide(0);
  5974.         }
  5975.         if (params.autoplay) {
  5976.             _this.startAutoplay();
  5977.         }
  5978.     }
  5979.  
  5980.     makeSwiper();
  5981. }
  5982. Swiper.prototype = {plugins: {}, wrapperTransitionEnd: function (callback, permanent) {
  5983.     var a = this, el = a.wrapper, events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'], i;
  5984.  
  5985.     function fireCallBack() {
  5986.         callback(a);
  5987.         if (a.params.queueEndCallbacks) {
  5988.             a._queueEndCallbacks = false;
  5989.         }
  5990.         if (!permanent) {
  5991.             for (i = 0; i < events.length; i++) {
  5992.                 a.h.removeEventListener(el, events[i], fireCallBack);
  5993.             }
  5994.         }
  5995.     }
  5996.  
  5997.     if (callback) {
  5998.         for (i = 0; i < events.length; i++) {
  5999.             a.h.addEventListener(el, events[i], fireCallBack);
  6000.         }
  6001.     }
  6002. }, getWrapperTranslate: function (axis) {
  6003.     var el = this.wrapper, matrix, curTransform, curStyle, transformMatrix;
  6004.     if (typeof axis == 'undefined') {
  6005.         axis = this.params.mode == 'horizontal' ? 'x' : 'y';
  6006.     }
  6007.     curStyle = window.getComputedStyle(el, null);
  6008.     if (window.WebKitCSSMatrix) {
  6009.         transformMatrix = new WebKitCSSMatrix(curStyle.webkitTransform);
  6010.     }
  6011.     else {
  6012.         transformMatrix =
  6013.                 curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform
  6014.                 || curStyle.getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,");
  6015.         matrix = transformMatrix.toString().split(',');
  6016.     }
  6017.     if (this.support.transforms && this.params.useCSS3Transforms) {
  6018.         if (axis == 'x') {
  6019.             if (window.WebKitCSSMatrix) {
  6020.                 curTransform = transformMatrix.m41;
  6021.             }
  6022.             else if (matrix.length == 16) {
  6023.                 curTransform = parseFloat(matrix[12]);
  6024.             }
  6025.             else {
  6026.                 curTransform = parseFloat(matrix[4]);
  6027.             }
  6028.         }
  6029.         if (axis == 'y') {
  6030.             if (window.WebKitCSSMatrix) {
  6031.                 curTransform = transformMatrix.m42;
  6032.             }
  6033.             else if (matrix.length == 16) {
  6034.                 curTransform = parseFloat(matrix[13]);
  6035.             }
  6036.             else {
  6037.                 curTransform = parseFloat(matrix[5]);
  6038.             }
  6039.         }
  6040.     }
  6041.     else {
  6042.         if (axis == 'x') {
  6043.             curTransform = parseFloat(el.style.left, 10) || 0;
  6044.         }
  6045.         if (axis == 'y') {
  6046.             curTransform = parseFloat(el.style.top, 10) || 0;
  6047.         }
  6048.     }
  6049.     return curTransform || 0;
  6050. }, setWrapperTranslate: function (x, y, z) {
  6051.     var es = this.wrapper.style, coords = {x: 0, y: 0, z: 0}, translate;
  6052.     if (arguments.length == 3) {
  6053.         coords.x = x;
  6054.         coords.y = y;
  6055.         coords.z = z;
  6056.     }
  6057.     else {
  6058.         if (typeof y == 'undefined') {
  6059.             y = this.params.mode == 'horizontal' ? 'x' : 'y';
  6060.         }
  6061.         coords[y] = x;
  6062.     }
  6063.     if (this.support.transforms && this.params.useCSS3Transforms) {
  6064.         translate =
  6065.                 this.support.transforms3d ? 'translate3d(' + coords.x + 'px, ' + coords.y + 'px, ' + coords.z + 'px)' :
  6066.                         'translate(' + coords.x + 'px, ' + coords.y + 'px)';
  6067.         es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = translate;
  6068.     }
  6069.     else {
  6070.         es.left = coords.x + 'px';
  6071.         es.top = coords.y + 'px';
  6072.     }
  6073.     this.callPlugins('onSetWrapperTransform', coords);
  6074. }, setWrapperTransition: function (duration) {
  6075.     var es = this.wrapper.style;
  6076.     es.webkitTransitionDuration =
  6077.             es.MsTransitionDuration =
  6078.                     es.msTransitionDuration = es.MozTransitionDuration = es.OTransitionDuration = es.transitionDuration = (duration / 1000) + 's';
  6079.     this.callPlugins('onSetWrapperTransition', {duration: duration});
  6080. }, h: {getWidth: function (el, outer) {
  6081.     var width = window.getComputedStyle(el, null).getPropertyValue('width')
  6082.     var returnWidth = parseFloat(width);
  6083.     if (isNaN(returnWidth) || width.indexOf('%') > 0) {
  6084.         returnWidth =
  6085.                 el.offsetWidth - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-left'))
  6086.                 - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-right'));
  6087.     }
  6088.     if (outer) {
  6089.         returnWidth +=
  6090.                 parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + parseFloat(window.getComputedStyle(el,
  6091.                 null).getPropertyValue('padding-right'))
  6092.     }
  6093.     return returnWidth;
  6094. }, getHeight: function (el, outer) {
  6095.     if (outer) {
  6096.         return el.offsetHeight;
  6097.     }
  6098.     var height = window.getComputedStyle(el, null).getPropertyValue('height')
  6099.     var returnHeight = parseFloat(height);
  6100.     if (isNaN(returnHeight) || height.indexOf('%') > 0) {
  6101.         returnHeight =
  6102.                 el.offsetHeight - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-top'))
  6103.                 - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-bottom'));
  6104.     }
  6105.     if (outer) {
  6106.         returnHeight +=
  6107.                 parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-top')) + parseFloat(window.getComputedStyle(el,
  6108.                 null).getPropertyValue('padding-bottom'))
  6109.     }
  6110.     return returnHeight;
  6111. }, getOffset: function (el) {
  6112.     var box = el.getBoundingClientRect();
  6113.     var body = document.body;
  6114.     var clientTop = el.clientTop || body.clientTop || 0;
  6115.     var clientLeft = el.clientLeft || body.clientLeft || 0;
  6116.     var scrollTop = window.pageYOffset || el.scrollTop;
  6117.     var scrollLeft = window.pageXOffset || el.scrollLeft;
  6118.     if (document.documentElement && !window.pageYOffset) {
  6119.         scrollTop = document.documentElement.scrollTop;
  6120.         scrollLeft = document.documentElement.scrollLeft;
  6121.     }
  6122.     return{top: box.top + scrollTop - clientTop, left: box.left + scrollLeft - clientLeft};
  6123. }, windowWidth: function () {
  6124.     if (window.innerWidth) {
  6125.         return window.innerWidth
  6126.     }
  6127.     else if (document.documentElement && document.documentElement.clientWidth) {
  6128.         return document.documentElement.clientWidth;
  6129.     }
  6130. }, windowHeight: function () {
  6131.     if (window.innerHeight) {
  6132.         return window.innerHeight
  6133.     }
  6134.     else if (document.documentElement && document.documentElement.clientHeight) {
  6135.         return document.documentElement.clientHeight;
  6136.     }
  6137. }, windowScroll: function () {
  6138.     var left = 0, top = 0;
  6139.     if (typeof pageYOffset != 'undefined') {
  6140.         return{left: window.pageXOffset, top: window.pageYOffset}
  6141.     }
  6142.     else if (document.documentElement) {
  6143.         return{left: document.documentElement.scrollLeft, top: document.documentElement.scrollTop}
  6144.     }
  6145. }, addEventListener: function (el, event, listener, useCapture) {
  6146.     if (typeof useCapture == 'undefined') {
  6147.         useCapture = false;
  6148.     }
  6149.     if (el.addEventListener) {
  6150.         el.addEventListener(event, listener, useCapture);
  6151.     }
  6152.     else if (el.attachEvent) {
  6153.         el.attachEvent('on' + event, listener);
  6154.     }
  6155. }, removeEventListener: function (el, event, listener, useCapture) {
  6156.     if (typeof useCapture == 'undefined') {
  6157.         useCapture = false;
  6158.     }
  6159.     if (el.removeEventListener) {
  6160.         el.removeEventListener(event, listener, useCapture);
  6161.     }
  6162.     else if (el.detachEvent) {
  6163.         el.detachEvent('on' + event, listener);
  6164.     }
  6165. }}, setTransform: function (el, transform) {
  6166.     var es = el.style
  6167.     es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = transform
  6168. }, setTranslate: function (el, translate) {
  6169.     var es = el.style
  6170.     var pos = {x: translate.x || 0, y: translate.y || 0, z: translate.z || 0};
  6171.     var transformString = this.support.transforms3d ? 'translate3d(' + (pos.x) + 'px,' + (pos.y) + 'px,' + (pos.z) + 'px)' :
  6172.             'translate(' + (pos.x) + 'px,' + (pos.y) + 'px)';
  6173.     es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = transformString;
  6174.     if (!this.support.transforms) {
  6175.         es.left = pos.x + 'px'
  6176.         es.top = pos.y + 'px'
  6177.     }
  6178. }, setTransition: function (el, duration) {
  6179.     var es = el.style
  6180.     es.webkitTransitionDuration =
  6181.             es.MsTransitionDuration =
  6182.                     es.msTransitionDuration = es.MozTransitionDuration = es.OTransitionDuration = es.transitionDuration = duration + 'ms';
  6183. }, support: {touch: (window.Modernizr && Modernizr.touch === true) || (function () {
  6184.     return!!(("ontouchstart"in window) || window.DocumentTouch && document instanceof DocumentTouch);
  6185. })(), transforms3d: (window.Modernizr && Modernizr.csstransforms3d === true) || (function () {
  6186.     var div = document.createElement('div').style;
  6187.     return("webkitPerspective"in div || "MozPerspective"in div || "OPerspective"in div || "MsPerspective"in div || "perspective"in div);
  6188. })(), transforms: (window.Modernizr && Modernizr.csstransforms === true) || (function () {
  6189.     var div = document.createElement('div').style;
  6190.     return('transform'in div || 'WebkitTransform'in div || 'MozTransform'in div || 'msTransform'in div || 'MsTransform'in div || 'OTransform'in div);
  6191. })(), transitions: (window.Modernizr && Modernizr.csstransitions === true) || (function () {
  6192.     var div = document.createElement('div').style;
  6193.     return('transition'in div || 'WebkitTransition'in div || 'MozTransition'in div || 'msTransition'in div || 'MsTransition'in div || 'OTransition'
  6194.             in div);
  6195. })()}, browser: {ie8: (function () {
  6196.     var rv = -1;
  6197.     if (navigator.appName == 'Microsoft Internet Explorer') {
  6198.         var ua = navigator.userAgent;
  6199.         var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
  6200.         if (re.exec(ua) != null) {
  6201.             rv = parseFloat(RegExp.$1);
  6202.         }
  6203.     }
  6204.     return rv != -1 && rv < 9;
  6205. })(), ie10: window.navigator.msPointerEnabled}}
  6206. if (window.jQuery || window.Zepto) {
  6207.     (function ($) {
  6208.         $.fn.swiper = function (params) {
  6209.             var s = new Swiper($(this)[0], params)
  6210.             $(this).data('swiper', s);
  6211.             return s;
  6212.         }
  6213.     })(window.jQuery || window.Zepto)
  6214. }
  6215. if (typeof(module) !== 'undefined') {
  6216.     module.exports = Swiper;
  6217. }
  6218. ;
  6219.  
  6220. (function ($) {
  6221.     $(document).on('focus', '.HIDEVALUE', function () {
  6222.         var $t = $(this);
  6223.         var classValue = $t.metadata().value || '';
  6224.         if (typeof($t.metadata().classDiv) != 'undefined') {
  6225.             var classDiv = '.' + $t.metadata().classDiv;
  6226.         }
  6227.         $.log(classValue);
  6228.         if ($t.val() == this.defaultValue && !classValue) {
  6229.             $t.val('');
  6230.             if (typeof(classDiv) != 'undefined') {
  6231.                 $classDiv.addClass('active');
  6232.             }
  6233.             else {
  6234.                 $t.addClass('active');
  6235.             }
  6236.         }
  6237.         else if ($t.val() == classValue) {
  6238.             $t.val('');
  6239.             if (typeof(classDiv) != 'undefined') {
  6240.                 $(classDiv).addClass('active');
  6241.             }
  6242.             else {
  6243.                 $t.addClass('active');
  6244.             }
  6245.         }
  6246.     });
  6247.     $(document).on('blur', '.HIDEVALUE', function () {
  6248.         var $t = $(this);
  6249.         if ($t.val() == "") {
  6250.             $t.val(this.defaultValue);
  6251.             if (typeof($t.metadata().classDiv) != 'undefined') {
  6252.                 var classDiv = '.' + $t.metadata().classDiv;
  6253.             }
  6254.             if (typeof(classDiv) != 'undefined') {
  6255.                 $(classDiv).removeClass('active');
  6256.             }
  6257.             else {
  6258.                 $t.removeClass('active');
  6259.             }
  6260.         }
  6261.     });
  6262. })(jQuery);
  6263. ;
  6264.  
  6265. var webtrekkConfig = {trackId: "797404159409395", trackDomain: "brille2401.webtrekk.net", domain: "www.brille24.de", cookie: "1", contentId: ""};
  6266. var webtrekkUnloadObjects = [];
  6267. var webtrekkLinktrackObjects = [];
  6268. var webtrekkHeatmapObjects = [];
  6269. function webtrekkV3($a) {
  6270.     var webtrekkUnload = function ($b, $c) {
  6271.         if ($d.cookie == "1" && !$d.optOut && !$d.deactivatePixel) {
  6272.             $d.firstParty();
  6273.         }
  6274.         ;
  6275.         var $e = ($c) ? $c : ($d.formObject && $b != "noForm") ? "form" : "link";
  6276.         if ($d.beforeUnloadPixel != false) {
  6277.             $d.beforeUnloadPixel();
  6278.         }
  6279.         else if ($e == "form") {
  6280.             $d.executePlugin($d.getPluginConfig("form", "before"));
  6281.         }
  6282.         ;
  6283.         var p = "";
  6284.         if ($d.config.linkId) {
  6285.             p += "&ct=" + $d.wtEscape($d.maxlen($d.config.linkId, 255));
  6286.             if (p) {
  6287.                 if ($d.linktrackOut) {
  6288.                     p += "&ctx=1";
  6289.                 }
  6290.                 ;
  6291.                 var $f = $d.ccParams;
  6292.                 if (typeof($f) == 'string' && $f != '') {
  6293.                     p += $f;
  6294.                 }
  6295.             }
  6296.         }
  6297.         ;
  6298.         if ($d.wtEp) {
  6299.             if ($d.wtEpEncoded) {
  6300.                 p += $d.wtEp;
  6301.             }
  6302.             else {
  6303.                 var $g = $d.wtEp;
  6304.                 if (typeof($g) == 'string' && $g != '') {
  6305.                     $g = $g.split(/;/);
  6306.                     for (var z = 0; z < $g.length; z++) {
  6307.                         if ($d.wtTypeof($g[z])) {
  6308.                             var $h = $g[z].split(/=/);
  6309.                             if ($d.checkSC('custom')) {
  6310.                                 $h[1] = $d.decrypt($h[1]);
  6311.                             }
  6312.                             ;
  6313.                             $h[1] = $d.wtEscape($h[1]);
  6314.                             p += '&' + $h[0] + '=' + $h[1];
  6315.                         }
  6316.                     }
  6317.                 }
  6318.             }
  6319.         }
  6320.         ;
  6321.         if ($d.formObject && $b != "noForm") {
  6322.             var gatherFormsP = $d.gatherForm();
  6323.             if (gatherFormsP) {
  6324.                 p += "&fn=" + ($d.formName ? $d.formName : $d.contentId.split(";")[0]) + '|' + ($d.formSubmit ? "1" : "0");
  6325.                 p += "&ft=" + $d.wtEscape(gatherFormsP);
  6326.             }
  6327.         }
  6328.         ;
  6329.         if (p != "") {
  6330.             if ($d.isChrome && $e != "click") {
  6331.                 $d.quicksend($d.wtEscape($d.contentId.split(";")[0]) + ",1," + $d.baseparams(), p, false, "saveRequest");
  6332.             }
  6333.             else {
  6334.                 $d.quicksend($d.wtEscape($d.contentId.split(";")[0]) + ",1," + $d.baseparams(), p, false, "sendRequest");
  6335.             }
  6336.             ;
  6337.             $d.config.linkId = "";
  6338.             $d.ccParams = "";
  6339.             $d.wtEp = "";
  6340.         }
  6341.         ;
  6342.         if ($d.afterUnloadPixel != false) {
  6343.             $d.afterUnloadPixel();
  6344.         }
  6345.         else if ($e == "form") {
  6346.             $d.executePlugin($d.getPluginConfig("form", "after"));
  6347.         }
  6348.     };
  6349.     var webtrekkLinktrack = function (e) {
  6350.         if ((e.which && e.which == 1) || (e.button && e.button == 1)) {
  6351.             var a = ((document.all && window.event !== null) ? window.event.srcElement : this);
  6352.             for (var i = 0; i < 4; i++) {
  6353.                 if (a.tagName && a.tagName.toLowerCase() != "a" && a.tagName.toLowerCase() != "area") {
  6354.                     a = a.parentElement;
  6355.                 }
  6356.             }
  6357.             ;
  6358.             $d.config = $d.getConfig(true);
  6359.             $d.config.customClickParameter = $d.customClickParameter;
  6360.             a.lname = $d.getAttribute(a, $d.linkTrackAttribute);
  6361.             a.lpos = 0;
  6362.             $d.getCCParams(a);
  6363.             if (!$d.wtLength(a.lpos) && a.tagName) {
  6364.                 var c = document.links;
  6365.                 for (var d = 0; d < $d.wtLength(c); d++) {
  6366.                     if (a == c[d]) {
  6367.                         a.lpos = d + 1;
  6368.                         break;
  6369.                     }
  6370.                 }
  6371.             }
  6372.             ;
  6373.             if (a.lpos) {
  6374.                 if ($d.getJSON(a.lname) != null) {
  6375.                     $d.parseJSON($d.getJSON(a.lname));
  6376.                     a.lname = $d.config.linkId;
  6377.                 }
  6378.                 ;
  6379.                 if ($d.linkTrack == "link") {
  6380.                     var y = a.href.indexOf("//");
  6381.                     y = (y >= 0 ? a.href.substr(y + 2) : a.href);
  6382.                     if ($d.linkTrackPattern) {
  6383.                         if (!$d.linkTrackReplace) {
  6384.                             $d.linkTrackReplace = "";
  6385.                         }
  6386.                         ;
  6387.                         y = y.replace($d.linkTrackPattern, $d.linkTrackReplace);
  6388.                     }
  6389.                     ;
  6390.                     $d.config.linkId = (a.lname ? (a.lname + ".") : "") + y.split("?")[0].replace(/\//g, ".");
  6391.                     var p = "";
  6392.                     if ($d.linkTrackParams) {
  6393.                         p = $d.linkTrackParams.replace(/;/g, ",").split(",");
  6394.                     }
  6395.                     ;
  6396.                     for (var i = 0; i < p.length; i++) {
  6397.                         var v = $d.urlParam(y, p[i], "");
  6398.                         if (v) {
  6399.                             $d.config.linkId += "." + p[i] + "." + v;
  6400.                         }
  6401.                     }
  6402.                 }
  6403.                 else if ($d.linkTrack == "standard" && a.lname) {
  6404.                     $d.config.linkId = a.lname;
  6405.                 }
  6406.                 ;
  6407.                 var $i = false;
  6408.                 if ($d.linkTrackDownloads) {
  6409.                     var $j = a.href.split(".");
  6410.                     $j = $j.pop();
  6411.                     var $k = $d.linkTrackDownloads.split(";");
  6412.                     for (i = 0; i < $k.length; i++) {
  6413.                         if ($k[i] == $j) {
  6414.                             $i = true;
  6415.                             break;
  6416.                         }
  6417.                     }
  6418.                 }
  6419.                 ;
  6420.                 if ($d.config.linkId) {
  6421.                     if ($d.domain && !$d.isOwnDomain(a.href)) {
  6422.                         $d.linktrackOut = true;
  6423.                     }
  6424.                 }
  6425.                 ;
  6426.                 if ($i || ($d.config.linkId && a.target != "" && a.target != "_self")) {
  6427.                     $d.sendinfo($d.config, $d.config.linkId, "click");
  6428.                 }
  6429.                 else {
  6430.                     $d.sendinfo($d.config, $d.config.linkId, "link");
  6431.                 }
  6432.             }
  6433.         }
  6434.     };
  6435.     var webtrekkHeatmapClick = function (e) {
  6436.         var $l = document.getElementById($d.heatmapRefpoint), $m;
  6437.         if ($l && $l !== null) {
  6438.             $m = {left: 0, top: 0};
  6439.         }
  6440.         else {
  6441.             $m = {left: -1, top: -1};
  6442.         }
  6443.         ;
  6444.         if ($l && $l !== null) {
  6445.             if ($d.wtTypeof($l.offsetLeft)) {
  6446.                 while ($l) {
  6447.                     $m.left += (($l.offsetLeft >= 0) ? $l.offsetLeft : 0);
  6448.                     $m.top += (($l.offsetTop >= 0) ? $l.offsetTop : 0);
  6449.                     $l = $l.offsetParent;
  6450.                 }
  6451.             }
  6452.         }
  6453.         ;
  6454.         var $n = 0;
  6455.         var $o = 0;
  6456.         if (!e) {
  6457.             var e = window.event;
  6458.         }
  6459.         ;
  6460.         if (e.pageX || e.pageY) {
  6461.             $n = e.pageX;
  6462.             $o = e.pageY;
  6463.         }
  6464.         else {
  6465.             if (e.clientX || e.clientY) {
  6466.                 $n = e.clientX;
  6467.                 $o = e.clientY;
  6468.                 if ($d.isIE) {
  6469.                     if (document.body.scrollLeft > 0 || document.body.scrollTop > 0) {
  6470.                         $n += document.body.scrollLeft;
  6471.                         $o += document.body.scrollTop;
  6472.                     }
  6473.                     else {
  6474.                         if (document.documentElement.scrollLeft > 0 || document.documentElement.scrollTop > 0) {
  6475.                             $n += document.documentElement.scrollLeft;
  6476.                             $o += document.documentElement.scrollTop;
  6477.                         }
  6478.                     }
  6479.                 }
  6480.             }
  6481.         }
  6482.         ;
  6483.         var $p = 0;
  6484.         if ($d.isIE) {
  6485.             $p = document.body.clientWidth;
  6486.         }
  6487.         else {
  6488.             $p = self.innerWidth - 16;
  6489.         }
  6490.         ;
  6491.         var $q = true;
  6492.         if ($n >= $p || !$d.sentFullPixel) {
  6493.             $q = false;
  6494.         }
  6495.         ;
  6496.         if (($m.top >= 0 || $m.left >= 0) && $n > $m.left && $o > $m.top) {
  6497.             $n = '-' + ($n - $m.left);
  6498.             $o = '-' + ($o - $m.top);
  6499.         }
  6500.         ;
  6501.         if ($q && $d.heatmap == "1") {
  6502.             $d.executePlugin($d.getPluginConfig("heatmap", "before"));
  6503.             $d.quicksend($d.wtEscape($d.contentId.split(";")[0]) + "," + $n + "," + $o, '', "hm", "sendRequest");
  6504.             $d.executePlugin($d.getPluginConfig("heatmap", "after"));
  6505.         }
  6506.     };
  6507.     var webtrekkStartHeatmap = function () {
  6508.         if (typeof(wt_heatmap) != "undefined") {
  6509.             window.setTimeout("wt_heatmap()", 1000);
  6510.         }
  6511.         else {
  6512.             if (typeof($r) == "undefined") {
  6513.                 $r = 0;
  6514.             }
  6515.             ;
  6516.             $r++;
  6517.             if ($r < 60) {
  6518.                 window.setTimeout(function () {
  6519.                     webtrekkStartHeatmap();
  6520.                 }, 1000);
  6521.             }
  6522.         }
  6523.     };
  6524.     var webtrekkStartOverlay = function () {
  6525.         if (typeof(wt_overlay) != "undefined") {
  6526.             wt_overlay();
  6527.         }
  6528.         else {
  6529.             if (typeof($s) == "undefined") {
  6530.                 $s = 0;
  6531.             }
  6532.             ;
  6533.             $s++;
  6534.             if ($s < 60) {
  6535.                 window.setTimeout(function () {
  6536.                     webtrekkStartOverlay();
  6537.                 }, 1000);
  6538.             }
  6539.         }
  6540.     };
  6541.     var webtrekkFormTrackInstall = function () {
  6542.         $d.findForm();
  6543.         if (!$d.formObject) {
  6544.             return;
  6545.         }
  6546.         ;
  6547.         for (var j = 0; j < $d.formObject.elements.length; j++) {
  6548.             var e = $d.formObject.elements[j];
  6549.             $d.registerEvent(e, "focus", webtrekkFormFocus);
  6550.         }
  6551.         ;
  6552.         $d.registerEvent($d.formObject, "submit", webtrekkFormSubmit);
  6553.         $d.registerEvent(window, (($d.wtTypeof(window.onbeforeunload)) ? "beforeunload" : "unload"), webtrekkUnload);
  6554.     };
  6555.     var webtrekkFormSubmit = function (e) {
  6556.         if (!$d.form) {
  6557.             return;
  6558.         }
  6559.         ;
  6560.         if (e.target == $d.formObject || e.srcElement == $d.formObject) {
  6561.             $d.formSubmit = true;
  6562.         }
  6563.     };
  6564.     var webtrekkFormFocus = function (e) {
  6565.         var a = ((document.all && window.event !== null) ? window.event.srcElement : e.target);
  6566.         if (!a.name || a.type == "submit" || a.type == "image") {
  6567.             return;
  6568.         }
  6569.         ;
  6570.         if ($d.formObject) {
  6571.             $d.formFocus = a.name;
  6572.         }
  6573.     };
  6574.     var c = webtrekkConfig, $d = this;
  6575.     if (!$a) {
  6576.         var $a = c;
  6577.     }
  6578.     ;
  6579.     this.defaultAttribute =
  6580.             ["contentId",
  6581.                 "linkId",
  6582.                 "trackId",
  6583.                 "trackDomain",
  6584.                 "domain",
  6585.                 "linkTrack",
  6586.                 "linkTrackParams",
  6587.                 "linkTrackPattern",
  6588.                 "linkTrackReplace",
  6589.                 "linkTrackDownloads",
  6590.                 "linkTrackIgnorePattern",
  6591.                 "customParameter",
  6592.                 "crmCategory",
  6593.                 "customClickParameter",
  6594.                 "customSessionParameter",
  6595.                 "customTimeParameter",
  6596.                 "customCampaignParameter",
  6597.                 "customEcommerceParameter",
  6598.                 "orderValue",
  6599.                 "currency",
  6600.                 "orderId",
  6601.                 "product",
  6602.                 "productCost",
  6603.                 "productQuantity",
  6604.                 "productCategory",
  6605.                 "productStatus",
  6606.                 "customerId",
  6607.                 "crmCategory",
  6608.                 "contentGroup",
  6609.                 "mediaCode",
  6610.                 "mediaCodeValue",
  6611.                 "mediaCodeCookie",
  6612.                 "campaignId",
  6613.                 "campaignAction",
  6614.                 "internalSearch",
  6615.                 "customSid",
  6616.                 "customEid",
  6617.                 "cookieDomain",
  6618.                 "cookieEidTimeout",
  6619.                 "cookieSidTimeout",
  6620.                 "forceNewSession",
  6621.                 "xwtip",
  6622.                 "xwtua",
  6623.                 "xwtrq",
  6624.                 "mediaCodeFrames",
  6625.                 "framesetReferrer",
  6626.                 "forceHTTPS",
  6627.                 "secureConfig",
  6628.                 "heatmap",
  6629.                 "pixelSampling",
  6630.                 "form",
  6631.                 "formFullContent",
  6632.                 "formAnonymous",
  6633.                 "disableOverlayView",
  6634.                 "beforeSendinfoPixel",
  6635.                 "afterSendinfoPixel",
  6636.                 "beforeUnloadPixel",
  6637.                 "afterUnloadPixel",
  6638.                 "executePluginFunction",
  6639.                 "sendOnUnload",
  6640.                 "xlc",
  6641.                 "xlct",
  6642.                 "xlcv",
  6643.                 "ignorePrerendering"];
  6644.     this.cookie = ($a.cookie) ? $a.cookie : (c.cookie) ? c.cookie : "3";
  6645.     this.optoutName = ($a.optoutName) ? $a.optoutName : (c.optoutName) ? c.optoutName : "webtrekkOptOut";
  6646.     this.paramFirst = ($a.paramFirst) ? $a.paramFirst : (c.paramFirst) ? c.paramFirst : "";
  6647.     this.plugins =
  6648.             ($a.plugins && $a.plugins != '') ? $a.plugins : (c.plugins && c.plugins != '') ? c.plugins :
  6649.                     ['Adobe Acrobat', 'Windows Media Player', 'Shockwave Flash', 'RealPlayer', 'QuickTime', 'Java', 'Silverlight'];
  6650.     if (typeof(this.plugins) == "string") {
  6651.         this.plugins = this.plugins.split(";");
  6652.     }
  6653.     ;
  6654.     this.heatmapRefpoint = ($a.heatmapRefpoint) ? $a.heatmapRefpoint : (c.heatmapRefpoint) ? c.heatmapRefpoint : "wt_refpoint";
  6655.     this.linkTrackAttribute = ($a.linkTrackAttribute) ? $a.linkTrackAttribute : (c.linkTrackAttribute) ? c.linkTrackAttribute : "name";
  6656.     this.formAttribute = ($a.formAttribute) ? $a.formAttribute : (c.formAttribute) ? c.formAttribute : "name";
  6657.     this.formFieldAttribute = ($a.formFieldAttribute) ? $a.formFieldAttribute : (c.formFieldAttribute) ? c.formFieldAttribute : "name";
  6658.     this.formValueAttribute = ($a.formValueAttribute) ? $a.formValueAttribute : (c.formValueAttribute) ? c.formValueAttribute : "value";
  6659.     this.reporturl = ($a.reporturl) ? $a.reporturl : (c.reporturl) ? c.reporturl : 'report2.webtrekk.de/cgi-bin/wt';
  6660.     this.updateCookie = ($a.updateCookie) ? $a.updateCookie : (c.updateCookie) ? c.updateCookie : true;
  6661.     this.version = 323;
  6662.     this.deactivatePixel = false;
  6663.     this.deactivateRequest = false;
  6664.     this.optOut = false;
  6665.     this.eid = false;
  6666.     this.firstVisitContact = false;
  6667.     this.lastVisitContact = false;
  6668.     this.sampleCookieString = false;
  6669.     this.cookieOne = false;
  6670.     this.linktrackOut = false;
  6671.     this.linktrackNamedlinksOnly = true;
  6672.     this.ccParams = false;
  6673.     this.sentFullPixel = false;
  6674.     this.sentCampaignIds = {};
  6675.     this.wtEp = false;
  6676.     this.wtEpEncoded = false;
  6677.     this.trackingSwitchMediaCode = false;
  6678.     this.trackingSwitchMediaCodeValue = false;
  6679.     this.trackingSwitchMediaCodeTimestamp = false;
  6680.     this.heatmapOn = false;
  6681.     this.overlayOn = false;
  6682.     this.gatherFormsP = false;
  6683.     this.formObject = false;
  6684.     this.formName = false;
  6685.     this.formFocus = false;
  6686.     this.formSubmit = false;
  6687.     this.browserLang = false;
  6688.     this.config = false;
  6689.     this.unloadInstance = webtrekkUnloadObjects.length;
  6690.     this.plugin = {};
  6691.     this.pageCounter = 0;
  6692.     this.clickCounter = 0;
  6693.     this.linkCounter = 0;
  6694.     this.formCounter = 0;
  6695.     this.heatmapCounter = 0;
  6696.     this.browserLang = false;
  6697.     if (typeof(navigator.language) == "string") {
  6698.         this.browserLang = navigator.language.substring(0, 2);
  6699.     }
  6700.     else if (typeof(navigator.userLanguage) == "string") {
  6701.         this.browserLang = navigator.userLanguage.substring(0, 2);
  6702.     }
  6703.     ;
  6704.     this.jsonPara =
  6705.     {"ck": ["customClickParameter", {}], "cp": ["customParameter", {}], "cs": ["customSessionParameter", {}], "ce": ["customTimeParameter",
  6706.         {}], "cb": ["customEcommerceParameter", {}], "vc": ["crmCategory", {}], "ca": ["productCategory", {}], "cc": ["customCampaignParameter",
  6707.         {}], "cg": ["contentGroup", {}], "ct": ["linkId", ""], "ov": ["orderValue", ""], "cr": ["currency", ""], "oi": ["orderId",
  6708.         ""], "ba": ["product", ""], "co": ["productCost", ""], "qn": ["productQuantity", ""], "st": ["productStatus", ""], "cd": ["customerId",
  6709.         ""], "is": ["internalSearch", ""], "mc": ["campaignId", ""], "mca": ["campaignAction", ""], "sou": ["sendOnUnload", false]};
  6710.     this.generateDefaultConfig = function ($t, $u) {
  6711.         for (var i = 0; i < this.defaultAttribute.length; i++) {
  6712.             var a = this.defaultAttribute[i];
  6713.             this[a] = ($t[a]) ? $t[a] : ($u[a]) ? $u[a] : false;
  6714.         }
  6715.     };
  6716.     this.generateDefaultConfig($a, c);
  6717.     this.campaignAction = ($a.campaignAction) ? $a.campaignAction : (c.campaignAction) ? c.campaignAction : "click";
  6718.     this.getJSON = function (s) {
  6719.         if (s && s.charAt(0) == "{" && s.charAt(s.length - 1) == "}") {
  6720.             try {
  6721.                 return eval("(" + s + ")");
  6722.             }
  6723.             catch (e) {
  6724.                 return null;
  6725.             }
  6726.         }
  6727.         ;
  6728.         return null;
  6729.     };
  6730.     this.parseJSON = function (o, n) {
  6731.         for (var $v in o) {
  6732.             if (typeof(o[$v]) == "object") {
  6733.                 if (typeof(this.jsonPara[$v]) != "undefined" && typeof(this.config[this.jsonPara[$v][0]]) != "object") {
  6734.                     this.config[this.jsonPara[$v][0]] = this.jsonPara[$v][1];
  6735.                 }
  6736.                 ;
  6737.                 this.parseJSON(o[$v], $v);
  6738.                 continue;
  6739.             }
  6740.             ;
  6741.             if (n) {
  6742.                 if (isNaN(parseInt($v)) || parseInt($v) < 500) {
  6743.                     this.config[this.jsonPara[n][0]][$v] = o[$v];
  6744.                 }
  6745.             }
  6746.             else {
  6747.                 if (typeof(this.jsonPara[$v]) != "undefined") {
  6748.                     this.config[this.jsonPara[$v][0]] = o[$v];
  6749.                 }
  6750.             }
  6751.         }
  6752.     };
  6753.     this.getMappingParam = function (np) {
  6754.         var p = np.split(""), i, $w, $x, $y;
  6755.         for (i = 0; i < p.length; i++) {
  6756.             if (!isNaN(parseInt(p[i]))) {
  6757.                 $w = i;
  6758.                 break;
  6759.             }
  6760.         }
  6761.         ;
  6762.         if ($w) {
  6763.             $x = np.substr(0, $w);
  6764.             $y = np.substr($w, np.length - 1);
  6765.         }
  6766.         else {
  6767.             $x = np;
  6768.         }
  6769.         ;
  6770.         return{"mapping": ((typeof(this.jsonPara[$x]) != "undefined") ? this.jsonPara[$x][0] : false), "index": (($y) ? $y : false)};
  6771.     };
  6772.     this.getConfig = function (d) {
  6773.         var c = {};
  6774.         for (var i = 0; i < this.defaultAttribute.length; i++) {
  6775.             var a = this.defaultAttribute[i];
  6776.             c[a] = ((d) ? false : this[a]);
  6777.         }
  6778.         ;
  6779.         return c;
  6780.     };
  6781.     this.getRequestCounter = function ($c, $z) {
  6782.         var c = 0;
  6783.         if ($z == "before") {
  6784.             c++;
  6785.         }
  6786.         ;
  6787.         if ($c == "link") {
  6788.             this.linkCounter += c;
  6789.             return this.linkCounter;
  6790.         }
  6791.         else if ($c == "click") {
  6792.             this.clickCounter += c;
  6793.             return this.clickCounter;
  6794.         }
  6795.         else if ($c == "page") {
  6796.             this.pageCounter += c;
  6797.             return this.pageCounter;
  6798.         }
  6799.         else if ($c == "heatmap") {
  6800.             this.heatmapCounter += c;
  6801.             return this.heatmapCounter;
  6802.         }
  6803.         else if ($c == "form") {
  6804.             this.formCounter += c;
  6805.             return this.formCounter;
  6806.         }
  6807.     };
  6808.     this.getPluginConfig = function ($c, $z) {
  6809.         return{"instance": this, "mode": $c, "type": $z, "requestCounter": this.getRequestCounter($c, $z)};
  6810.     };
  6811.     this.checkAsynchron = function ($A, $B, $C, $D) {
  6812.         if (typeof(window[$A]) != "undefined") {
  6813.             if ($B) {
  6814.                 $B(true, $C);
  6815.             }
  6816.             ;
  6817.             return;
  6818.         }
  6819.         else if ($D <= 0) {
  6820.             if ($B) {
  6821.                 $B(false, $C);
  6822.             }
  6823.             ;
  6824.             return;
  6825.         }
  6826.         ;
  6827.         window.setTimeout(function () {
  6828.             $C.checkAsynchron($A, $B, $C, ($D - 100));
  6829.         }, 100);
  6830.     };
  6831.     this.loadAsynchron = function ($E, $A, $B, $D) {
  6832.         if (this.include($E)) {
  6833.             $B = ($B) ? $B : false;
  6834.             $D = ($D) ? $D : 2000;
  6835.             this.checkAsynchron($A, $B, this, $D);
  6836.         }
  6837.     };
  6838.     this.include = function (s) {
  6839.         if (!document.createElement) {
  6840.             return false;
  6841.         }
  6842.         ;
  6843.         var $F = document.getElementsByTagName('head').item(0);
  6844.         var js = document.createElement('script');
  6845.         js.setAttribute('language', 'javascript');
  6846.         js.setAttribute('type', 'text/javascript');
  6847.         js.setAttribute('src', s);
  6848.         $F.appendChild(js);
  6849.         return true;
  6850.     };
  6851.     this.executePlugin = function ($G) {
  6852.         if (!this.executePluginFunction || typeof(this.executePluginFunction) != "string") {
  6853.             return;
  6854.         }
  6855.         ;
  6856.         this.epf = false;
  6857.         var $H = this.executePluginFunction.split(";");
  6858.         for (var z = 0; z < $H.length; z++) {
  6859.             if (typeof(window[$H[z]]) == "function") {
  6860.                 this.epf = window[$H[z]];
  6861.                 this.epf($G);
  6862.             }
  6863.         }
  6864.     };
  6865.     this.indexOf = function (a, b, c) {
  6866.         return a.indexOf(b, c ? c : 0);
  6867.     };
  6868.     this.wtTypeof = function (v) {
  6869.         return((typeof(v) != "undefined") ? 1 : 0);
  6870.     };
  6871.     this.wtLength = function (a) {
  6872.         return((a != "undefined") ? a.length : 0);
  6873.     };
  6874.     this.getAttribute = function (o, a) {
  6875.         if (typeof(o.getAttribute(a)) == "string") {
  6876.             return o.getAttribute(a);
  6877.         }
  6878.         ;
  6879.         if (typeof(o.getAttribute(a)) == "object" && typeof(o.attributes[a]) == "object") {
  6880.             if (o.attributes[a] != null) {
  6881.                 return o.attributes[a].nodeValue;
  6882.             }
  6883.         }
  6884.         ;
  6885.         return"";
  6886.     };
  6887.     this.getTimezone = function () {
  6888.         return Math.round((new Date().getTimezoneOffset() / 60) * (-1));
  6889.     };
  6890.     this.wtHref = function () {
  6891.         return this.wtLocation().href;
  6892.     };
  6893.     this.wtLocation = function () {
  6894.         var $I = document.location;
  6895.         if (!document.layers && document.getElementById) {
  6896.             try {
  6897.                 $I = top.document.location;
  6898.             }
  6899.             catch (e) {
  6900.                 $I = document.location;
  6901.             }
  6902.         }
  6903.         else {
  6904.             $I = top.document.location;
  6905.         }
  6906.         ;
  6907.         return $I;
  6908.     };
  6909.     this.getWebtrekkPath = function () {
  6910.         if (!document.layers && document.getElementById) {
  6911.             var $J = document.getElementsByTagName('script');
  6912.             for (var i = 0; i < $J.length; i++) {
  6913.                 if ($J[i].src.match(/webtrekk[a-z|A-Z|0-9|_]*\.js/g)) {
  6914.                     return $J[i].src.replace(/webtrekk[a-z|A-Z|0-9|_]*\.js/g, '');
  6915.                 }
  6916.             }
  6917.         }
  6918.         ;
  6919.         return'';
  6920.     };
  6921.     this.isIE = this.indexOf(navigator.appName, "Microsoft") ? false : true;
  6922.     if (!this.isIE) {
  6923.         this.isOpera = this.indexOf(navigator.appName, "Opera") ? false : true;
  6924.         if (!this.isOpera) {
  6925.             this.isSafari = (navigator.vendor.toLowerCase().indexOf("apple") != -1) ? true : false;
  6926.             this.isChrome = (navigator.vendor.toLowerCase().indexOf("google") != -1) ? true : false;
  6927.         }
  6928.     }
  6929.     ;
  6930.     this.url2contentId = function ($I) {
  6931.         if (!$I) {
  6932.             return"no_content";
  6933.         }
  6934.         ;
  6935.         var tmp = new RegExp("//(.*)").exec($I);
  6936.         if (tmp.length < 1) {
  6937.             return"no_content";
  6938.         }
  6939.         ;
  6940.         var $K = tmp[1].split("?")[0].replace(/\./g, "_").replace(/\//g, ".").replace(/\.{2,}/g, ".").toLowerCase();
  6941.         return $K.split(";")[0];
  6942.     };
  6943.     this.contentId = ($a.contentId) ? $a.contentId : this.url2contentId(document.location.href);
  6944.     this.registerEvent = function ($L, e, f) {
  6945.         if ($L.addEventListener) {
  6946.             if (e == "webkitvisibilitychange") {
  6947.                 this.unregisterEvent($L, e, f);
  6948.             }
  6949.             ;
  6950.             $L.addEventListener(e, f, false);
  6951.         }
  6952.         else {
  6953.             if ($L.attachEvent) {
  6954.                 if (e == "beforeunload" || e == "webkitvisibilitychange") {
  6955.                     this.unregisterEvent($L, e, f);
  6956.                 }
  6957.                 ;
  6958.                 $L.attachEvent("on" + e, f);
  6959.             }
  6960.         }
  6961.     };
  6962.     this.unregisterEvent = function ($L, e, f) {
  6963.         if ($L.removeEventListener) {
  6964.             $L.removeEventListener(e, f, false);
  6965.         }
  6966.         else {
  6967.             if ($L.detachEvent) {
  6968.                 $L.detachEvent("on" + e, f);
  6969.             }
  6970.         }
  6971.     };
  6972.     this.maxlen = function (v, l) {
  6973.         if (v && v.length > l) {
  6974.             return v.substring(0, l - 1);
  6975.         }
  6976.         ;
  6977.         return v;
  6978.     };
  6979.     this.wtEscape = function (u) {
  6980.         try {
  6981.             return encodeURIComponent(u);
  6982.         }
  6983.         catch (e) {
  6984.             return escape(u);
  6985.         }
  6986.     };
  6987.     this.wtUnescape = function (u) {
  6988.         try {
  6989.             return decodeURIComponent(u);
  6990.         }
  6991.         catch (e) {
  6992.             return unescape(u);
  6993.         }
  6994.     };
  6995.     this.decrypt = function (x) {
  6996.         var $M = "";
  6997.         if (x) {
  6998.             try {
  6999.                 $M = this.wtUnescape(x.replace(/([0-9a-fA-F][0-9a-fA-F])/g, '%$1'));
  7000.             }
  7001.             catch (e) {
  7002.             }
  7003.             ;
  7004.         }
  7005.         ;
  7006.         return $M;
  7007.     };
  7008.     this.checkSC = function (x) {
  7009.         if (typeof(this.secureConfig) != 'string') {
  7010.             return false;
  7011.         }
  7012.         ;
  7013.         var sc = this.secureConfig.split(';');
  7014.         for (var i = 0; i < sc.length; i++) {
  7015.             if (sc[i] == x) {
  7016.                 return true;
  7017.             }
  7018.         }
  7019.         ;
  7020.         return false;
  7021.     };
  7022.     this.zeroPad = function (n, $N) {
  7023.         var $O = "000000000000" + n;
  7024.         return $O.substring(($O.length - $N), $O.length);
  7025.     };
  7026.     this.generateEid = function () {
  7027.         return'2' + this.zeroPad(Math.floor(new Date().getTime() / 1000), 10) + this.zeroPad(Math.floor(Math.random() * 1000000), 8);
  7028.     };
  7029.     this.getexpirydate = function ($P) {
  7030.         var $Q;
  7031.         var $R = new Date();
  7032.         var $S = Date.parse($R);
  7033.         $R.setTime($S + $P * 60 * 1000);
  7034.         $Q = $R.toUTCString();
  7035.         return $Q;
  7036.     };
  7037.     this.setCookie = function (name, $T, $U) {
  7038.         var d = location.hostname;
  7039.         var $V = "^[0-9]{1,3" + String.fromCharCode(125) + "\.[0-9]{1,3" + String.fromCharCode(125) + "\.[0-9]{1,3" + String.fromCharCode(125)
  7040.                 + "\.[0-9]{1,3" + String.fromCharCode(125) + "$";
  7041.         if (d.search($V) == -1) {
  7042.             d = location.hostname.split(".");
  7043.             d = d[d.length - 2] + "." + d[d.length - 1];
  7044.         }
  7045.         ;
  7046.         var c, f = false;
  7047.         if (this.cookieDomain) {
  7048.             var cd = this.cookieDomain.split(";");
  7049.             for (var i = 0; i < cd.length; i++) {
  7050.                 if (location.hostname.indexOf(cd[i]) != -1) {
  7051.                     d = cd[i];
  7052.                     f = true;
  7053.                     break;
  7054.                 }
  7055.             }
  7056.         }
  7057.         ;
  7058.         if (f && typeof($U) != "undefined" && $U) {
  7059.             c = name + "=" + escape($T) + ";domain=" + d + ";path=/;expires=" + this.getexpirydate($U);
  7060.         }
  7061.         else if (f) {
  7062.             c = name + "=" + escape($T) + ";path=/;domain=" + d;
  7063.         }
  7064.         else if (d.split('.')[0].length < 3 && typeof($U) != "undefined" && $U) {
  7065.             c = name + "=" + escape($T) + ";path=/;expires=" + this.getexpirydate($U);
  7066.         }
  7067.         else if (d.split('.')[0].length < 3) {
  7068.             c = name + "=" + escape($T) + ";path=/";
  7069.         }
  7070.         else if (typeof($U) != "undefined" && $U) {
  7071.             c = name + "=" + escape($T) + ";domain=" + d + ";path=/;expires=" + this.getexpirydate($U);
  7072.         }
  7073.         else {
  7074.             c = name + "=" + escape($T) + ";path=/;domain=" + d;
  7075.         }
  7076.         ;
  7077.         document.cookie = c;
  7078.     };
  7079.     this.getCookie = function ($W) {
  7080.         var $X = document.cookie.split(";");
  7081.         for (var i = 0; i < $X.length; i++) {
  7082.             var $Y = $X[i].substr(0, $X[i].indexOf("="));
  7083.             var $Z = $X[i].substr($X[i].indexOf("=") + 1);
  7084.             $Y = $Y.replace(/^\s+|\s+$/g, "");
  7085.             if ($Y == $W) {
  7086.                 return unescape($Z);
  7087.             }
  7088.         }
  7089.         ;
  7090.         return"";
  7091.     };
  7092.     this.optOut = (this.getCookie(this.optoutName)) ? true : false;
  7093.     if (this.optOut) {
  7094.         this.deactivatePixel = true;
  7095.     }
  7096.     ;
  7097.     this.urlParam = function ($I, $00, $01) {
  7098.         if (!$I || $I == null) {
  7099.             return $01;
  7100.         }
  7101.         ;
  7102.         var p = new Array();
  7103.         if ($I.indexOf("?") > 0) {
  7104.             p = $I.split("?")[1].replace(/&amp;/g, "&").split("#")[0].split("&");
  7105.         }
  7106.         ;
  7107.         for (var i = 0; i < p.length; i++) {
  7108.             if (p[i].indexOf($00 + "=") == 0) {
  7109.                 return this.wtUnescape(p[i].substring($00.length + 1).replace(/\+/g, "%20"));
  7110.             }
  7111.         }
  7112.         ;
  7113.         return $01;
  7114.     };
  7115.     this.allUrlParam = function ($00, $01) {
  7116.         if (this.mediaCodeFrames && this.mediaCodeFrames != '') {
  7117.             var lf = this.mediaCodeFrames.split(";");
  7118.             for (var i = 0; i < lf.length; i++) {
  7119.                 var $02 = false;
  7120.                 eval("try { lFrame = eval(lf[i]) }catch(e){};");
  7121.                 if ($02 && $02 != top && $02.location) {
  7122.                     var $03 = this.urlParam($02.location.href, $00, $01);
  7123.                     if ($03 != $01) {
  7124.                         return $03;
  7125.                     }
  7126.                 }
  7127.             }
  7128.             ;
  7129.             return $01;
  7130.         }
  7131.         else {
  7132.             var topLocation = "";
  7133.             try {
  7134.                 topLocation = top.location.href;
  7135.             }
  7136.             catch (e) {
  7137.                 topLocation = document.location.href;
  7138.             }
  7139.             ;
  7140.             return this.urlParam(topLocation, $00, $01);
  7141.         }
  7142.     };
  7143.     this.linkTrackInit = function () {
  7144.         var $04 = false;
  7145.         for (var i = 0; i < webtrekkLinktrackObjects.length; i++) {
  7146.             if (this == webtrekkLinktrackObjects[i]) {
  7147.                 $04 = true;
  7148.             }
  7149.         }
  7150.         ;
  7151.         if (!$04) {
  7152.             webtrekkLinktrackObjects.push(this);
  7153.         }
  7154.         ;
  7155.         if (this.linkTrack && this.linkTrack == "link") {
  7156.             this.linktrackNamedlinksOnly = false;
  7157.         }
  7158.         ;
  7159.         for (var c = 0; c < document.links.length; c++) {
  7160.             var name = this.getAttribute(document.links[c], this.linkTrackAttribute);
  7161.             var $05 = this.getAttribute(document.links[c], "href");
  7162.             if ((this.linkTrackIgnorePattern && $05.search(this.linkTrackIgnorePattern) == -1) || !this.linkTrackIgnorePattern) {
  7163.                 if ((name || !this.linktrackNamedlinksOnly) && typeof(document.links[c].wt_marked) == "undefined") {
  7164.                     document.links[c].wt_marked = true;
  7165.                     this.registerEvent(document.links[c], 'mousedown', webtrekkLinktrack);
  7166.                 }
  7167.             }
  7168.         }
  7169.     };
  7170.     if (this.linkTrack) {
  7171.         this.linkTrackInit();
  7172.     }
  7173.     ;
  7174.     this.getCCParams = function (a) {
  7175.         var p = '';
  7176.         if (this.config.customClickParameter) {
  7177.             var $06 = (this.config.customClickParameter[this.getAttribute(a, "name")]) ?
  7178.                     this.config.customClickParameter[this.getAttribute(a, "name")] : this.config.customClickParameter[a.id];
  7179.             if (!$06) {
  7180.                 $06 = this.config.customClickParameter;
  7181.             }
  7182.             ;
  7183.             for (var z in $06) {
  7184.                 if (!isNaN(z) && this.wtTypeof($06[z]) && typeof($06[z]) == 'string' && $06[z] != '') {
  7185.                     if (this.checkSC('custom')) {
  7186.                         $06[z] = this.decrypt($06[z]);
  7187.                     }
  7188.                     ;
  7189.                     p += '&ck' + z + '=' + this.wtEscape($06[z]);
  7190.                 }
  7191.             }
  7192.         }
  7193.         ;
  7194.         this.ccParams = p;
  7195.         return;
  7196.     };
  7197.     this.plugInArray = function ($07, $08) {
  7198.         if (typeof($07) != 'object') {
  7199.             return false;
  7200.         }
  7201.         ;
  7202.         for (var i = 0; i < $07.length; i++) {
  7203.             var $09 = new RegExp($07[i].toLowerCase(), 'g');
  7204.             if ($08.toLowerCase().search($09) != -1) {
  7205.                 return $07[i];
  7206.             }
  7207.         }
  7208.         ;
  7209.         return false;
  7210.     };
  7211.     this.quicksend = function ($0a, $0b, $0c, $0d) {
  7212.         if (!this.trackDomain || !this.trackId || this.deactivatePixel || this.deactivateRequest) {
  7213.             this.deactivateRequest = false;
  7214.             return;
  7215.         }
  7216.         ;
  7217.         if (!$0c) {
  7218.             $0c = "wt";
  7219.         }
  7220.         ;
  7221.         if (typeof(this.requestTimeout) == "undefined") {
  7222.             this.requestTimeout = 5;
  7223.         }
  7224.         ;
  7225.         if (this.cookie == "1") {
  7226.             $0b = "&eid=" + this.eid + "&one=" + (this.cookieOne ? "1" : "0") + "&fns=" + (this.forceNewSession ? "1" : "0") + $0b;
  7227.         }
  7228.         ;
  7229.         if (this.cookie != "1" && (this.wtTypeof(this.cookieEidTimeout) || this.wtTypeof(this.cookieSidTimeout))) {
  7230.             if (this.wtTypeof(this.cookieEidTimeout) && this.cookieEidTimeout != '') {
  7231.                 $0b = "&cet=" + this.cookieEidTimeout + $0b;
  7232.             }
  7233.             ;
  7234.             if (this.wtTypeof(this.cookieSidTimeout) && this.cookieSidTimeout != '') {
  7235.                 $0b = "&cst=" + this.cookieSidTimeout + $0b;
  7236.             }
  7237.         }
  7238.         ;
  7239.         if (this.pixelSampling > 0) {
  7240.             $0b += "&ps=" + this.pixelSampling;
  7241.         }
  7242.         ;
  7243.         $0b = "&tz=" + this.getTimezone() + $0b;
  7244.         var $0e = "//" + this.trackDomain + "/" + this.trackId + "/" + $0c + "?p=" + this.version + "," + $0a + $0b + "&eor=1";
  7245.         if (!this.ignorePrerendering && this.isChrome && typeof(document.webkitHidden) != "undefined") {
  7246.             if (typeof(this.prerendering) != "object") {
  7247.                 this.prerendering = new Array();
  7248.             }
  7249.             ;
  7250.             if (document.webkitHidden) {
  7251.                 this.prerendering.push($0e);
  7252.                 var pi = this;
  7253.                 this.registerEvent(document, "webkitvisibilitychange", function () {
  7254.                     pi.sendPrerendering();
  7255.                 });
  7256.                 return;
  7257.             }
  7258.         }
  7259.         ;
  7260.         if ($0d == "saveRequest" && this.cookie == "3") {
  7261.             if (this.getCookie("saveRequestV3")) {
  7262.                 this.setCookie("saveRequestV3", this.getCookie("saveRequestV3") + "<<>>" + $0e, this.requestTimeout);
  7263.             }
  7264.             else {
  7265.                 this.setCookie("saveRequestV3", $0e, this.requestTimeout);
  7266.             }
  7267.         }
  7268.         else {
  7269.             this.sendPixel($0e, $0c);
  7270.         }
  7271.         ;
  7272.         if ($0c != 'hm') {
  7273.             this.cookieOne = false;
  7274.             this.forceNewSession = false;
  7275.             this.sentFullPixel = 1;
  7276.         }
  7277.     };
  7278.     this.sendPrerendering = function () {
  7279.         if (!document.webkitHidden) {
  7280.             for (var i = 0; i < this.prerendering.length; i++) {
  7281.                 this.sendPixel(this.prerendering[i]);
  7282.             }
  7283.             ;
  7284.             this.prerendering = new Array();
  7285.         }
  7286.     };
  7287.     this.sendPixel = function ($I, $0c) {
  7288.         var $0f = (document.location.protocol == "https:" ? "https:" : "http:");
  7289.         if (this.forceHTTPS) {
  7290.             $0f = "https:";
  7291.         }
  7292.         ;
  7293.         $I = $0f + $I;
  7294.         if ($0c == "hm") {
  7295.             $I += "&hm_ts=" + new Date().getTime();
  7296.         }
  7297.         ;
  7298.         if (!this.wtTypeof($0g)) {
  7299.             var $0g = new Array();
  7300.         }
  7301.         ;
  7302.         var ii = $0g.length;
  7303.         $0g[ii] = new Image();
  7304.         $0g[ii].onload = function () {
  7305.             return;
  7306.         };
  7307.         $0g[ii].src = $I;
  7308.     };
  7309.     this.checkCustomParameter = function (cp, np) {
  7310.         var p = "";
  7311.         if (typeof(cp) == 'object') {
  7312.             for (var z in cp) {
  7313.                 if (!isNaN(z) && this.wtTypeof(cp[z]) && typeof(cp[z]) == 'string' && cp[z] != '') {
  7314.                     if (this.checkSC('custom')) {
  7315.                         cp[z] = this.decrypt(cp[z]);
  7316.                     }
  7317.                     ;
  7318.                     if (this.paramFirst.indexOf(np + z + ';') == -1) {
  7319.                         p += '&' + np + z + '=' + this.wtEscape(cp[z]);
  7320.                     }
  7321.                 }
  7322.             }
  7323.         }
  7324.         ;
  7325.         return p;
  7326.     };
  7327.     this.send = function (p, $c, ep) {
  7328.         if ($c == "link" || $c == "click") {
  7329.             this.config.linkId = p;
  7330.         }
  7331.         ;
  7332.         this.config.contentId = (this.config.contentId) ? this.config.contentId : this.contentId;
  7333.         var $0h = ($c && ($c == "link" || $c == "click")) ? this.config.contentId : (p) ? p : this.config.contentId;
  7334.         if (!$0h) {
  7335.             $0h = "no_content";
  7336.         }
  7337.         ;
  7338.         var $0i = "";
  7339.         var $0j = this.wtEscape($0h) + ",1,";
  7340.         $0j += this.baseparams();
  7341.         var $0k = navigator.plugins.length;
  7342.         var $0l = "";
  7343.         if ($0k > 0) {
  7344.             var $0m = Array();
  7345.             for (var i = 0; i < $0k; i++) {
  7346.                 if (navigator.plugins && navigator.appName != 'Microsoft Internet Explorer') {
  7347.                     if (navigator.plugins[i].name == "Shockwave Flash") {
  7348.                         $0l = navigator.plugins[i].description;
  7349.                     }
  7350.                     else {
  7351.                         $0l = navigator.plugins[i].name;
  7352.                     }
  7353.                     ;
  7354.                     var $0n = this.plugInArray(this.plugins, $0l);
  7355.                     if ($0n && !this.plugInArray($0m, $0n)) {
  7356.                         $0m.push($0n);
  7357.                     }
  7358.                 }
  7359.             }
  7360.             ;
  7361.             $0l = $0m.join("|");
  7362.         }
  7363.         ;
  7364.         if (this.paramFirst) {
  7365.             var $0o = this.paramFirst.split(";");
  7366.             for (var i = 0; i < $0o.length; i++) {
  7367.                 var $00 = this.getMappingParam($0o[i]);
  7368.                 var $0p = $00.mapping;
  7369.                 var $y = $00.index;
  7370.                 if ($0p) {
  7371.                     if ($y) {
  7372.                         if (this.config[$0p] && typeof(this.config[$0p][$y]) != "undefined" && this.config[$0p][$y]) {
  7373.                             $0i += "&" + $0o[i] + "=" + this.wtEscape(this.config[$0p][$y]);
  7374.                         }
  7375.                     }
  7376.                     else if (this.config[$0p]) {
  7377.                         $0i += "&" + $0o[i] + "=" + this.wtEscape(this.config[$0p]);
  7378.                     }
  7379.                 }
  7380.             }
  7381.         }
  7382.         ;
  7383.         if (typeof(ep) == "string" && ep != "") {
  7384.             ep = ep.split(/;/);
  7385.             for (var z = 0; z < ep.length; z++) {
  7386.                 if (this.wtTypeof(ep[z])) {
  7387.                     $h = ep[z].split(/=/);
  7388.                     if (this.checkSC('custom')) {
  7389.                         $h[1] = this.decrypt($h[1]);
  7390.                     }
  7391.                     ;
  7392.                     $h[1] = this.wtEscape($h[1]);
  7393.                     $0i += '&' + $h[0] + '=' + $h[1];
  7394.                 }
  7395.             }
  7396.         }
  7397.         else {
  7398.             this.wtEpEncoded = false;
  7399.             var $0q = this.checkCustomParameter(this.config.customParameter, "cp");
  7400.             var $0r = this.checkCustomParameter(this.config.customSessionParameter, "cs");
  7401.             var $0s = this.checkCustomParameter(this.config.customTimeParameter, "ce");
  7402.             var $0t = this.checkCustomParameter(this.config.customEcommerceParameter, "cb");
  7403.             if (this.config.orderValue) {
  7404.                 if (this.paramFirst.indexOf("ov;") == -1) {
  7405.                     if (this.checkSC('order')) {
  7406.                         $0i += "&ov=" + this.wtEscape(this.decrypt(this.config.orderValue));
  7407.                     }
  7408.                     else {
  7409.                         $0i += "&ov=" + this.wtEscape(this.config.orderValue);
  7410.                     }
  7411.                 }
  7412.             }
  7413.             ;
  7414.             if (this.config.currency) {
  7415.                 if (this.paramFirst.indexOf("cr;") == -1) {
  7416.                     if (this.checkSC('order')) {
  7417.                         $0i += "&cr=" + this.wtEscape(this.decrypt(this.config.currency));
  7418.                     }
  7419.                     else {
  7420.                         $0i += "&cr=" + this.wtEscape(this.config.currency);
  7421.                     }
  7422.                 }
  7423.             }
  7424.             ;
  7425.             if (this.config.orderId) {
  7426.                 if (this.paramFirst.indexOf("oi;") == -1) {
  7427.                     $0i += "&oi=" + this.wtEscape(this.config.orderId);
  7428.                 }
  7429.             }
  7430.             ;
  7431.             if (this.config.product) {
  7432.                 if (this.paramFirst.indexOf("ba;") == -1) {
  7433.                     $0i += "&ba=" + this.wtEscape(this.config.product);
  7434.                 }
  7435.                 ;
  7436.                 if (this.config.productCost) {
  7437.                     if (this.paramFirst.indexOf("co;") == -1) {
  7438.                         $0i += "&co=" + this.wtEscape(this.config.productCost);
  7439.                     }
  7440.                 }
  7441.                 ;
  7442.                 if (this.config.productQuantity) {
  7443.                     if (this.paramFirst.indexOf("qn;") == -1) {
  7444.                         $0i += "&qn=" + this.wtEscape(this.config.productQuantity);
  7445.                     }
  7446.                 }
  7447.                 ;
  7448.                 $0i += this.checkCustomParameter(this.config.productCategory, "ca");
  7449.                 if (this.config.productStatus) {
  7450.                     if (this.paramFirst.indexOf("st;") == -1) {
  7451.                         $0i += "&st=" + this.wtEscape(this.config.productStatus);
  7452.                     }
  7453.                 }
  7454.             }
  7455.             ;
  7456.             var customerId = $0u("wt_cd", "(.*)");
  7457.             if (!this.config.customerId) {
  7458.                 this.config.customerId = customerId;
  7459.             }
  7460.             ;
  7461.             if (this.config.customerId) {
  7462.                 if (this.paramFirst.indexOf("cd;") == -1) {
  7463.                     $0i += "&cd=" + this.wtEscape(this.config.customerId);
  7464.                 }
  7465.             }
  7466.             ;
  7467.             $0i += this.checkCustomParameter(this.config.crmCategory, "vc");
  7468.             if (this.browserLang) {
  7469.                 $0i += "&la=" + this.wtEscape(this.browserLang);
  7470.             }
  7471.             ;
  7472.             $0i += this.checkCustomParameter(this.config.contentGroup, "cg");
  7473.             var $0v = '';
  7474.             if (this.config.campaignId) {
  7475.                 if (!(this.config.campaignId in this.sentCampaignIds)) {
  7476.                     if (this.paramFirst.indexOf("mc;") == -1) {
  7477.                         $0i += "&mc=" + this.wtEscape(this.config.campaignId);
  7478.                     }
  7479.                 }
  7480.                 else {
  7481.                     if (this.paramFirst.indexOf("mc;") == -1) {
  7482.                         $0i += "&mc=" + this.wtEscape("ignore%3Dignore");
  7483.                     }
  7484.                 }
  7485.                 ;
  7486.                 if (this.paramFirst.indexOf("mca;") == -1) {
  7487.                     $0i += "&mca=" + ((this.config.campaignAction) ? this.config.campaignAction.substring(0, 1) : "c");
  7488.                 }
  7489.                 ;
  7490.                 this.sentCampaignIds[this.config.campaignId] = true;
  7491.                 $0v += this.checkCustomParameter(this.config.customCampaignParameter, "cc");
  7492.             }
  7493.             ;
  7494.             if (this.trackingSwitchMediaCode) {
  7495.                 $0i += "&tmc=" + this.wtEscape(this.trackingSwitchMediaCode);
  7496.             }
  7497.             ;
  7498.             if (this.trackingSwitchMediaCodeValue) {
  7499.                 $0i += "&tmcv=" + this.wtEscape(this.trackingSwitchMediaCodeValue);
  7500.             }
  7501.             ;
  7502.             if (this.trackingSwitchMediaCodeTimestamp) {
  7503.                 $0i += "&tmct=" + this.wtEscape(this.trackingSwitchMediaCodeTimestamp);
  7504.             }
  7505.             ;
  7506.             if (typeof($0w) == "object" && typeof($0w.trackingSwitchMediaCode) != "undefined") {
  7507.                 $0i += "&tmc=" + this.wtEscape($0w.trackingSwitchMediaCode);
  7508.             }
  7509.             ;
  7510.             if (typeof($0w) == "object" && typeof($0w.trackingSwitchMediaCodeValue) != "undefined") {
  7511.                 $0i += "&tmcv=" + this.wtEscape($0w.trackingSwitchMediaCodeValue);
  7512.             }
  7513.             ;
  7514.             if (typeof($0w) == "object" && typeof($0w.trackingSwitchMediaCodeTimestamp) != "undefined") {
  7515.                 $0i += "&tmct=" + this.wtEscape($0w.trackingSwitchMediaCodeTimestamp);
  7516.             }
  7517.             ;
  7518.             var $0x = "";
  7519.             var $0y;
  7520.             if (typeof(wt_vt) != "undefined") {
  7521.                 $0y = wt_vt;
  7522.             }
  7523.             ;
  7524.             if (!this.wtTypeof($0y)) {
  7525.                 $0y = this.urlParam(location.href, 'wt_vt', false);
  7526.             }
  7527.             ;
  7528.             if ($0y) {
  7529.                 var $0z = this.getCookie('wt_vt').split(";");
  7530.                 for (var i = 0; i < $0z.length; i++) {
  7531.                     if ($0z[i].indexOf($0y + 'v') != -1) {
  7532.                         $0x = '&wt_vt=' + $0z[i].split('t')[0].split('v')[1];
  7533.                     }
  7534.                 }
  7535.             }
  7536.             ;
  7537.             if ($0x) {
  7538.                 $0i += $0x;
  7539.             }
  7540.             ;
  7541.             if (this.config.internalSearch) {
  7542.                 if (this.paramFirst.indexOf("is;") == -1) {
  7543.                     $0i += "&is=" + this.wtEscape(this.maxlen(this.config.internalSearch, 255));
  7544.                 }
  7545.             }
  7546.             ;
  7547.             if ($0q) {
  7548.                 $0i += $0q;
  7549.             }
  7550.             ;
  7551.             if ($0v) {
  7552.                 $0i += $0v;
  7553.             }
  7554.             ;
  7555.             if ($0s) {
  7556.                 $0i += $0s;
  7557.             }
  7558.             ;
  7559.             if ($0t) {
  7560.                 $0i += $0t;
  7561.             }
  7562.             ;
  7563.             if ($0r) {
  7564.                 $0i += $0r;
  7565.             }
  7566.             ;
  7567.             if (this.wtTypeof(this.config.customSid) && this.config.customSid != '') {
  7568.                 $0i += "&csid=" + this.config.customSid;
  7569.             }
  7570.             ;
  7571.             if (this.wtTypeof(this.config.customEid) && this.config.customEid != '') {
  7572.                 $0i += "&ceid=" + this.config.customEid;
  7573.             }
  7574.             ;
  7575.             if (this.wtTypeof(this.config.xwtip) && this.config.xwtip != '') {
  7576.                 $0i += "&X-WT-IP=" + this.wtEscape(this.config.xwtip);
  7577.             }
  7578.             ;
  7579.             if (this.wtTypeof(this.config.xwtua) && this.config.xwtua != '') {
  7580.                 $0i += "&X-WT-UA=" + this.wtEscape(this.config.xwtua);
  7581.             }
  7582.             ;
  7583.             if (this.wtTypeof(this.config.xwtrq) && this.config.xwtrq != '') {
  7584.                 $0i += "&X-WT-RQ=" + this.wtEscape(this.config.xwtrq);
  7585.             }
  7586.             ;
  7587.             if (!this.sentFullPixel && this.firstVisitContact) {
  7588.                 $0i += "&fvc=" + this.firstVisitContact;
  7589.             }
  7590.             ;
  7591.             if (!this.sentFullPixel && this.lastVisitContact) {
  7592.                 $0i += "&lvc=" + this.lastVisitContact;
  7593.             }
  7594.         }
  7595.         ;
  7596.         if (this.config.linkId && this.config.customClickParameter) {
  7597.             var $06 = (this.config.customClickParameter[this.config.linkId]) ? this.config.customClickParameter[this.config.linkId] :
  7598.                     this.config.customClickParameter;
  7599.             $0i += this.checkCustomParameter($06, "ck");
  7600.             this.ccParams = false;
  7601.         }
  7602.         ;
  7603.         if (this.config.xlc && this.config.xlct) {
  7604.             if (this.config.xlc != "" || this.config.xlct != "") {
  7605.                 if (this.config.xlcv) {
  7606.                     var $0A = this.getExtLifeCycles(this.config.xlc, this.config.xlct, this.config.xlcv);
  7607.                 }
  7608.                 else {
  7609.                     var $0A = this.getExtLifeCycles(this.config.xlc, this.config.xlct);
  7610.                 }
  7611.                 ;
  7612.                 $0i += $0A;
  7613.             }
  7614.         }
  7615.         ;
  7616.         if (this.config.linkId && this.config.sendOnUnload) {
  7617.             this.wtEp = $0i;
  7618.             this.wtEpEncoded = true;
  7619.             if (this.isChrome || this.isOpera || this.isSafari) {
  7620.                 webtrekkUnload('noForm', "link");
  7621.             }
  7622.             else {
  7623.                 this.registerEvent(window, (this.isIE && this.wtTypeof(window.onbeforeunload)) ? "beforeunload" : "unload", webtrekkUnload);
  7624.             }
  7625.             ;
  7626.             return;
  7627.         }
  7628.         else if (this.config.linkId) {
  7629.             this.wtEp = $0i;
  7630.             this.wtEpEncoded = true;
  7631.             webtrekkUnload('noForm', "click");
  7632.             return;
  7633.         }
  7634.         else if (!this.config.contentId && !this.config.linkId) {
  7635.             this.config.contentId = this.contentId;
  7636.             this.config.linkId = "wt_ignore";
  7637.             this.wtEp = $0i;
  7638.             this.wtEpEncoded = true;
  7639.             webtrekkUnload('noForm', "click");
  7640.             return;
  7641.         }
  7642.         else if (this.config.sendOnUnload) {
  7643.             this.wtEp = $0i;
  7644.             this.wtEpEncoded = true;
  7645.             if (this.isChrome || this.isOpera || this.isSafari) {
  7646.                 webtrekkUnload('noForm', "link");
  7647.             }
  7648.             else {
  7649.                 this.registerEvent(window, (this.isIE && this.wtTypeof(window.onbeforeunload)) ? "beforeunload" : "unload", webtrekkUnload);
  7650.             }
  7651.             ;
  7652.             return;
  7653.         }
  7654.         ;
  7655.         if (this.cookie == "1") {
  7656.             if (this.cookieOne) {
  7657.                 $0i += "&np=" + this.wtEscape($0l);
  7658.             }
  7659.         }
  7660.         else {
  7661.             $0i += "&np=" + this.wtEscape($0l);
  7662.         }
  7663.         ;
  7664.         this.quicksend($0j, $0i, false, "sendRequest");
  7665.     };
  7666.     this.sendinfo = function (c, p, $c, ep) {
  7667.         if (this.cookie == "1" && !this.optOut && !this.deactivatePixel) {
  7668.             this.firstParty();
  7669.         }
  7670.         ;
  7671.         if (location.href.indexOf('fb_xd_fragment') != -1) {
  7672.             return;
  7673.         }
  7674.         ;
  7675.         if (typeof(c) == 'object') {
  7676.             this.config = c;
  7677.         }
  7678.         else {
  7679.             this.config = this.getConfig();
  7680.         }
  7681.         ;
  7682.         if (!this.config.campaignId && this.mediaCode) {
  7683.             this.getMediaCode();
  7684.         }
  7685.         ;
  7686.         if (this.getCookie("saveRequestV3")) {
  7687.             var $0B = this.getCookie("saveRequestV3").split("<<>>");
  7688.             for (var i = 0; i < $0B.length; i++) {
  7689.                 this.sendPixel($0B[i], "wt");
  7690.             }
  7691.             ;
  7692.             this.setCookie("saveRequestV3", "", -3600);
  7693.         }
  7694.         ;
  7695.         if (this.beforeSendinfoPixel != false) {
  7696.             this.beforeSendinfoPixel();
  7697.         }
  7698.         else {
  7699.             this.executePlugin(this.getPluginConfig(($c) ? $c : "page", "before"));
  7700.         }
  7701.         ;
  7702.         if (this.contentId != "" || p != "" || document.layers) {
  7703.             this.send(p, $c, ep);
  7704.         }
  7705.         ;
  7706.         if (this.afterSendinfoPixel != false) {
  7707.             this.afterSendinfoPixel();
  7708.         }
  7709.         else {
  7710.             this.executePlugin(this.getPluginConfig(($c) ? $c : "page", "after"));
  7711.         }
  7712.     };
  7713.     this.sendinfo_media = function ($0C, mk, $0D, $0E, mg, bw, $0F, $0G) {
  7714.         if (this.wtTypeof($0H)) {
  7715.             $0H($0C, mk, $0D, $0E, mg, bw, $0F, $0G, this.unloadInstance);
  7716.         }
  7717.     };
  7718.     this.getExtLifeCycles = function (xlc, xlct, xlcv) {
  7719.         var $0I = "";
  7720.         var $0J = new Object();
  7721.         var $0K = xlc.split("|");
  7722.         for (var i = 0; i < $0K.length; i++) {
  7723.             var $0L = $0K[i].split(";");
  7724.             for (var j = 0; j < $0L.length; j++) {
  7725.                 if (j == 0) {
  7726.                     $0I += this.wtEscape($0L[j]);
  7727.                 }
  7728.                 else {
  7729.                     $0I += $0L[j];
  7730.                 }
  7731.                 ;
  7732.                 $0I += ";";
  7733.             }
  7734.             ;
  7735.             $0I = $0I.substr(0, $0I.length - 1);
  7736.             $0I += "|";
  7737.         }
  7738.         ;
  7739.         $0I = $0I.substr(0, $0I.length - 1);
  7740.         $0J.xlcl = this.wtEscape(xlc.split("|").length);
  7741.         $0J.xlct = this.wtEscape(xlct);
  7742.         if (typeof(xlcv) != "undefined") {
  7743.             $0J.xlcv = this.wtEscape(xlcv);
  7744.         }
  7745.         ;
  7746.         $0J.xlc = this.wtEscape($0I);
  7747.         var $0b = "";
  7748.         for (i in $0J) {
  7749.             $0b += "&" + i + "=" + $0J[i];
  7750.         }
  7751.         ;
  7752.         return $0b;
  7753.     };
  7754.     this.isOwnDomain = function (l) {
  7755.         var pt = '';
  7756.         if (this.domain) {
  7757.             if (this.domain.toUpperCase().indexOf("REGEXP:") == 0) {
  7758.                 pt = new RegExp(this.domain.substring(7), "i");
  7759.                 if (pt.test(this.getDomain(l))) {
  7760.                     return true;
  7761.                 }
  7762.             }
  7763.             else {
  7764.                 var $0M = this.domain.split(';');
  7765.                 var $0N = this.getDomain(l);
  7766.                 for (var i = 0; i < $0M.length; i++) {
  7767.                     if ($0N == $0M[i]) {
  7768.                         return true;
  7769.                     }
  7770.                 }
  7771.             }
  7772.         }
  7773.         else {
  7774.             return false;
  7775.         }
  7776.         ;
  7777.         return false;
  7778.     };
  7779.     this.getDomain = function (l) {
  7780.         if (typeof(l) != 'string') {
  7781.             return'';
  7782.         }
  7783.         ;
  7784.         l = this.wtUnescape(l);
  7785.         l = l.split('://')[1];
  7786.         var rx = new RegExp('^(?:[^\/]+:\/\/)?([^\/:]+)', 'g');
  7787.         if (typeof(l) != "undefined") {
  7788.             l = l.match(rx);
  7789.             if (l[0]) {
  7790.                 return l[0].toLowerCase();
  7791.             }
  7792.         }
  7793.         ;
  7794.         return'';
  7795.     };
  7796.     var $0O = function () {
  7797.         var $0P = 0, $0Q = $0u("wt_ref", "(.*)");
  7798.         if ($d.framesetReferrer) {
  7799.             $0P = $d.wtEscape($d.framesetReferrer);
  7800.         }
  7801.         else if ($d.getCookie("wt_ref") != "") {
  7802.             $0P = $d.wtEscape($d.getCookie("wt_ref"));
  7803.             $d.setCookie("wt_ref", "", -3600);
  7804.         }
  7805.         else if ($0Q) {
  7806.             $0P = $d.wtEscape($0Q);
  7807.         }
  7808.         else {
  7809.             if (document.referrer.length > 0) {
  7810.                 $0P = $d.wtEscape(document.referrer);
  7811.             }
  7812.         }
  7813.         ;
  7814.         if ($d.sentFullPixel) {
  7815.             $0P = "2";
  7816.         }
  7817.         else if ($d.isOwnDomain($0P)) {
  7818.             $0P = "1";
  7819.         }
  7820.         ;
  7821.         return $0P;
  7822.     };
  7823.     var $0R = function () {
  7824.         var $0S = 0;
  7825.         if (!document.layers && document.getElementById) {
  7826.             try {
  7827.                 $0S = top.window.innerHeight;
  7828.             }
  7829.             catch (e) {
  7830.             }
  7831.             ;
  7832.         }
  7833.         else {
  7834.             $0S = top.window.innerHeight;
  7835.         }
  7836.         ;
  7837.         if (!$0S) {
  7838.             try {
  7839.                 $0S = top.document.documentElement.clientHeight;
  7840.             }
  7841.             catch (e) {
  7842.             }
  7843.             ;
  7844.         }
  7845.         ;
  7846.         if (!$0S) {
  7847.             try {
  7848.                 $0S = top.document.body.clientHeight;
  7849.             }
  7850.             catch (e) {
  7851.             }
  7852.             ;
  7853.         }
  7854.         ;
  7855.         if (typeof($0S) == 'undefined') {
  7856.             $0S = -1;
  7857.         }
  7858.         ;
  7859.         return $0S;
  7860.     };
  7861.     var $0T = function () {
  7862.         var $0U = 0;
  7863.         if (!document.layers && document.getElementById) {
  7864.             try {
  7865.                 $0U = top.window.innerWidth;
  7866.             }
  7867.             catch (e) {
  7868.             }
  7869.             ;
  7870.         }
  7871.         else {
  7872.             $0U = top.window.innerWidth;
  7873.         }
  7874.         ;
  7875.         if (!$0U) {
  7876.             try {
  7877.                 $0U = top.document.documentElement.clientWidth;
  7878.             }
  7879.             catch (e) {
  7880.             }
  7881.             ;
  7882.         }
  7883.         ;
  7884.         if (!$0U) {
  7885.             try {
  7886.                 $0U = top.document.body.clientWidth;
  7887.             }
  7888.             catch (e) {
  7889.             }
  7890.             ;
  7891.         }
  7892.         ;
  7893.         if (typeof($0U) == 'undefined') {
  7894.             $0U = -1;
  7895.         }
  7896.         ;
  7897.         return $0U;
  7898.     };
  7899.     this.baseparams = function () {
  7900.         var $0V = screen.width + "x" + screen.height + "," + (navigator.appName != 'Netscape' ? screen.colorDepth : screen.pixelDepth) + ",";
  7901.         $0V +=
  7902.                 ((navigator.cookieEnabled == true) ? "1," :
  7903.                         ((navigator.cookieEnabled == false) ? "0," : ((document.cookie.indexOf("=") != -1) ? "1," : "0,")));
  7904.         $0V += new Date().getTime() + ",";
  7905.         $0V += $0O();
  7906.         var $0S = $0R();
  7907.         var $0U = $0T();
  7908.         if ($0S && $0S > screen.height) {
  7909.             $0S = screen.height;
  7910.         }
  7911.         ;
  7912.         if ($0U && $0U > screen.width) {
  7913.             $0U = screen.width;
  7914.         }
  7915.         ;
  7916.         $0V += "," + $0U + "x" + $0S;
  7917.         $0V += "," + (navigator.javaEnabled() ? "1" : "0");
  7918.         return $0V;
  7919.     };
  7920.     this.getMediaCode = function (mc) {
  7921.         if (!mc) {
  7922.             if (!this.mediaCode) {
  7923.                 return false;
  7924.             }
  7925.             ;
  7926.             mc = this.mediaCode;
  7927.         }
  7928.         ;
  7929.         var v;
  7930.         if (this.mediaCodeValue) {
  7931.             v = this.mediaCodeValue.split(";");
  7932.         }
  7933.         ;
  7934.         var m = mc.split(";");
  7935.         this.config.campaignId = "";
  7936.         for (var i = 0; i < m.length; i++) {
  7937.             if (this.config.campaignId != "") {
  7938.                 this.config.campaignId += ";";
  7939.             }
  7940.             ;
  7941.             if (this.mediaCodeCookie) {
  7942.                 if (this.getCookie('wt_' + m[i].toLowerCase() + this.allUrlParam(m[i], "").toLowerCase()) == '') {
  7943.                     this.config.campaignId += m[i] + this.wtEscape("=" + this.allUrlParam(m[i], ""));
  7944.                 }
  7945.                 else {
  7946.                     this.config.campaignId += "ignore%3Dignore";
  7947.                 }
  7948.                 ;
  7949.                 var $0W = '';
  7950.                 if (this.mediaCodeCookie == 'eid') {
  7951.                     $0W = 60 * 30 * 24 * 60;
  7952.                 }
  7953.                 ;
  7954.                 this.setCookie('wt_' + m[i].toLowerCase() + this.allUrlParam(m[i], "").toLowerCase(), 1, $0W);
  7955.             }
  7956.             else {
  7957.                 if (typeof(v) != "undefined" && typeof(v[i]) != "undefined" && v[i] != "") {
  7958.                     this.config.campaignId += m[i] + this.wtEscape("=" + v[i]);
  7959.                 }
  7960.                 else if (this.allUrlParam(m[i], "") != "") {
  7961.                     this.config.campaignId += m[i] + this.wtEscape("=" + this.allUrlParam(m[i], ""));
  7962.                 }
  7963.             }
  7964.         }
  7965.     };
  7966.     this.searchContentIds = function () {
  7967.         var $0X = 0;
  7968.         var $04 = 0;
  7969.         this.contentIds = this.wtEscape(this.contentId.split(";")[0]);
  7970.         do {
  7971.             $0X++;
  7972.             var $0Y = this.urlParam(location.href, "wt_contentId" + $0X, false);
  7973.             if ($0Y) {
  7974.                 this.contentIds += "&wt_contentId" + $0X + "=" + this.wtEscape($0Y);
  7975.                 $04++;
  7976.             }
  7977.         } while ($04 >= $0X);
  7978.     };
  7979.     this.startHeatmapOrOverlay = function ($0f, $B) {
  7980.         this.searchContentIds();
  7981.         if (this.contentIds) {
  7982.             if (this.include(location.protocol + "//" + this.reporturl + "/" + $0f + ".pl?wt_contentId=" + this.contentIds + "&x="
  7983.                     + new Date().getTime())) {
  7984.                 if ($0f == "heatmap" && navigator.userAgent.indexOf('MSIE 6') != -1 && navigator.userAgent.indexOf('Windows NT 5.0') != -1) {
  7985.                     alert("Click OK to start heatmap.");
  7986.                 }
  7987.                 ;
  7988.                 if (document.readyState != "interactive" && document.readyState != "complete") {
  7989.                     this.registerEvent(window, "load", $B);
  7990.                 }
  7991.                 else {
  7992.                     $B();
  7993.                 }
  7994.             }
  7995.         }
  7996.     };
  7997.     this.heatmapOn = (this.wtHref().indexOf("wt_heatmap=1") >= 0);
  7998.     this.overlayOn = (this.wtHref().indexOf("wt_overlay=1") >= 0 || document.cookie.indexOf("wt_overlay=1") >= 0);
  7999.     if (this.wtHref().indexOf("wt_overlay=0") >= 0) {
  8000.         this.overlayOn = false;
  8001.         this.setCookie("wt_overlay", "", -1);
  8002.     }
  8003.     ;
  8004.     var $0Z = false;
  8005.     for (i = 0; i < webtrekkHeatmapObjects.length; i++) {
  8006.         if (this == webtrekkHeatmapObjects[i]) {
  8007.             $0Z = true;
  8008.         }
  8009.     }
  8010.     ;
  8011.     if (!$0Z && this.heatmap && this.heatmap == "1") {
  8012.         webtrekkHeatmapObjects.push(this);
  8013.         this.registerEvent(document, "mousedown", webtrekkHeatmapClick);
  8014.     }
  8015.     ;
  8016.     if (this.heatmapOn && !this.disableOverlayView) {
  8017.         this.searchContentIds();
  8018.         this.startHeatmapOrOverlay("heatmap", webtrekkStartHeatmap);
  8019.     }
  8020.     ;
  8021.     if (this.overlayOn && !this.disableOverlayView) {
  8022.         this.searchContentIds();
  8023.         this.setCookie("wt_overlay", "1");
  8024.         this.startHeatmapOrOverlay("overlay", webtrekkStartOverlay);
  8025.     }
  8026.     ;
  8027.     this.setPixelSampling = function ($10) {
  8028.         if (!$10) {
  8029.             var $10 = this.pixelSampling;
  8030.         }
  8031.         ;
  8032.         var trackId = this.trackId.split(",")[0];
  8033.         var $11 = this.getCookie("wt3_sample").split(";");
  8034.         var $12 = false;
  8035.         for (var i = 0; i < $11.length; i++) {
  8036.             if (this.indexOf($11[i], trackId + "|" + $10) != -1) {
  8037.                 $12 = true;
  8038.             }
  8039.             else {
  8040.                 if (this.indexOf($11[i], trackId + "|") != -1) {
  8041.                     $11[i] = "";
  8042.                 }
  8043.             }
  8044.         }
  8045.         ;
  8046.         var $13 = 6;
  8047.         if (this.cookieEidTimeout) {
  8048.             $13 = this.cookieEidTimeout;
  8049.         }
  8050.         ;
  8051.         if (!$12) {
  8052.             if (Math && Math.random && parseInt(Math.random() * $10) == 0) {
  8053.                 $11.push(trackId + "|" + $10 + "|1");
  8054.             }
  8055.             else {
  8056.                 $11.push(trackId + "|" + $10 + "|0");
  8057.             }
  8058.             ;
  8059.             this.setCookie("wt3_sample", $11.join(";"), $13 * 30 * 24 * 60);
  8060.             $11 = this.getCookie("wt3_sample");
  8061.         }
  8062.         else {
  8063.             $11 = $11.join(";");
  8064.             this.setCookie("wt3_sample", $11, $13 * 30 * 24 * 60);
  8065.         }
  8066.         ;
  8067.         if (this.indexOf($11, trackId + "|" + $10 + "|1") == -1) {
  8068.             this.deactivatePixel = true;
  8069.         }
  8070.     };
  8071.     if (this.pixelSampling && !this.optOut) {
  8072.         this.setPixelSampling();
  8073.     }
  8074.     ;
  8075.     var $0u = function ($00, $14) {
  8076.         var $15 = $d.urlParam(location.href, $00, false);
  8077.         var $16 = $d.urlParam(location.href, "wt_t", false);
  8078.         var $17 = new Date().getTime();
  8079.         var $18 = new RegExp($14);
  8080.         if ($16) {
  8081.             $16 = parseInt($16) + (15 * 60 * 1000);
  8082.         }
  8083.         else {
  8084.             $16 = $17 - (15 * 60 * 1000);
  8085.         }
  8086.         ;
  8087.         if ($15 && $18.test($15) && $16 > $17) {
  8088.             return $15;
  8089.         }
  8090.         ;
  8091.         return false;
  8092.     };
  8093.     var $19 = function ($1a) {
  8094.         if ($1a && $1a.substring(0, 1) == "2") {
  8095.             var $1b = parseInt($1a.substring(1, 11) + "000");
  8096.             var $1c = new Date($1b);
  8097.             var $1d = $1c.getFullYear();
  8098.             $1d += (($1c.getMonth() < 9) ? "0" : "");
  8099.             $1d += ($1c.getMonth() + 1);
  8100.             $1d += (($1c.getDate() < 9) ? "0" : "");
  8101.             $1d += $1c.getDate();
  8102.             $1d += (($1c.getHours() < 9) ? "0" : "");
  8103.             $1d += $1c.getHours();
  8104.             $1d += (($1c.getMinutes() < 9) ? "0" : "");
  8105.             $1d += $1c.getMinutes();
  8106.             return $1d;
  8107.         }
  8108.         ;
  8109.         return"";
  8110.     };
  8111.     this.firstParty = function () {
  8112.         var $1e = this.getCookie("wt3_sid").split(";");
  8113.         var $1f = this.getCookie("wt3_eid").split(";");
  8114.         var $13 = (this.cookieEidTimeout) ? this.cookieEidTimeout : 6;
  8115.         var trackId = this.trackId.split(",")[0];
  8116.         var $1g = false;
  8117.         var $1h = false;
  8118.         var $1i = false;
  8119.         var $1c = this.generateEid();
  8120.         for (var i = 0; i < $1e.length; i++) {
  8121.             if ($1e[i].indexOf(trackId) != -1) {
  8122.                 $1g = i;
  8123.                 break;
  8124.             }
  8125.         }
  8126.         ;
  8127.         for (var i = 0; i < $1f.length; i++) {
  8128.             if ($1f[i].indexOf(trackId + "|") != -1) {
  8129.                 $1h = i;
  8130.                 break;
  8131.             }
  8132.         }
  8133.         ;
  8134.         if (!$1g) {
  8135.             $1e.push(trackId);
  8136.             if ($1h) {
  8137.                 this.forceNewSession = true;
  8138.             }
  8139.         }
  8140.         ;
  8141.         this.eid = $0u("wt_eid", "^[0-9]{19}$");
  8142.         if (!$1h) {
  8143.             if (!this.eid) {
  8144.                 this.eid = this.generateEid();
  8145.             }
  8146.             ;
  8147.             this.cookieOne = true;
  8148.             $1f.push(trackId + "|" + this.eid + "#" + $1c);
  8149.             this.setCookie("wt3_eid", $1f.join(";"), $13 * 30 * 24 * 60);
  8150.         }
  8151.         else {
  8152.             if (this.eid) {
  8153.                 $1f[$1h] = trackId + "|" + this.eid;
  8154.                 this.updateCookie = true;
  8155.             }
  8156.             ;
  8157.             if ($1f[$1h].indexOf("#") == -1) {
  8158.                 $1f[$1h] += "#" + $1c;
  8159.             }
  8160.             ;
  8161.             $1i = $1f[$1h].replace(trackId + "|", "").split("#")[1];
  8162.             this.eid = $1f[$1h].replace(trackId + "|", "").split("#")[0];
  8163.             $1f[$1h] = $1f[$1h].replace(/\#[0-9]{19}/g, "#" + $1c);
  8164.             if (this.updateCookie) {
  8165.                 this.setCookie("wt3_eid", $1f.join(";"), $13 * 30 * 24 * 60);
  8166.             }
  8167.         }
  8168.         ;
  8169.         this.setCookie("wt3_sid", $1e.join(";"));
  8170.         if (!$1g) {
  8171.             this.firstVisitContact = $19(this.eid);
  8172.             if (this.updateCookie) {
  8173.                 $1i = (($1i) ? $1i : $1c);
  8174.                 this.lastVisitContact = $19($1i);
  8175.             }
  8176.         }
  8177.     };
  8178.     var $1k = false;
  8179.     for (i = 0; i < webtrekkUnloadObjects.length; i++) {
  8180.         if (this == webtrekkUnloadObjects[i]) {
  8181.             $1k = true;
  8182.         }
  8183.     }
  8184.     ;
  8185.     if (!$1k) {
  8186.         webtrekkUnloadObjects.push(this);
  8187.     }
  8188.     ;
  8189.     this.findForm = function () {
  8190.         if (!this.form || this.formObject) {
  8191.             return;
  8192.         }
  8193.         ;
  8194.         var f = document.forms;
  8195.         for (var i = 0; i < f.length; i++) {
  8196.             var cf = f[i];
  8197.             if (this.wtTypeof(cf.elements["wt_form"])) {
  8198.                 this.formObject = cf;
  8199.                 return;
  8200.             }
  8201.         }
  8202.     };
  8203.     this.checkFormFocus = function ($1l) {
  8204.         if ($1l == this.formFocus) {
  8205.             return 1;
  8206.         }
  8207.         ;
  8208.         return 0;
  8209.     };
  8210.     this.getFormFieldValue = function (ff) {
  8211.         var p = ff.name;
  8212.         if (this.formFieldAttribute) {
  8213.             p = '';
  8214.             var tmp = this.getAttribute(ff, this.formFieldAttribute);
  8215.             if (tmp || tmp !== null) {
  8216.                 p = tmp;
  8217.             }
  8218.         }
  8219.         ;
  8220.         return p;
  8221.     };
  8222.     this.isFormFieldAnonym = function (ff) {
  8223.         var $1m = [];
  8224.         if (this.formFullContent) {
  8225.             $1m = this.formFullContent.split(";");
  8226.         }
  8227.         ;
  8228.         if (this.formAnonymous || (ff.type != "select-multiple" && ff.type != "select-one" && ff.type != "checkbox" && ff.type != "radio")) {
  8229.             for (var k = 0; k < $1m.length; k++) {
  8230.                 if ($1m[k] == this.getFormFieldValue(ff)) {
  8231.                     return false;
  8232.                 }
  8233.             }
  8234.             ;
  8235.             return true;
  8236.         }
  8237.         ;
  8238.         return false;
  8239.     };
  8240.     this.getFieldValue = function (ff, e) {
  8241.         var $T = this.getAttribute(e, this.formValueAttribute).replace(/[\.|\;|\|]/g, "_");
  8242.         if (ff.type != "select-multiple" && ff.type != "select-one" && ff.type != "checkbox" && ff.type != "radio") {
  8243.             return this.maxlen(e.value, 30);
  8244.         }
  8245.         ;
  8246.         if (!this.isFormFieldAnonym(ff)) {
  8247.             return this.maxlen($T, 30);
  8248.         }
  8249.         ;
  8250.         return"anon";
  8251.     };
  8252.     this.gatherForm = function () {
  8253.         var $1n = ";";
  8254.         if (!this.formObject) {
  8255.             return;
  8256.         }
  8257.         ;
  8258.         var f = this.formObject;
  8259.         this.formName = this.getAttribute(f, this.formAttribute) ? this.getAttribute(f, this.formAttribute) : this.contentId.split(";")[0];
  8260.         var fl = "";
  8261.         if (this.wtTypeof(f.elements["wt_fields"])) {
  8262.             fl = f.elements["wt_fields"].value;
  8263.         }
  8264.         ;
  8265.         if (!fl) {
  8266.             for (var i = 0; i < f.elements.length; i++) {
  8267.                 var e = f.elements[i];
  8268.                 if (this.getFormFieldValue(e)) {
  8269.                     fl += this.getFormFieldValue(e) + $1n;
  8270.                 }
  8271.             }
  8272.             ;
  8273.             fl = fl.substring(0, fl.lastIndexOf($1n));
  8274.         }
  8275.         ;
  8276.         var $1o = fl.split($1n);
  8277.         var $1p = $1o.length;
  8278.         var pa = "";
  8279.         var $1q = {}, $1r = false;
  8280.         for (var i = 0; i < f.elements.length; i++) {
  8281.             var e = f.elements[i], $T, $1s, $1t, $1u = false;
  8282.             if (fl) {
  8283.                 for (var j = 0; j < $1p; j++) {
  8284.                     if (this.getFormFieldValue(e) == $1o[j]) {
  8285.                         $1u = true;
  8286.                     }
  8287.                 }
  8288.             }
  8289.             else {
  8290.                 if (this.getFormFieldValue(e)) {
  8291.                     $1u = true;
  8292.                 }
  8293.             }
  8294.             ;
  8295.             if ($1u) {
  8296.                 $T = null;
  8297.                 if (e.type == 'select-multiple') {
  8298.                     for (var j = 0; j < e.options.length; j++) {
  8299.                         var $04 = false;
  8300.                         if (e.options[j].selected) {
  8301.                             $04 = true;
  8302.                             pa +=
  8303.                                     ";" + this.getFormFieldValue(e).replace(/[\.|\;|\|]/g, "_") + "." + e.type + "|" + this.getFieldValue(e,
  8304.                                     e.options[j]) + "|" + this.checkFormFocus(e.name);
  8305.                         }
  8306.                         ;
  8307.                         if (!$04) {
  8308.                             $T = "empty";
  8309.                         }
  8310.                     }
  8311.                 }
  8312.                 else if (e.type == 'select-one') {
  8313.                     if (e.selectedIndex != -1) {
  8314.                         $T = this.getFieldValue(e, e.options[e.selectedIndex]);
  8315.                         if (!$T) {
  8316.                             $T = "empty";
  8317.                         }
  8318.                     }
  8319.                 }
  8320.                 else if (e.type == 'checkbox' || e.type == 'radio') {
  8321.                     if (!e.checked) {
  8322.                         $T = "empty";
  8323.                     }
  8324.                     else {
  8325.                         $T = this.getFieldValue(e, e);
  8326.                     }
  8327.                 }
  8328.                 else {
  8329.                     if (e.type != "hidden" && e.type != "button" && e.type != "image" && e.type != "reset" && e.type != "submit") {
  8330.                         $T = (this.getFieldValue(e, e) ? "filled_out" : "empty");
  8331.                         if (!this.isFormFieldAnonym(e)) {
  8332.                             $T = this.getFieldValue(e, e);
  8333.                         }
  8334.                         ;
  8335.                         if (!$T) {
  8336.                             $T = "empty";
  8337.                         }
  8338.                     }
  8339.                 }
  8340.                 ;
  8341.                 if ($T) {
  8342.                     name = this.getFormFieldValue(e).replace(/[\.|\;|\|]/g, "_");
  8343.                     $1s = ";" + name + "." + e.type + "|";
  8344.                     $1t = ((this.isFormFieldAnonym(e) && $T != "empty" && $T != "filled_out") ? "anon" : $T) + "|" + this.checkFormFocus(e.name);
  8345.                     if (e.type == 'radio') {
  8346.                         $1r = true;
  8347.                         if (($1s in $1q)) {
  8348.                             if ($1q[$1s].indexOf("empty") == 0) {
  8349.                                 $1q[$1s] = $1t;
  8350.                             }
  8351.                             ;
  8352.                             continue;
  8353.                         }
  8354.                         ;
  8355.                         $1q[$1s] = $1t;
  8356.                     }
  8357.                     else if (pa.indexOf($1s) == -1) {
  8358.                         pa += $1s + $1t;
  8359.                     }
  8360.                 }
  8361.             }
  8362.         }
  8363.         ;
  8364.         if ($1r) {
  8365.             for (var $1v in $1q) {
  8366.                 pa += $1v + $1q[$1v];
  8367.             }
  8368.         }
  8369.         ;
  8370.         if (pa) {
  8371.             pa = pa.substring(1);
  8372.         }
  8373.         ;
  8374.         return pa;
  8375.     };
  8376.     this.formTrackInstall = function (f) {
  8377.         if (f) {
  8378.             this.formObject = f;
  8379.         }
  8380.         else {
  8381.             this.formObject = (document.forms[0]) ? document.forms[0] : false;
  8382.         }
  8383.         ;
  8384.         if (this.formObject) {
  8385.             this.form = "1";
  8386.             webtrekkFormTrackInstall();
  8387.         }
  8388.     };
  8389.     if (this.form) {
  8390.         webtrekkFormTrackInstall();
  8391.     }
  8392.     ;
  8393.     this.cookieManager = function (name, $1w, $1x) {
  8394.         var i, j;
  8395.         this.name = name;
  8396.         this.keySeperator = "~";
  8397.         this.fieldSeparator = "#";
  8398.         this.durationSeperator = "|";
  8399.         this.found = false;
  8400.         this.expires = $1w;
  8401.         this.accessPath = $1x;
  8402.         this.rawValue = "";
  8403.         this.fields = [];
  8404.         this.fieldsDuration = [];
  8405.         this.fieldnames = [];
  8406.         this.read = function () {
  8407.             var $A = this.name + "=";
  8408.             var $1y = document.cookie;
  8409.             this.rawValue = null;
  8410.             this.found = false;
  8411.             if ($1y.length > 0) {
  8412.                 $1z = $1y.indexOf($A);
  8413.                 if ($1z != -1) {
  8414.                     $1z += $A.length;
  8415.                     end = $1y.indexOf(";", $1z);
  8416.                     if (end == -1) {
  8417.                         end = $1y.length;
  8418.                     }
  8419.                     ;
  8420.                     this.rawValue = $1y.substring($1z, end);
  8421.                     this.found = true;
  8422.                 }
  8423.             }
  8424.             ;
  8425.             if (this.rawValue != null) {
  8426.                 var sl = this.rawValue.length;
  8427.                 var $1A = 0;
  8428.                 var $1B = 0;
  8429.                 var i = 0;
  8430.                 do {
  8431.                     $1B = this.rawValue.indexOf(this.fieldSeparator, $1A);
  8432.                     if ($1B != -1) {
  8433.                         var $1C = this.rawValue.substring($1A, $1B).split(this.durationSeperator);
  8434.                         var rV = $1C[0].split(this.keySeperator);
  8435.                         this.fields[rV[0]] = unescape(rV[1]);
  8436.                         this.fieldsDuration[rV[0]] = parseInt(unescape($1C[1]));
  8437.                         i++;
  8438.                         $1A = $1B + 1;
  8439.                     }
  8440.                 } while ($1B != -1 & $1B != (this.rawValue.length - 1));
  8441.             }
  8442.             ;
  8443.             return this.found;
  8444.         };
  8445.         this.getSize = function () {
  8446.             var $1D = new Date().getTime();
  8447.             var $1E = "";
  8448.             for (i in this.fields) {
  8449.                 if (this.fieldsDuration[i] >= $1D) {
  8450.                     $1E +=
  8451.                             escape(i) + this.keySeperator + escape(this.fields[i]) + this.durationSeperator + escape(this.fieldsDuration[i])
  8452.                             + this.fieldSeparator;
  8453.                 }
  8454.             }
  8455.             ;
  8456.             return $1E.length;
  8457.         };
  8458.         this.write = function () {
  8459.             var $1D = new Date().getTime();
  8460.             var $1F = true;
  8461.             var $1E = this.name + "=";
  8462.             for (i in this.fields) {
  8463.                 if (this.fieldsDuration[i] >= $1D) {
  8464.                     $1E +=
  8465.                             escape(i) + this.keySeperator + escape(this.fields[i]) + this.durationSeperator + escape(this.fieldsDuration[i])
  8466.                             + this.fieldSeparator;
  8467.                     $1F = false;
  8468.                 }
  8469.             }
  8470.             ;
  8471.             var $1G = ($1F) ? -99999 : this.expires;
  8472.             if ($1G != "") {
  8473.                 if (typeof($1G) == "number") {
  8474.                     var $1H = new Date();
  8475.                     var $1I = new Date();
  8476.                     $1I.setTime($1H.getTime() + 1000 * 60 * 60 * 24 * $1G);
  8477.                     $1E += "; expires=" + $1I.toGMTString();
  8478.                 }
  8479.                 else {
  8480.                     $1E += "; expires=" + $1G.toGMTString();
  8481.                 }
  8482.             }
  8483.             ;
  8484.             if (this.accessPath != null) {
  8485.                 $1E += "; PATH=" + this.accessPath;
  8486.             }
  8487.             ;
  8488.             var d = location.hostname;
  8489.             var $V = "^[0-9]{1,3" + String.fromCharCode(125) + "\.[0-9]{1,3" + String.fromCharCode(125) + "\.[0-9]{1,3" + String.fromCharCode(125)
  8490.                     + "\.[0-9]{1,3" + String.fromCharCode(125) + "$";
  8491.             if (d.search($V) == -1) {
  8492.                 d = location.hostname.split(".");
  8493.                 d = d[d.length - 2] + "." + d[d.length - 1];
  8494.             }
  8495.             ;
  8496.             $1E += "; DOMAIN=" + d;
  8497.             document.cookie = $1E;
  8498.             return null;
  8499.         };
  8500.         this.remove = function () {
  8501.             this.expires = -10;
  8502.             this.write();
  8503.             return this.read();
  8504.         };
  8505.         this.get = function ($1J) {
  8506.             var $1D = new Date().getTime();
  8507.             if (this.fieldsDuration[$1J] >= $1D) {
  8508.                 return this.fields[$1J];
  8509.             }
  8510.             ;
  8511.             return"";
  8512.         };
  8513.         this.set = function ($1J, $1K, $U, $c, $1L) {
  8514.             if (!$U) {
  8515.                 $U = 31536000;
  8516.             }
  8517.             ;
  8518.             if (!$c) {
  8519.                 $c = "";
  8520.             }
  8521.             ;
  8522.             var $1D = new Date().getTime();
  8523.             if ($c == "first" && this.fields[$1J] != "" && this.fields[$1J] != null && this.fieldsDuration[$1J] >= $1D) {
  8524.                 return this.fields[$1J];
  8525.             }
  8526.             ;
  8527.             this.fields[$1J] = $1K;
  8528.             this.fieldsDuration[$1J] = $1D + (parseInt($U) * 1000);
  8529.             if (!$1L) {
  8530.                 this.write();
  8531.             }
  8532.             ;
  8533.             return $1K;
  8534.         };
  8535.         this.prepare = function ($1J, $1K, $U, $c) {
  8536.             this.set($1J, $1K, $U, $c, true);
  8537.         };
  8538.         this.read();
  8539.     };
  8540. };
  8541. var webtrekkPixel = false;
  8542. function wt_sendinfo(p, mode, ep) {
  8543.     if (webtrekkPixel) {
  8544.         for (var i in webtrekk) {
  8545.             if (i != "plugins" && i != "sendinfo") {
  8546.                 webtrekkPixel[i] = webtrekk[i];
  8547.             }
  8548.         }
  8549.         webtrekkPixel.sendinfo(false, p, mode, ep);
  8550.     }
  8551. }
  8552. if (typeof(webtrekk) == "object") {
  8553.     webtrekkConfig = webtrekk;
  8554.     webtrekkPixel = new webtrekkV3();
  8555.     if (typeof(wt_updatePixel) == "function") {
  8556.         wt_updatePixel();
  8557.     }
  8558.     if (webtrekk.sendinfo && webtrekk.sendinfo == '1') {
  8559.         webtrekkPixel.sendinfo();
  8560.     }
  8561. }
  8562. ;
  8563. ;
  8564. var ___b24 = ___b24 || {};
  8565. ___b24.webtrekk = (function (window, $) {
  8566.     var tracking = B24_debug_status.getMode('tracking');
  8567.     var pub = {};
  8568.     var done = false;
  8569.     var init = function () {
  8570.         if (!tracking) {
  8571.             return false;
  8572.         }
  8573.         if (typeof(webtrekkV3) != 'function') {
  8574.             return false;
  8575.         }
  8576.         basicCall();
  8577.     };
  8578.     var DOMready = function () {
  8579.         if (done) {
  8580.             return false;
  8581.         }
  8582.         stopTrackingByConversionComment();
  8583.         if (!tracking) {
  8584.             return false;
  8585.         }
  8586.         if (typeof(wt) != 'object') {
  8587.             return false;
  8588.         }
  8589.         setUpWebtrekkDomReady();
  8590.         done = true;
  8591.     };
  8592.     pub.DOMready = DOMready;
  8593.     var stopTrackingByConversionComment = function () {
  8594.         var order = B24_order_object.getOrder();
  8595.         if (!!order && typeof(order.customer_comment) == 'string' && !!order.customer_comment.match(/\#test\#/i)) {
  8596.             tracking = false;
  8597.         }
  8598.     };
  8599.     var basicCall = function () {
  8600.         var contentID = '';
  8601.         window.pageConfig = {'linkTrack': "standard", 'heatmap': "0", 'form': "0", 'contentId': contentID};
  8602.         window.wt = new webtrekkV3(window.pageConfig);
  8603.         wt.domain =
  8604.                 "REGEXP:^(.*smartassistant.*|www\.paypal\\.com|secure\\.ogone\\.com|www\\.sofort\\.com|www\\.gambio\\.de|asset.brille24\\..*|www\\.brille24\\..*)$";
  8605.         var query = collectEntryParams();
  8606.         if (!!query) {
  8607.             wt.mediaCode = 'ad;ad_cj;ad_zx;ad_sa;utm_campaign;ad_bel';
  8608.             wt.customCampaignParameter = {8: query};
  8609.         }
  8610.     };
  8611.     pub.pageView = function (page) {
  8612.         if (typeof(wt) == 'object') {
  8613.             wt.sendinfo({'contentId': page});
  8614.         }
  8615.     };
  8616.     var collectEntryParams = function () {
  8617.         var which = ['utm_source', 'utm_medium', 'simidb24', 'cidb24'];
  8618.         var what = false;
  8619.         $.each(which, function (index, value) {
  8620.             if (typeof($.getlocations().params[value]) == 'string') {
  8621.                 what = what || {};
  8622.                 what[value] = $.getlocations().params[value];
  8623.             }
  8624.         });
  8625.         if (!!what) {
  8626.             what = JSON.stringify(what);
  8627.             return what;
  8628.         }
  8629.         return false;
  8630.     };
  8631.     pub.collectEntryParams = collectEntryParams;
  8632.     var setUpWebtrekkDomReady = function () {
  8633.         var mageParams = B24_shoplocation.getMageParams();
  8634.         wt.customSessionParameter = {};
  8635.         if (!!mageParams.Q) {
  8636.             wt.customSessionParameter['1'] = mageParams.Q;
  8637.         }
  8638.         wt.customSessionParameter['2'] = mageParams.S;
  8639.         if (!!mageParams.C) {
  8640.             wt.customerId = mageParams.C;
  8641.         }
  8642.         var loc = B24_shoplocation.get();
  8643.         var order = B24_order_object.getOrder();
  8644.         if (loc == 'detail') {
  8645.             var product = B24_product_object.get();
  8646.             wt.product = product.name;
  8647.             wt.productCategory = {1: B24_shoplocation.getCategory()};
  8648.             wt.productQuantity = "1";
  8649.             wt.productCost = product.price;
  8650.             wt.productStatus = "view";
  8651.             wt.customEcommerceParameter = {1: '', 2: product.sku, 3: '', 4: ''};
  8652.         }
  8653.         else if (loc == 'cart') {
  8654.             var cart = B24_cart_object.getCart();
  8655.             if (B24_cart_object.getCartAction().action == 'add') {
  8656.                 added_items = B24_cart_object.getCartAction().balance;
  8657.                 var prods = [];
  8658.                 var qtys = [];
  8659.                 var costs = [];
  8660.                 var skus = [];
  8661.                 $.each(added_items, function (index, value) {
  8662.                     prods.push(value.product_name.substr(0, 100));
  8663.                     qtys.push(parseInt(value.qty_ordered));
  8664.                     costs.push(value.netTotalItemSingleShipping);
  8665.                     skus.push(value.product_sku);
  8666.                 });
  8667.                 wt.product = prods.join(';');
  8668.                 wt.productQuantity = qtys.join(';');
  8669.                 wt.productCost = costs.join(';');
  8670.                 wt.productStatus = "add";
  8671.                 wt.customEcommerceParameter = {1: mageParams.Q, 2: skus.join(';'), 3: '', 4: ''};
  8672.             }
  8673.         }
  8674.         else if (!!order) {
  8675.             var prods = [];
  8676.             var qtys = [];
  8677.             var costs = [];
  8678.             var skus = [];
  8679.             $.each(order.order_items, function (index, value) {
  8680.                 prods.push(value.product_name.substr(0, 100));
  8681.                 qtys.push(parseInt(value.qty_ordered));
  8682.                 costs.push(value.netTotalItemShippment);
  8683.                 skus.push(value.product_sku);
  8684.             });
  8685.             wt.product = prods.join(';');
  8686.             wt.productQuantity = qtys.join(';');
  8687.             wt.productCost = costs.join(';');
  8688.             wt.productStatus = "conf";
  8689.             wt.orderValue = order.payment.amount_ordered;
  8690.             wt.orderId = order.id;
  8691.             wt.customEcommerceParameter = {1: order.quoteID, 2: skus.join(';'), 3: '', 4: '', 5: B24_cpid_object.getCpid()};
  8692.         }
  8693.         else if (loc == 'checkout') {
  8694.             return false;
  8695.         }
  8696.         ___l(wt, 'webtrekk');
  8697.         wt.sendinfo();
  8698.     };
  8699.     init();
  8700.     $(DOMready);
  8701.     return pub;
  8702. })(window, jQuery, undefined);
  8703. ;
  8704. ;
  8705. var ___b24 = ___b24 || {};
  8706. ___b24.channeladvisor = (function (window, $) {
  8707.     var pub = {};
  8708.     var tracking = B24_debug_status.getMode('tracking');
  8709.     var init = function () {
  8710.         if (!tracking) {
  8711.             return false;
  8712.         }
  8713.         window._caq = window._caq || [];
  8714.         var url = "//t.channeladvisor.com/v2/12012621.js";
  8715.         ___b24.loadscript.load(url);
  8716.     };
  8717.     var transAction = function () {
  8718.         if (!tracking) {
  8719.             return false;
  8720.         }
  8721.         var order = B24_order_object.getOrder();
  8722.         if (!order || !order.tracking) {
  8723.             return false;
  8724.         }
  8725.         window._caq = window._caq || [];
  8726.         var products = [];
  8727.         $.each(order.order_items, function (index, value) {
  8728.             products.push({Sku: value.product_sku_extended, UnitPrice: value.netTotalSingle, Quantity: value.qty_ordered});
  8729.         });
  8730.         var trans = ["Order", {OrderId: order.id, Revenue: order.payment.totalClean, CurrencyCode: 'EUR', Products: products}];
  8731.         ___l(trans, 'ChannelAdvisor');
  8732.         _caq.push(trans);
  8733.     };
  8734.     pub.transAction = transAction;
  8735.     init();
  8736.     return pub;
  8737. })(window, jQuery, undefined);
  8738. ;
  8739. ;
  8740. var ___b24 = ___b24 || {};
  8741. ___b24.controlgroup = (function (window, $) {
  8742.     var pub = {}, storageName = '_b24a', tracking = B24_debug_status.getMode('tracking'), group = null, expTTL = 30;
  8743.     var get = function () {
  8744.         if (!tracking) {
  8745.             return false;
  8746.         }
  8747.         if (!!getStored()) {
  8748.             return getStored();
  8749.         }
  8750.         store(randomGroup());
  8751.         return getStored();
  8752.     };
  8753.     pub.get = get;
  8754.     var randomGroup = function () {
  8755.         return Math.random() * 10 > 5 ? 'A' : 'B';
  8756.     };
  8757.     var getStored = function () {
  8758.         if (group !== null) {
  8759.             return group;
  8760.         }
  8761.         group = $.cookie(storageName);
  8762.         return group
  8763.     };
  8764.     var store = function (s) {
  8765.         $.cookie(storageName, s, {'path': '/', 'expires': expTTL});
  8766.     };
  8767.     return pub;
  8768. })(window, jQuery, undefined);
  8769. ___b24.tracking = (function (window, $) {
  8770.     var pub = {}, tracking = B24_debug_status.getMode('tracking');
  8771.     debug = B24_debug_status.getMode('ga'), live = B24_debug_status.getMode('live');
  8772.     var init = function () {
  8773.         if (!tracking) {
  8774.             window.ga = function () {
  8775.                 var empty = true;
  8776.             };
  8777.             return false;
  8778.         }
  8779.         setupGoogleAnalytics();
  8780.     };
  8781.     var domReady = function () {
  8782.         sendCartEvents();
  8783.     };
  8784.     var setupGoogleAnalytics = function () {
  8785.         var gaID = live ? 'UA-8525683-1' : 'UA-8525683-5';
  8786.         var fileexent = debug ? '_debug' : '';
  8787.         (function (i, s, o, g, r, a, m) {
  8788.             i['GoogleAnalyticsObject'] = r;
  8789.             i[r] = i[r] || function () {
  8790.                 (i[r].q = i[r].q || []).push(arguments)
  8791.             }, i[r].l = 1 * new Date();
  8792.             a = s.createElement(o), m = s.getElementsByTagName(o)[0];
  8793.             a.async = 1;
  8794.             a.src = g;
  8795.             m.parentNode.insertBefore(a, m)
  8796.         })(window, document, 'script', '//www.google-analytics.com/analytics' + fileexent + '.js', 'ga');
  8797.         ga(function () {
  8798.             callback('start')
  8799.         });
  8800.         var uid = B24_customer_object.getCustomerId();
  8801.         if (!uid) {
  8802.             ga('create', gaID, 'auto');
  8803.         }
  8804.         else {
  8805.             ga('create', gaID, 'auto', {'userId': uid.toString()});
  8806.         }
  8807.         ga('set', 'anonymizeIp', true);
  8808.         ga('require', 'linkid', 'linkid.js', {'levels': 5});
  8809.         ga('require', 'displayfeatures');
  8810.         page();
  8811.         ga(function () {
  8812.             callback('end')
  8813.         });
  8814.     };
  8815.     var page = function (p) {
  8816.         if (!!p) {
  8817.             ga('send', 'pageview', p);
  8818.             return true;
  8819.         }
  8820.         var pageEr = checkErrorPage();
  8821.         if (pageEr.is) {
  8822.             ga('send',
  8823.                     'pageview',
  8824.                     {'page': pageEr.where + '?page=' + document.location + '&from=' + document.referrer, 'title': pageEr.what + document.title});
  8825.             return true;
  8826.         }
  8827.         ga('send', 'pageview');
  8828.         return true;
  8829.     };
  8830.     pub.page = page;
  8831.     var checkErrorPage = function () {
  8832.         var a = {is: false, what: ''};
  8833.         if (!!document.title.match(/nicht gefunden/i)) {
  8834.             a = {is: true, what: 'ERROR_404::: ', where: '/404.html'};
  8835.         }
  8836.         return a;
  8837.     };
  8838.     var callback = function (a) {
  8839.         if (debug) {
  8840.             ___l('google analytics ' + a)
  8841.         }
  8842.         ;
  8843.     };
  8844.     var eCommerce = function () {
  8845.         if (!tracking) {
  8846.             return false;
  8847.         }
  8848.         var order = B24_order_object.getOrder();
  8849.         if (!order) {
  8850.             return false;
  8851.         }
  8852.         if (typeof(order.customer_comment) == 'string' && order.customer_comment.match(/\#test\#/i) != null) {
  8853.             return false;
  8854.         }
  8855.         ga('require', 'ecommerce', 'ecommerce.js');
  8856.         ga('ecommerce:addTransaction', {'id': order.id.toString(), 'revenue': order.payment.amount_ordered.toString(), 'shipping': '0', 'tax': '0'});
  8857.         $.each(order.order_items, function (key, value) {
  8858.             ga('ecommerce:addItem',
  8859.                     {'id': order.id.toString(), 'name': value.product_name, 'sku': value.product_sku_extended_index, 'category': value.product_type_name, 'price': value.bruttoTotal.toString(), 'quantity': value.qty_ordered, });
  8860.         });
  8861.         ga('ecommerce:send');
  8862.     };
  8863.     pub.eCommerce = eCommerce;
  8864.     var sendCartEvents = function () {
  8865.         if (!tracking) {
  8866.             return false;
  8867.         }
  8868.         if (B24_shoplocation.get() == 'cart') {
  8869.             B24_cart_object.getCart();
  8870.             ga('send', 'event', 'Warenkorb', B24_cart_object.getCartStatus(), B24_cart_object.getCustomerStatus());
  8871.         }
  8872.     };
  8873.     var error = function (pos, err) {
  8874.         if (typeof(pos) != 'string' && typeof(pos) != 'number') {
  8875.             pos = 'ThereIsNoCorrectPosition';
  8876.         }
  8877.         pos += ':::' + location.pathname;
  8878.         if (!!!err) {
  8879.             err = 'undefined';
  8880.         }
  8881.         if ($.type(err) == 'error') {
  8882.             err = err.toString();
  8883.         }
  8884.         else if (typeof(err) == 'object') {
  8885.             err = JSON.stringify(err);
  8886.         }
  8887.         ga('send', 'event', 'JS-Errors', pos, err, {'nonInteraction': true});
  8888.     };
  8889.     pub.error = error;
  8890.     var PVevent = function (pos, content) {
  8891.         if (typeof(pos) != 'string' && typeof(pos) != 'number') {
  8892.             pos = 'ThereIsNoCorrectPosition';
  8893.         }
  8894.         if (!!!content) {
  8895.             content = 'undefined';
  8896.         }
  8897.         if ($.type(content) == 'error') {
  8898.             content = content.toString();
  8899.         }
  8900.         else if (typeof(content) == 'object') {
  8901.             content = JSON.stringify(content);
  8902.         }
  8903.         content = content.toString();
  8904.         ga('send', 'event', 'ProductView', pos, content, {'nonInteraction': true});
  8905.     };
  8906.     pub.PVevent = PVevent;
  8907.     var alert = function (pos, alertM) {
  8908.         if (typeof(pos) != 'string' && typeof(pos) != 'number') {
  8909.             pos = 'ThereIsNoCorrectPosition';
  8910.         }
  8911.         pos += ':::' + location.pathname;
  8912.         var quteID = '';
  8913.         if (typeof(B24_shoplocation) === 'object' && typeof(B24_shoplocation.getMageParams().Q) === 'string') {
  8914.             quteID = '#quoteID=' + B24_shoplocation.getMageParams().Q;
  8915.         }
  8916.         pos += quteID;
  8917.         if (!!!alertM) {
  8918.             alertM = 'undefined';
  8919.         }
  8920.         if (typeof(alertM) == 'object') {
  8921.             alertM = JSON.stringify(alertM);
  8922.         }
  8923.         alertM = alertM.substr(0, 60);
  8924.         ga('send', 'event', 'JS-Alert', pos, alertM, {'nonInteraction': true});
  8925.     };
  8926.     pub.alert = alert;
  8927.     var event = function (pos, evt) {
  8928.         if (typeof(pos) != 'string' && typeof(pos) != 'number') {
  8929.             pos = 'ThereIsNoCorrectPosition';
  8930.         }
  8931.         pos += ':::' + location.pathname;
  8932.         if (!!!evt) {
  8933.             evt = 'undefined';
  8934.         }
  8935.         if (typeof(evt) == 'object') {
  8936.             evt = JSON.stringify(evt);
  8937.         }
  8938.         evt = evt.substr(0, 60);
  8939.         ga('send', 'event', 'JS-Event', pos, evt, {'nonInteraction': true});
  8940.     };
  8941.     pub.event = event;
  8942.     var trackingEvent = function (pos, evt) {
  8943.         if (typeof(pos) != 'string' && typeof(pos) != 'number') {
  8944.             pos = 'ThereIsNoCorrectPosition';
  8945.         }
  8946.         pos += ':::' + location.pathname;
  8947.         if (!!!evt) {
  8948.             evt = 'undefined';
  8949.         }
  8950.         if (typeof(evt) == 'object') {
  8951.             evt = JSON.stringify(evt);
  8952.         }
  8953.         evt = evt.substr(0, 100);
  8954.         ga('send', 'event', 'TrackingEvents', pos, evt, {'nonInteraction': true});
  8955.     };
  8956.     pub.trackingEvent = trackingEvent;
  8957.     var freeEvent = function (name, pos, evt) {
  8958.         if (typeof(evt) == 'object') {
  8959.             evt = JSON.stringify(evt);
  8960.         }
  8961.         else if (typeof(evt) == 'undefined') {
  8962.             evt = location.pathname;
  8963.         }
  8964.         ga('send', 'event', name, pos, evt, {'nonInteraction': true});
  8965.     };
  8966.     pub.freeEvent = freeEvent;
  8967.     pub.search = function (searchPhrase) {
  8968.         pos = location.pathname;
  8969.         ga('send', 'event', 'Search', pos, {'nonInteraction': true});
  8970.     };
  8971.     $(domReady);
  8972.     init();
  8973.     return pub;
  8974. })(window, jQuery, undefined);
  8975. var ___b24 = ___b24 || {};
  8976. ___b24.peak = (function (window, $) {
  8977.     var pub = {};
  8978.     var peak = false;
  8979.     var virgin = null;
  8980.     var connections = -1;
  8981.     var peakMap = [100, 100, 100, 100, 100, 100, 200, 250, 250, 280, 300, 300, 300, 300, 300, 300, 300, 350, 400, 440, 480, 440, 400, 180];
  8982.     var init = function () {
  8983.     };
  8984.     var setVirgin = function () {
  8985.         $.cookie('___peakvir', '1', {path: '/'});
  8986.     };
  8987.     var getVirgin = function () {
  8988.         if (virgin != null) {
  8989.             return virgin;
  8990.         }
  8991.         if (!!$.cookie('___peakvir')) {
  8992.             virgin = false;
  8993.         }
  8994.         else {
  8995.             setVirgin();
  8996.             virgin = true;
  8997.         }
  8998.         return virgin;
  8999.     };
  9000.     var isPeakVirgin = function () {
  9001.         if (getVirgin() && isPeak()) {
  9002.             return true;
  9003.         }
  9004.         return false;
  9005.     };
  9006.     pub.isPeakVirgin = isPeakVirgin;
  9007.     var isPeak = function () {
  9008.         if (getConnections() > peakMap[new Date().getHours()]) {
  9009.             peak = true;
  9010.         }
  9011.         else {
  9012.             peak = false;
  9013.         }
  9014.         return peak;
  9015.     };
  9016.     pub.isPeak = isPeak;
  9017.     var isTVDirect = function () {
  9018.         if (!isPeakVirgin()) {
  9019.             return false;
  9020.         }
  9021.         if (!!$.getlocations().params.utm_source) {
  9022.             if (!!$.getlocations().params.utm_source.match(/^google|yahoo|bing$/i) && !!$.getlocations().params.utm_medium
  9023.                     && $.getlocations().params.utm_medium == 'cpc') {
  9024.                 return true;
  9025.             }
  9026.             else {
  9027.                 return false;
  9028.             }
  9029.         }
  9030.         var ref = document.referrer;
  9031.         if (!!document.referrer.match(/^()|(google\.)|(yahoo\.)|(bing\.)$/i)) {
  9032.             return true;
  9033.         }
  9034.         var utmz = $.cookie('__utmz');
  9035.         if (!utmz) {
  9036.             utmz = '';
  9037.         }
  9038.         if (!!utmz.match(/(utmcmd=organic)|(utmcsr=googleutmcmd=cpc)/i)) {
  9039.             return true;
  9040.         }
  9041.         return false;
  9042.     };
  9043.     pub.isTVDirect = isTVDirect;
  9044.     var getConnections = function () {
  9045.         if (connections > -1) {
  9046.             return connections;
  9047.         }
  9048.         if (!!$.cookie('___peak')) {
  9049.             connections = $.cookie('___peak');
  9050.         }
  9051.         else {
  9052.             connections = 1;
  9053.         }
  9054.         return connections;
  9055.     };
  9056.     pub.getConnections = getConnections;
  9057.     var getTimeConnectionMaped = function () {
  9058.         var t = new Date().getHours();
  9059.         return{'t': t, 'connections': getConnections(), 'peakMap': peakMap[new Date().getHours()]};
  9060.     };
  9061.     pub.getTimeConnectionMaped = getTimeConnectionMaped;
  9062.     return pub;
  9063. })(window, jQuery, undefined);
  9064. var ___b24 = ___b24 || {};
  9065. ___b24.analytics = (function (window, $) {
  9066.     var pub = {};
  9067.     var debug = B24_debug_status.getMode('ga');
  9068.     var tracking = B24_debug_status.getMode('tracking');
  9069.     var live = B24_debug_status.getMode('live');
  9070.     var done = false;
  9071.     var init = function () {
  9072.         setUpChartbeat();
  9073.     };
  9074.     var DOMready = function (fast) {
  9075.         if (done) {
  9076.             return false;
  9077.         }
  9078.         done = true;
  9079.         stopTrackingByConversionComment();
  9080.         $('body').append('<div id="dynamic">&nbsp;</div>');
  9081.         ___b24.tracking.eCommerce();
  9082.         setUpDivolution();
  9083.         ___b24.trackRDE.track();
  9084.         ___b24.channeladvisor.transAction();
  9085.         setUpSociomantic();
  9086.         setUpEcomcon();
  9087.         setUpAdTelligence();
  9088.         setUpAdScale();
  9089.         if (typeof(fast) == 'boolean' && fast) {
  9090.             setTimeout(task, 1000);
  9091.         }
  9092.         else {
  9093.             task();
  9094.         }
  9095.         return true;
  9096.     };
  9097.     pub.DOMready = DOMready;
  9098.     var task = function () {
  9099.         setUpAdition();
  9100.         finalChartbeat();
  9101.         googleRemarketing();
  9102.         setUpZanoxMaster();
  9103.         selligent();
  9104.         setUpXplosion();
  9105.         setupBelboon();
  9106.         setUpYahooReMarketing();
  9107.         setUpZanox();
  9108.         setUpCommissionJunction();
  9109.         setUpUDMarin();
  9110.         setUpFacebookConversion();
  9111.         setUpEthno();
  9112.         latenzReady();
  9113.         return true;
  9114.     };
  9115.     var latenzReady = function () {
  9116.         setTimeout(function () {
  9117.             setUpUniqueDigital();
  9118.         }, 2000);
  9119.     };
  9120.     $(function () {
  9121.         sovendusGutscheinConnection();
  9122.         setUpTharuka();
  9123.         setUpSchutzKlick();
  9124.     });
  9125.     var stopTrackingByConversionComment = function () {
  9126.         var order = B24_order_object.getOrder();
  9127.         if (!!order && typeof(order.customer_comment) == 'string' && !!order.customer_comment.match(/\#test\#/i)) {
  9128.             tracking = false;
  9129.         }
  9130.     };
  9131.     var setUpAdScale = function () {
  9132.         if (!tracking) {
  9133.             return false;
  9134.         }
  9135.         try {
  9136.             window.adscaleProductViews = window.adscaleProductViews ? window.adscaleProductViews : [];
  9137.             var url = '//js.adscale.de/pbr-a.js', asID = '14742', products = [''], categorys = [''], pages = [''], $dompart = $('<ins style="display: none;" class="adscale-rt" data-accountId="14742" />'), pixelName = 'error';
  9138.             var loc = B24_shoplocation.get(), order = B24_order_object.getOrder(), cart = B24_cart_object.getCart();
  9139.             if (loc === 'homepage') {
  9140.                 pixelName = 'Homepage';
  9141.                 pages = ['homepage'];
  9142.             }
  9143.             else if (loc === 'listing') {
  9144.                 pixelName = 'Category';
  9145.                 pages = ['category'];
  9146.                 categorys = [B24_shoplocation.getCategory(true)];
  9147.             }
  9148.             else if (loc === 'detail') {
  9149.                 pixelName = 'Product';
  9150.                 pages = ['product'];
  9151.                 categorys = [B24_shoplocation.getCategory(true)];
  9152.                 products = [B24_product_object.get().sku_extended_clean];
  9153.             }
  9154.             else if (loc == 'cart') {
  9155.                 pixelName = 'basket';
  9156.                 pages = ['basket'];
  9157.                 if (!!cart) {
  9158.                     products = [];
  9159.                     $.each(cart.order_items, function (key, value) {
  9160.                         products.push(value.product_sku_extended_clean);
  9161.                     });
  9162.                 }
  9163.             }
  9164.             else if (loc == 'success') {
  9165.                 pixelName = 'Transaction';
  9166.                 pages = ['transactions'];
  9167.                 if (!!order) {
  9168.                     products = [];
  9169.                     $.each(order.order_items, function (key, value) {
  9170.                         products.push(value.product_sku_extended_clean);
  9171.                     });
  9172.                     $dompart.attr({'data-pixelName': '1', 'data-accountId': 'ZTY1ODA'}).addClass('adscale-cpx');
  9173.                     ___b24.loadscript.putDOM($dompart);
  9174.                     ___b24.loadscript.load('//js.adscale.de/cpx-a.js');
  9175.                 }
  9176.                 else {
  9177.                     return false;
  9178.                 }
  9179.             }
  9180.             else {
  9181.                 return false;
  9182.             }
  9183.             window.adscaleProductViews.push({"aid": asID, "productIds": products, "categoryIds": categorys, "pageTypes": pages, });
  9184.             ___l(window.adscaleProductViews, 'Adscale');
  9185.             ___b24.loadscript.load(url);
  9186.             $dompart.attr('data-pixelName', pixelName).addClass('adscale-rt');
  9187.             ___b24.loadscript.putDOM($dompart);
  9188.             ___b24.loadscript.load('//js.adscale.de/rt-a.js');
  9189.             return true;
  9190.         }
  9191.         catch (err) {
  9192.             ___b24.tracking.error('analytics.setUpAdScale', err);
  9193.         }
  9194.     };
  9195.     var setUpAdTelligence = function () {
  9196.         if (!tracking) {
  9197.             return false;
  9198.         }
  9199.         try {
  9200.             var url = "//www.example.org";
  9201.             var products = [];
  9202.             var loc = B24_shoplocation.get();
  9203.             var order = B24_order_object.getOrder();
  9204.             var cart = B24_cart_object.getCart();
  9205.             if (!!order) {
  9206.                 $.each(order.order_items, function (key, value) {
  9207.                     products.push(value.product_sku_extended);
  9208.                 });
  9209.                 products = products.join('|');
  9210.                 url = '//brille24-service.adtelligence.de/convertplus-web-rest/rest/action/2/1?objective=6&epc=true&product=' + products;
  9211.                 ___l(url, 'AdTelligence');
  9212.                 ___b24.loadscript.loadImg(url);
  9213.             }
  9214.             else if (!!cart) {
  9215.                 var comparedCarts = B24_cart_object.compareCarts();
  9216.                 if (comparedCarts.action != 'add') {
  9217.                     return false;
  9218.                 }
  9219.                 $.each(comparedCarts.balance, function (key, value) {
  9220.                     products.push(value.product_sku_extended);
  9221.                 });
  9222.                 products = products.join('|');
  9223.                 url = '//brille24-service.adtelligence.de/convertplus-web-rest/rest/action/2/1?objective=5&epc=true&product=' + products;
  9224.                 ___l(url, 'AdTelligence');
  9225.                 ___b24.loadscript.loadImg(url);
  9226.             }
  9227.             else if (loc == 'detail') {
  9228.                 var product = B24_product_object.get().sku_extended;
  9229.                 url = '//brille24-service.adtelligence.de/convertplus-web-rest/rest/action/2/1?objective=7&epc=true&product=' + product;
  9230.                 ___l(url, 'AdTelligence');
  9231.                 ___b24.loadscript.loadImg(url);
  9232.             }
  9233.             else {
  9234.                 return false;
  9235.             }
  9236.             return true;
  9237.         }
  9238.         catch (err) {
  9239.             ___b24.tracking.error('analytics.setUpAdTelligence', err);
  9240.         }
  9241.     };
  9242.     var setUpTharuka = function () {
  9243.         if (!tracking) {
  9244.             return false;
  9245.         }
  9246.         try {
  9247.             var order = B24_order_object.getOrder(true);
  9248.             if (!location.pathname.match(/\/success\/?/i)) {
  9249.                 return false;
  9250.             }
  9251.             var loc = B24_shoplocation.get();
  9252.             if (!order) {
  9253.                 return false;
  9254.             }
  9255.             var salutation = order.customer.gender != 'm' ? 'Frau' : 'Herr';
  9256.             var dob = order.customer.dob;
  9257.             var street = order.billing_address.street.replace(/ +\d[-\da-z]*$/i, '');
  9258.             var num = order.billing_address.street.replace(/^.+ +(\d[-\da-z]*)$/i, '$1');
  9259.             var byear;
  9260.             if (dob === false) {
  9261.                 dob = '';
  9262.                 byear = '';
  9263.             }
  9264.             else {
  9265.                 byear = dob.replace(/^(\d+)-(\d+)-(\d+)$/i, '$1');
  9266.                 dob = dob.replace(/^(\d+)-(\d+)-(\d+)$/i, '$3.$2');
  9267.             }
  9268.             var country = order.billing_address.country;
  9269.             if (!!country.match(/germany/i)) {
  9270.                 country = 'D';
  9271.             }
  9272.             if (!!country.match(/austria/i)) {
  9273.                 country = 'A';
  9274.             }
  9275.             if (!!country.match(/switzerland/i)) {
  9276.                 country = 'CH';
  9277.             }
  9278.             window.THFilter = {anrede: salutation, plz: order.billing_address.postcode, land: country, gebJahr: byear};
  9279.             window.THPrefill =
  9280.             {anrede: salutation, vorname: order.customer.firstname, name: order.customer.lastname, strasse: street, hausnummer: num, plz: order.billing_address.postcode, ort: order.billing_address.city, email: order.customer.email, tel: '', gebJahr: byear, gebTag: dob};
  9281.             ___l(window.THFilter, 'TharukaFilter');
  9282.             ___l(window.THPrefill, 'TharukaPrefill');
  9283.             ___b24.loadscript.load('//tharuka-app.de/api/576/tharuka.js');
  9284.         }
  9285.         catch (err) {
  9286.             ___b24.tracking.error('analytics.setUpTharuka', err);
  9287.         }
  9288.     };
  9289.     var sovendusGutscheinConnection = function () {
  9290.         if (!tracking) {
  9291.             return false;
  9292.         }
  9293.         try {
  9294.             var order = B24_order_object.getOrder(true);
  9295.             if (!!order) {
  9296.                 ___b24.tracking.trackingEvent('sovendus', 'gotOrder');
  9297.             }
  9298.             if (!location.pathname.match(/\/success\/?/i)) {
  9299.                 return false;
  9300.             }
  9301.             ___b24.tracking.trackingEvent('sovendus', 'locationHit');
  9302.             if (!!order) {
  9303.                 var _API_Key = '395ab25dcf8' + 'f02b0' + '0989ba';
  9304.                 window._gconData = window._gconData || [];
  9305.                 var _partnerID = '679';
  9306.                 _gconData.push(['_partnerId', _partnerID]);
  9307.                 var _bannerID = '2';
  9308.                 _gconData.push(['_bannerId', _bannerID]);
  9309.                 var _sessionID = order.customer.id;
  9310.                 _gconData.push(['_sessionId', _sessionID]);
  9311.                 var _timestamp = Math.round(new Date().getTime() / 1000);
  9312.                 _gconData.push(['_timestamp', _timestamp]);
  9313.                 _gconData.push(['_customerSalutation', order.customer.gender === 'm' ? 'Herr' : 'Frau']);
  9314.                 _gconData.push(['_customerFirstName', order.customer.firstname]);
  9315.                 _gconData.push(['_customerLastName', order.customer.lastname]);
  9316.                 _gconData.push(['_customerEmail', order.customer.email]);
  9317.                 _gconData.push(['_orderId', '']);
  9318.                 _gconData.push(['_orderValue', '']);
  9319.                 _gconData.push(['_orderCurrency', 'EUR']);
  9320.                 var _usedCouponCode = order.discount_description;
  9321.                 if (_usedCouponCode.match(/^SOVENDUS/i) === null) {
  9322.                     _usedCouponCode = '';
  9323.                 }
  9324.                 _gconData.push(['_usedCouponCode', _usedCouponCode]);
  9325.                 var _checksum = _sessionID + _timestamp + _usedCouponCode + _API_Key;
  9326.                 _checksum = $.encoding.digests.hexSha1Str(_checksum);
  9327.                 _gconData.push(['_checksum', _checksum]);
  9328.                 ___l(window._gconData, 'Sovendus');
  9329.                 B24_load_script.loadScript('//api.gutscheinconnection.de/js/client.js');
  9330.                 ___b24.tracking.trackingEvent('sovendus', 'tracked');
  9331.                 if (!$('#gutscheinconnection-container').length) {
  9332.                     ___b24.tracking.error('analytics.sovendusGutscheinConnection', 'WARNING: There is no #gutscheinconnection-container');
  9333.                 }
  9334.                 return true;
  9335.             }
  9336.             return false;
  9337.         }
  9338.         catch (err) {
  9339.             ___b24.tracking.error('analytics.sovendusGutscheinConnection', err);
  9340.         }
  9341.     };
  9342.     var setUpSchutzKlick = function () {
  9343.         if (!tracking) {
  9344.             return false;
  9345.         }
  9346.         try {
  9347.             var order = B24_order_object.getOrder(true);
  9348.             if (!location.pathname.match(/\/success\/?/i)) {
  9349.                 return false;
  9350.             }
  9351.             if (!!order) {
  9352.                 if (!$('#schutzklick-container').length) {
  9353.                     ___b24.tracking.error('analytics.setUpSchutzKlick', 'WARNING: There is no #schutzklick-container');
  9354.                 }
  9355.                 var schutzklick_frame = '<iframe width="760" height="330" src="';
  9356.                 schutzklick_frame += 'https://www.schutzklick.de/wl/init?partner_id=5087&shop_id=1';
  9357.                 schutzklick_frame += '&utm_content=iframe';
  9358.                 schutzklick_frame += '&order_id=' + order.id;
  9359.                 schutzklick_frame += '&customer[email]=' + order.customer.email;
  9360.                 var i = 0;
  9361.                 var schutzklick_frame_t = '';
  9362.                 $.each(order.order_items, function (index, value) {
  9363.                     if (value.product_type_extended.sort == 'Glass') {
  9364.                         schutzklick_frame_t += '&products[' + i + '][category_id]=' + value.product_type;
  9365.                         schutzklick_frame_t += '&products[' + i + '][name]=' + value.product_name;
  9366.                         schutzklick_frame_t += '&products[' + i + '][price]=' + value.price;
  9367.                         schutzklick_frame_t += '&products[' + i + '][currency]=EUR';
  9368.                         schutzklick_frame_t += '&products[' + i + '][qty]=' + Math.round(value.qty_ordered);
  9369.                         schutzklick_frame_t += '&products[' + i + '][category_name]=' + value.product_type_extended.group;
  9370.                         schutzklick_frame_t += '&products[' + i + '][id]=';
  9371.                         schutzklick_frame_t += '&products[' + i + '][sku]=' + value.product_sku;
  9372.                         i++;
  9373.                     }
  9374.                     ;
  9375.                 });
  9376.                 schutzklick_frame += schutzklick_frame_t;
  9377.                 schutzklick_frame += '" scrolling="no" style="margin:1em"></iframe>';
  9378.                 if (i > 0) {
  9379.                     $('#schutzklick-container').html(schutzklick_frame);
  9380.                     return true;
  9381.                 }
  9382.                 else {
  9383.                     return false;
  9384.                 }
  9385.             }
  9386.         }
  9387.         catch (err) {
  9388.             ___b24.tracking.error('analytics.setUpSchutzKlick', err);
  9389.         }
  9390.     };
  9391.     var loadIFrame = function (url, params) {
  9392.         var getP = '?';
  9393.         if (typeof(params) == 'object') {
  9394.             $.each(params, function (key, value) {
  9395.                 getP += key + '=' + encodeURIComponent(value) + '&';
  9396.             });
  9397.             getP = getP.replace(/\&$/i, '');
  9398.         }
  9399.         url += getP;
  9400.         ___l(url, 'iFrame');
  9401.         $('<iframe />').attr({'class': 'visuallyhidden', 'src': url}).appendTo('body');
  9402.     };
  9403.     pub.loadIFrame = loadIFrame;
  9404.     var setUpDivolution = function () {
  9405.         if (!tracking) {
  9406.             return false;
  9407.         }
  9408.         if (!B24_debug_status.getMode('divolution')) {
  9409.             return false;
  9410.         }
  9411.         var ok = false;
  9412.         window.rt_clid = "divoluso_s195_EF5nhCtp4hx07|sitedivolu";
  9413.         window.rt_add = "";
  9414.         window.rt_sum = "";
  9415.         window.rt_async = true;
  9416.         var order = B24_order_object.getOrder();
  9417.         if (!!order) {
  9418.             var products = [];
  9419.             $.each(order.order_items, function (index, value) {
  9420.                 products.push(value.product_type_name);
  9421.             });
  9422.             window.rt_pageid = "Action_OrderConversion";
  9423.             window.rt_product = products.join('|');
  9424.             ___l(window.rt_product, 'DivolutionConversion')
  9425.             ok = true;
  9426.         }
  9427.         if (!!location.pathname.match(/newsletter\/bitte-bestaetigen/i)) {
  9428.             window.rt_pageid = 'Action_NewsletterSubscription';
  9429.             window.rt_product = '';
  9430.             ___l('Action_NewsletterSubscription', 'DivolutionMicroConversion');
  9431.             ok = true;
  9432.         }
  9433.         if (!!location.pathname.match(/brillenberater.html/i)) {
  9434.             window.rt_pageid = 'Action_Brillenberater';
  9435.             window.rt_product = '';
  9436.             ___l('Action_Brillenberater', 'DivolutionMicroConversion');
  9437.             ok = true;
  9438.         }
  9439.         if (ok) {
  9440.             var url = '//rt.divolution.com/js/site/so_s195_EF5nhCtp4hx07.js';
  9441.             loadScript(url);
  9442.         }
  9443.     };
  9444.     var setupBelboon = function () {
  9445.         if (!tracking) {
  9446.             return false;
  9447.         }
  9448.         try {
  9449.             if (typeof($.getlocations().params.belboon) == 'string') {
  9450.                 $.cookie('belboon', $.getlocations().params.belboon, {'path': '/', 'expires': 30});
  9451.             }
  9452.             var belboonID = $.cookie('belboon');
  9453.             var order = B24_order_object.getOrder(/belboon/i);
  9454.             if (!order) {
  9455.                 return false;
  9456.             }
  9457.             if (!belboonID) {
  9458.                 belboonID = 'NONE';
  9459.             }
  9460.             var url = '//www1.belboon.de/adtracking/sale/000019693.gif';
  9461.             var params = {oc: order.id};
  9462.             var itemMode = 'error';
  9463.             switch (getPartnerConverionMode(order)) {
  9464.                 case 1:
  9465.                     itemMode = 'stufe1';
  9466.                     break;
  9467.                 case 2:
  9468.                     itemMode = 'gutschein1';
  9469.                     break;
  9470.                 case 3:
  9471.                     itemMode = 'stufe2';
  9472.                     break;
  9473.                 case 4:
  9474.                     itemMode = 'gutschein2';
  9475.                     break;
  9476.                 case 5:
  9477.                     itemMode = 'stufe3';
  9478.                     break;
  9479.                 case 6:
  9480.                     itemMode = 'gutschein3';
  9481.                     break;
  9482.                 case 7:
  9483.                     itemMode = 'sale';
  9484.                     break;
  9485.             }
  9486.             params[itemMode] = order.payment.netTotal.toString();
  9487.             params.belboon = belboonID, ___l(params, 'belboon');
  9488.             ___b24.loadscript.loadImg(url, params, '/');
  9489.         }
  9490.         catch (err) {
  9491.             ___b24.tracking.error('analytics.belboon', err);
  9492.         }
  9493.     };
  9494.     var setUpAdition = function () {
  9495.         if (!tracking) {
  9496.             return false;
  9497.         }
  9498.         var order = B24_order_object.getOrder();
  9499.         if (!order) {
  9500.             return false;
  9501.         }
  9502.         var url = 'https://adfarm1.adition.com/track';
  9503.         var sid = B24_cpid_object.testCpid(/_ADS$/) ? 18023 : 18141;
  9504.         var params = {'tid': 7090, 'sid': sid, 'type': 'js'};
  9505.         params.quantity = 0;
  9506.         params.orderid = order.id
  9507.         params.total = order_object.payment.totalClean;
  9508.         params.itemno = [];
  9509.         params.price = [];
  9510.         params.descr = [];
  9511.         params.parm1 = [];
  9512.         params.parm2 = [];
  9513.         params.parm3 = [];
  9514.         params.parm4 = [];
  9515.         $.each(order.order_items, function (key, value) {
  9516.             params.quantity += parseInt(value.qty_ordered, 10);
  9517.             params.itemno.push(value.id);
  9518.             params.price.push(value.price);
  9519.             params.descr.push(value.product_name);
  9520.             params.parm1.push(value.product_type_extended.group);
  9521.             var lens = '0';
  9522.             var lensColor = '0';
  9523.             if (!!value.product_type_extended.lens) {
  9524.                 lensColor = value.lensvalues.LColor;
  9525.                 lens += value.product_type_extended.lens;
  9526.             }
  9527.             if (!!value.product_type_extended.lensext) {
  9528.                 lens += value.product_type_extended.lensext;
  9529.             }
  9530.             params.parm2.push(lens);
  9531.             params.parm3.push(lensColor);
  9532.             params.parm4.push(value.discount_amount);
  9533.         });
  9534.         $.each(params, function (key, value) {
  9535.             if (typeof(value) == 'object') {
  9536.                 params[key] = value.join('.');
  9537.             }
  9538.         });
  9539.         ___l(params, 'Adition');
  9540.         var getP = '?';
  9541.         $.each(params, function (key, value) {
  9542.             getP += key + '=' + encodeURIComponent(value) + '&';
  9543.         });
  9544.         getP = getP.replace(/\&$/i, '');
  9545.         url += getP;
  9546.         ___l(url, 'Adition');
  9547.         loadScript(url);
  9548.     };
  9549.     var setUpXplosion = function () {
  9550.         if (!tracking) {
  9551.             return false;
  9552.         }
  9553.         try {
  9554.             var url = '//ssl.xplosion.de/profiler.html';
  9555.             var xpl_params = {};
  9556.             xpl_params.customer = 'brille24.de';
  9557.             var mageParams = B24_shoplocation.getMageParams();
  9558.             var loc = B24_shoplocation.get();
  9559.             var order = B24_order_object.getOrder();
  9560.             var cart = B24_cart_object.getCart();
  9561.             if (loc == 'listing') {
  9562.                 xpl_params.event_id = 'shop_visit';
  9563.                 xpl_params.shop_id = B24_shoplocation.getCategory();
  9564.                 xpl_params.shop_trackingproducts = B24_product_object.getList(6);
  9565.                 ___l(xpl_params, 'Xplosion');
  9566.                 loadIFrame(url, xpl_params);
  9567.             }
  9568.             else if (loc == 'detail') {
  9569.                 xpl_params.event_id = 'product_view';
  9570.                 xpl_params.product_id = B24_product_object.get().sku_extended_clean;
  9571.                 xpl_params.product_price = B24_product_object.get().price;
  9572.                 xpl_params.product_onsale = 0;
  9573.                 xpl_params.shop_id = B24_shoplocation.getCategory();
  9574.                 xpl_params.product_brand = 'Brille24';
  9575.                 ___l(xpl_params, 'Xplosion');
  9576.                 loadIFrame(url, xpl_params);
  9577.             }
  9578.             else if (loc == 'cart' && !!cart) {
  9579.                 var prods = [];
  9580.                 var qtys = [];
  9581.                 var costs = [];
  9582.                 var skus = [];
  9583.                 $.each(cart.order_items, function (index, value) {
  9584.                     prods.push(value.product_name.substr(0, 100));
  9585.                     qtys.push(parseInt(value.qty_ordered));
  9586.                     costs.push(value.netTotal);
  9587.                     skus.push(value.product_sku_extended_clean);
  9588.                 });
  9589.                 xpl_params.event_id = 'add_to_basket';
  9590.                 xpl_params.order_article = skus;
  9591.                 xpl_params.product_quantity = qtys;
  9592.                 ___l(xpl_params, 'Xplosion');
  9593.                 loadIFrame(url, xpl_params);
  9594.             }
  9595.             else if (!!order) {
  9596.                 var prods = [];
  9597.                 var qtys = [];
  9598.                 var costs = [];
  9599.                 var skus = [];
  9600.                 $.each(order.order_items, function (index, value) {
  9601.                     prods.push(value.product_name.substr(0, 100));
  9602.                     qtys.push(parseInt(value.qty_ordered));
  9603.                     costs.push(value.netTotal);
  9604.                     skus.push(value.product_sku_extended_clean);
  9605.                 });
  9606.                 xpl_params.xpl_sale = B24_cpid_object.testCpid(/xplosion/i).toString();
  9607.                 xpl_params.event_id = 'order';
  9608.                 xpl_params.order_article = skus;
  9609.                 xpl_params.product_quantity = qtys;
  9610.                 xpl_params.order_total = order.payment.amount_ordered;
  9611.                 xpl_params.order_revenue = costs;
  9612.                 xpl_params.order_id = order.id;
  9613.                 ___l(xpl_params, 'Xplosion');
  9614.                 loadIFrame(url, xpl_params);
  9615.             }
  9616.         }
  9617.         catch (err) {
  9618.             ___b24.tracking.error('analytics.setUpXplosion', err);
  9619.         }
  9620.     };
  9621.     var setUpChartbeat = function () {
  9622.         window._sf_async_config = {uid: 2155, domain: "brille24.de"};
  9623.         window._sf_startpt = (new Date()).getTime();
  9624.         return true;
  9625.     };
  9626.     var googleRemarketing = function () {
  9627.         if (!tracking) {
  9628.             return false;
  9629.         }
  9630.         try {
  9631.             var loc = B24_shoplocation.get();
  9632.             var googleLoc = 'other';
  9633.             switch (loc) {
  9634.                 case'homepage':
  9635.                     googleLoc = 'home';
  9636.                     break;
  9637.                 case'cart':
  9638.                     googleLoc = 'cart';
  9639.                     break;
  9640.                 case'listing':
  9641.                     googleLoc = 'category';
  9642.                     break;
  9643.                 case'detail':
  9644.                     googleLoc = 'product';
  9645.                     break;
  9646.                 case'success':
  9647.                     googleLoc = 'purchase';
  9648.                     break;
  9649.                 default:
  9650.                     googleLoc = 'other';
  9651.                     break;
  9652.             }
  9653.             if (googleLoc == 'home') {
  9654.                 window.google_tag_params = {ecomm_prodid: '', ecomm_pagetype: 'home', ecomm_totalvalue: ''};
  9655.             }
  9656.             else if (loc == 'listing') {
  9657.                 window.google_tag_params = {ecomm_prodid: '', ecomm_pagetype: 'category', ecomm_totalvalue: ''};
  9658.             }
  9659.             else if (loc == 'detail') {
  9660.                 window.google_tag_params =
  9661.                 {ecomm_prodid: B24_product_object.get().sku_extended, ecomm_pagetype: 'product', ecomm_totalvalue: B24_product_object.get().price.toString()};
  9662.             }
  9663.             else if (loc == 'cart') {
  9664.                 var cart = B24_cart_object.getCart();
  9665.                 var productIDs = [];
  9666.                 var productValues = [];
  9667.                 $.each(cart.order_items, function (key, value) {
  9668.                     productIDs.push(value.product_sku_extended);
  9669.                     productValues.push((value.netTotal / value.qty_ordered).toString());
  9670.                 });
  9671.                 window.google_tag_params = {ecomm_prodid: productIDs, ecomm_pagetype: 'cart', ecomm_totalvalue: productValues};
  9672.             }
  9673.             else if (loc == 'success') {
  9674.                 var order = B24_order_object.getOrder();
  9675.                 if (!!order) {
  9676.                     var productIDs = [];
  9677.                     var productValues = [];
  9678.                     $.each(order.order_items, function (key, value) {
  9679.                         productIDs.push(value.product_sku_extended);
  9680.                         productValues.push((value.netTotal / value.qty_ordered).toString());
  9681.                     });
  9682.                     window.google_tag_params = {ecomm_prodid: productIDs, ecomm_pagetype: 'purchase', ecomm_totalvalue: productValues};
  9683.                     window.google_conversion_id = 1062447180;
  9684.                     window.google_conversion_label = "";
  9685.                 }
  9686.                 else {
  9687.                     return false;
  9688.                 }
  9689.             }
  9690.             else if (googleLoc == 'other') {
  9691.                 window.google_tag_params = {ecomm_prodid: '', ecomm_pagetype: 'other', ecomm_totalvalue: ''};
  9692.             }
  9693.             else {
  9694.                 return false;
  9695.             }
  9696.             window.google_conversion_id = 1062447180;
  9697.             window.google_custom_params = window.google_tag_params;
  9698.             window.google_remarketing_only = true;
  9699.             ___l(google_tag_params, 'googleRemarketing');
  9700.             ___b24.loadscript.load('//www.googleadservices.com/pagead/conversion.js');
  9701.             setUpGoogleConversionTracking();
  9702.             return true;
  9703.         }
  9704.         catch (err) {
  9705.             ___b24.tracking.error('analytics.googleRemarketing', err);
  9706.         }
  9707.     };
  9708.     pub.googleRemarketing = googleRemarketing;
  9709.     var setUpGoogleConversionTracking = function () {
  9710.         if (!tracking) {
  9711.             return false;
  9712.         }
  9713.         try {
  9714.             var order = B24_order_object.getOrder();
  9715.             if (!!order) {
  9716.                 var url = "//www.googleadservices.com/pagead/conversion/1062447180/?value=" + parseFloat(order.payment.amount_ordered, 10)
  9717.                         + "?currency_code=EUR?label=u3_FCLiHVxDM0M76Aw?guid=ON?script=0";
  9718.                 ___b24.loadscript.loadImg(url);
  9719.                 ___l(url, 'googelConversionTracking');
  9720.             }
  9721.             return false;
  9722.         }
  9723.         catch (err) {
  9724.             ___b24.tracking.error('analytics.setUpGoogleConversionTracking', err);
  9725.         }
  9726.     };
  9727.     var setUpEthno = function () {
  9728.         if (!tracking) {
  9729.             return false;
  9730.         }
  9731.         try {
  9732.             var order = B24_order_object.getOrder();
  9733.             if (!!order) {
  9734.                 ___b24.loadscript.load('//ads.escinteractive.com/admultitrack.php?id=58&saleid=' + order.id);
  9735.                 ___l(url, 'EthnoTrackingPart1');
  9736.                 var url = "//www.googleadservices.com/pagead/conversion/957603810/?label=xkeOCPCGp1YQ4r_PyAM&amp;guid=ON&amp;script=0";
  9737.                 ___b24.loadscript.loadImg(url);
  9738.                 ___l(url, 'EthnoTrackingPart2');
  9739.             }
  9740.             return false;
  9741.         }
  9742.         catch (err) {
  9743.             ___b24.tracking.error('analytics.setUpEthno', err);
  9744.         }
  9745.     };
  9746.     var setUpZanoxMaster = function () {
  9747.         if (!tracking) {
  9748.             return false;
  9749.         }
  9750.         try {
  9751.             window._zx = window._zx || [];
  9752.             var loc = B24_shoplocation.get();
  9753.             var zxid = '';
  9754.             if (loc == 'other' && !!$.getlocations().pathname.match(/^\/om\//i)) {
  9755.                 zxid = '0BEE63FC0BC0D61F4246';
  9756.                 _zx.push({"id": zxid});
  9757.                 ___l({'_zx': _zx}, 'ZanoxMaster');
  9758.             }
  9759.             else if (loc == 'other') {
  9760.                 zxid = '0509C52149AB6F35237C';
  9761.                 _zx.push({"id": zxid});
  9762.                 ___l({'_zx': _zx}, 'ZanoxMaster');
  9763.             }
  9764.             else if (loc == 'homepage') {
  9765.                 zxid = '0A6795076178D2BCE991';
  9766.                 _zx.push({"id": zxid});
  9767.                 ___l({'_zx': _zx}, 'ZanoxMaster');
  9768.             }
  9769.             else if (loc == 'listing') {
  9770.                 window.zx_category = B24_shoplocation.getCategory();
  9771.                 zxid = '0BEE63FC0BC0D61F4246';
  9772.                 _zx.push({"id": zxid});
  9773.                 ___l({'_zx': _zx, 'zx_category': zx_category}, 'ZanoxMaster');
  9774.             }
  9775.             else if (loc == 'detail') {
  9776.                 window.zx_identifier = B24_product_object.get().sku_extended;
  9777.                 window.zx_fn = B24_product_object.get().name;
  9778.                 window.zx_price = B24_product_object.get().netPrice.toString();
  9779.                 window.zx_amount = B24_product_object.get().price.toString();
  9780.                 window.zx_category = B24_shoplocation.getCategory();
  9781.                 zxid = '47B05B1B34AE30C9B8ED';
  9782.                 _zx.push({"id": zxid});
  9783.                 ___l({'_zx': _zx, 'zx_identifier': zx_identifier, 'zx_fn': zx_fn, 'zx_price': zx_price, 'zx_amount': zx_amount, 'zx_category': zx_category},
  9784.                         'ZanoxMaster');
  9785.             }
  9786.             else if (loc == 'search') {
  9787.                 zxid = '6EB4837F5BD50D7088F5';
  9788.                 _zx.push({"id": zxid});
  9789.                 ___l({'_zx': _zx}, 'ZanoxMaster');
  9790.             }
  9791.             else if (loc == 'register') {
  9792.                 zxid = '2AEC83A958D2EA52CB95';
  9793.                 _zx.push({"id": zxid});
  9794.                 ___l({'_zx': _zx}, 'ZanoxMaster');
  9795.             }
  9796.             else if (loc == 'cart') {
  9797.                 var cart = B24_cart_object.getCart();
  9798.                 window.zx_products = [];
  9799.                 $.each(cart.order_items, function (key, value) {
  9800.                     zx_products.push({'identifier': value.product_sku_extended, 'amount': (value.netTotal
  9801.                             / value.qty_ordered).toString(), 'currency': 'EUR', 'quantity': parseInt(value.qty_ordered).toString()});
  9802.                 });
  9803.                 zxid = '7E71A28F4DC4DA56FF7F';
  9804.                 _zx.push({"id": zxid});
  9805.                 ___l({'_zx': _zx, 'zx_products': zx_products}, 'ZanoxMaster');
  9806.             }
  9807.             else if (loc == 'success') {
  9808.                 var order = B24_order_object.getOrder();
  9809.                 if (!!order) {
  9810.                     window.zx_products = [];
  9811.                     $.each(order.order_items, function (key, value) {
  9812.                         zx_products.push({'identifier': value.product_sku_extended, 'amount': (value.netTotal
  9813.                                 / value.qty_ordered).toString(), 'currency': 'EUR', 'quantity': parseInt(value.qty_ordered).toString()});
  9814.                     });
  9815.                     window.zx_transaction = order.id;
  9816.                     window.zx_total_amount = order.payment.netTotal.toString();
  9817.                     window.zx_total_currency = "EUR";
  9818.                     zxid = '4428A1F3547B7DE5DC98';
  9819.                     _zx.push({"id": zxid});
  9820.                     ___l({'_zx': _zx, 'zx_transaction': zx_transaction, 'zx_total_amount': zx_total_amount, 'zx_total_currency': zx_total_currency, 'zx_products': zx_products},
  9821.                             'ZanoxMaster');
  9822.                 }
  9823.             }
  9824.             else {
  9825.                 return false;
  9826.             }
  9827.             $('body').append('<div class="zx_' + zxid + ' zx_mediaslot" />');
  9828.             ___b24.loadscript.load('//static.zanox.com/scripts/zanox.js');
  9829.             return true;
  9830.         }
  9831.         catch (err) {
  9832.             ___b24.tracking.error('analytics.zanoxmaster', err);
  9833.         }
  9834.     };
  9835.     var setUpUniqueDigital = function () {
  9836.         if (!tracking) {
  9837.             return false;
  9838.         }
  9839.         try {
  9840.             window._adftrack = {};
  9841.             var location = B24_shoplocation.get();
  9842.             var cart = B24_cart_object.getCart();
  9843.             var order = B24_order_object.getOrder();
  9844.             if (location == 'homepage') {
  9845.                 _adftrack = {pm: 65623, id: 929473};
  9846.             }
  9847.             else if (location == 'detail' && B24_shoplocation.getProductType() != 'contactlens') {
  9848.                 _adftrack = {pm: 65623, id: 929226, order: {itms: [
  9849.                     {'productname': B24_product_object.get().name, 'productid': B24_product_object.get().sku, 'categoryname': B24_shoplocation.getCategory(), 'productsales': B24_product_object.get().price, sv1: '', sv2: 'Brille24'}
  9850.                 ]}};
  9851.             }
  9852.             else if (location == 'listing') {
  9853.                 _adftrack = {pm: 65623, id: 956859, order: {itms: [
  9854.                     {'categoryname': B24_shoplocation.getCategory()}
  9855.                 ]}};
  9856.             }
  9857.             else if (!!cart) {
  9858.                 var itms = [];
  9859.                 $.each(cart.order_items, function (key, value) {
  9860.                     var productname = $.trim(value.product_name.replace(/^.*brille/i, ''));
  9861.                     var productid = value.product_sku;
  9862.                     var categoryname = '';
  9863.                     var productsales = value.price;
  9864.                     itms.push({'productname': productname, 'productid': productid, 'categoryname': categoryname, 'productsales': productsales});
  9865.                 });
  9866.                 _adftrack = {pm: 65623, id: 956857, order: {'itms': itms}};
  9867.             }
  9868.             else if (!!order) {
  9869.                 var ordertrack = {};
  9870.                 ordertrack.sales = order.payment.netTotal;
  9871.                 ordertrack.orderid = order.id;
  9872.                 ordertrack.basketsize = 0;
  9873.                 ordertrack.itms = [];
  9874.                 $.each(order.order_items, function (key, value) {
  9875.                     var productname = $.trim(value.product_name.replace(/^.*brille/i, ''));
  9876.                     var productid = value.product_sku;
  9877.                     var categoryname = '';
  9878.                     var productsales = value.price;
  9879.                     ordertrack.itms.push({'productname': productname, 'productid': productid, 'categoryname': categoryname, 'productsales': productsales});
  9880.                     ordertrack.basketsize++;
  9881.                 });
  9882.                 if (B24_cpid_object.testCpid(/UNIQUE-RTE/)) {
  9883.                     _adftrack = {pm: 65623, id: 929445, 'order': ordertrack};
  9884.                 }
  9885.                 else {
  9886.                     _adftrack = {pm: 65623, id: 958202, 'order': ordertrack};
  9887.                 }
  9888.             }
  9889.             else {
  9890.                 return false;
  9891.             }
  9892.             loadScript('https://track.adform.net/serving/scripts/trackpoint/async/');
  9893.             ___l(_adftrack, 'uniqueDigital');
  9894.         }
  9895.         catch (err) {
  9896.             ___b24.tracking.error('analytics.setUpUniqueDigital', err);
  9897.         }
  9898.     };
  9899.     var setUpSociomantic = function () {
  9900.         if (!tracking) {
  9901.             return false;
  9902.         }
  9903.         try {
  9904.             var soc_customer = B24_shoplocation.getMageParams().empty ? '' : B24_shoplocation.getMageParams().C;
  9905.             window.customer = {'identifier': soc_customer};
  9906.             var loc = B24_shoplocation.get();
  9907.             var cart = B24_cart_object.getCart();
  9908.             var order = B24_order_object.getOrder();
  9909.             if (!!order) {
  9910.                 var beacon = 'sociomanticSuccess';
  9911.                 window.basket = {};
  9912.                 basket.products = [];
  9913.                 $.each(order.order_items, function (index, value) {
  9914.                     basket.products.push({'identifier': value.product_sku_extended_clean, 'amount': (value.netTotal
  9915.                             / value.qty_ordered), 'currency': 'EUR', 'quantity': parseInt(value.qty_ordered)});
  9916.                 });
  9917.                 basket.transaction = order.id;
  9918.                 basket.amount = order.payment.netTotal;
  9919.                 basket.currency = 'EUR';
  9920.                 ___l(basket, 'sociomantics basket success');
  9921.                 if (B24_cpid_object.testCpid(/sociomantic/i)) {
  9922.                     window.sale = {confirmed: true};
  9923.                     beacon = 'sociomanticCPIDsuccessPRE';
  9924.                     if (typeof sociomantic !== 'undefined' && typeof sociomantic.sonar !== 'undefined' && typeof sociomantic.sonar.advertiser
  9925.                             !== 'undefined' && typeof sociomantic.sonar.advertiser.getConfirmed !== 'undefined') {
  9926.                         sociomantic.sonar.advertiser.getConfirmed();
  9927.                         beacon = 'sociomanticCPIDgetConfirmedSuccess';
  9928.                     }
  9929.                     else {
  9930.                         beacon = 'sociomanticCPIDsuccess';
  9931.                     }
  9932.                     ___l(window.sale, 'sociomantics cpid success');
  9933.                 }
  9934.                 ___b24.tracking.trackingEvent('sociomatic', beacon);
  9935.             }
  9936.             else if (loc == 'cart') {
  9937.                 var cart = B24_cart_object.getCart();
  9938.                 window.basket = {};
  9939.                 basket.products = [];
  9940.                 $.each(cart.order_items, function (index, value) {
  9941.                     basket.products.push({'identifier': value.product_sku_extended_clean, 'amount': (value.netTotal
  9942.                             / value.qty_ordered), 'currency': 'EUR', 'quantity': parseInt(value.qty_ordered)});
  9943.                 });
  9944.                 ___l(basket, 'sociomantics basket cart');
  9945.             }
  9946.             else if (loc == 'detail') {
  9947.                 window.product = {'identifier': B24_product_object.get().sku_extended_clean};
  9948.                 ___l(product, 'sociomantics the product');
  9949.             }
  9950.             else if (loc == 'listing') {
  9951.                 window.product = {'category': [B24_shoplocation.getCategory()]};
  9952.                 ___l(product, 'sociomantics the category');
  9953.             }
  9954.             else if (loc == 'homepage') {
  9955.                 ___l('home', 'sociomantics home');
  9956.             }
  9957.             else if (loc == 'other' && !!$.getlocations().pathname.match(/^\/om\//i)) {
  9958.                 ___l('ompages', 'sociomantics ompages');
  9959.             }
  9960.             else {
  9961.                 return false;
  9962.             }
  9963.             loadScript('//eu-sonar.sociomantic.com/js/2010-07-01/adpan/brille24-de');
  9964.         }
  9965.         catch (err) {
  9966.             ___b24.tracking.error('analytics.setUpSociomantic', err);
  9967.         }
  9968.     };
  9969.     var setUpEcomcon = function () {
  9970.         if (!tracking) {
  9971.             return false;
  9972.         }
  9973.         try {
  9974.             var loc = B24_shoplocation.get();
  9975.             var order = B24_order_object.getOrder();
  9976.             if (!!order) {
  9977.                 var url = 'https://secure.adnxs.com/px?id=196091&seg=1775791&order_id=' + order.id + '&value=' + order.payment.netTotal + '&t=1';
  9978.                 ___b24.loadscript.load(url);
  9979.                 ___l('Ecomcon', url);
  9980.             }
  9981.             else if ($.getlocations().ssl) {
  9982.                 return false;
  9983.             }
  9984.             else if (loc == 'homepage') {
  9985.                 var url = 'http://ib.adnxs.com/px?id=196087&seg=1775786&t=1';
  9986.                 ___b24.loadscript.load(url);
  9987.                 ___l('Ecomcon', url);
  9988.             }
  9989.             else if (loc == 'detail') {
  9990.                 var url = 'http://ib.adnxs.com/px?id=196089&seg=1775788&t=1';
  9991.                 ___b24.loadscript.load(url);
  9992.                 ___l('Ecomcon', url);
  9993.             }
  9994.             else if (loc == 'listing') {
  9995.                 var url = 'http://ib.adnxs.com/px?id=196088&seg=1775787&t=1';
  9996.                 ___b24.loadscript.load(url);
  9997.                 ___l('Ecomcon', url);
  9998.             }
  9999.             else if (loc == 'cart') {
  10000.                 var url = 'http://ib.adnxs.com/px?id=196090&seg=1775790&t=1';
  10001.                 ___b24.loadscript.load(url);
  10002.                 ___l('Ecomcon', url);
  10003.             }
  10004.         }
  10005.         catch (err) {
  10006.             ___b24.tracking.error('analytics.setUpEcomcon', err);
  10007.         }
  10008.     };
  10009.     var selligent = function () {
  10010.         if (!tracking) {
  10011.             return false;
  10012.         }
  10013.         try {
  10014.             var url = '//brille24.emsecure.net/optiext/webtracker.dll';
  10015.             $.ajax({url: url, dataType: 'script', error: function (errr) {
  10016.                 ___b24.tracking.error('analytics.selligent1.ajaxcall', errr);
  10017.             }, success: function () {
  10018.                 ;
  10019.             }}).done(function (data) {
  10020.                 ma_track();
  10021.                 var order = B24_order_object.getOrder()
  10022.                 if (!!order) {
  10023.                     ma_track('aOcyfliaA',
  10024.                             '',
  10025.                             '',
  10026.                                     order.payment.netTotal.toString().replace(/\./, ',') + '',
  10027.                             '',
  10028.                             '',
  10029.                                     order.id + '',
  10030.                                     order.customer.id + '');
  10031.                     ___l(ma_track, 'selligent1');
  10032.                 }
  10033.             });
  10034.         }
  10035.         catch (err) {
  10036.             ___b24.tracking.error('analytics.selligent1', err);
  10037.         }
  10038.         try {
  10039.             var orderObject = B24_order_object.getOrder() || B24_cart_object.getCart();
  10040.             if (orderObject == null) {
  10041.                 return false;
  10042.             }
  10043.             if (orderObject.empty) {
  10044.                 return false;
  10045.             }
  10046.             if (B24_shoplocation.get() != 'cart' && B24_shoplocation.get() != 'success') {
  10047.                 return false;
  10048.             }
  10049.             if (typeof(orderObject.order_items[0]) != 'undefined' && orderObject.order_items[0].product_type == 2) {
  10050.                 return false;
  10051.             }
  10052.             var params = '';
  10053.             params = 'ID=mIppkqbeErYpyaG%2Ba2TxaRhnAulOC3DxUe3heV';
  10054.             params += '&';
  10055.             var wkstatus = '10';
  10056.             if (B24_cart_object.getCartStatus() == 'stillEmpty' || B24_cart_object.getCartStatus() == 'haveaLook') {
  10057.                 return false;
  10058.             }
  10059.             else if (B24_cart_object.getCartStatus() == 'terminated' || B24_cart_object.getCartStatus() == 'deletedPosition') {
  10060.                 wkstatus = '00';
  10061.                 params += 'sku=000';
  10062.                 params += '&';
  10063.                 params += 'brillentyp=-1';
  10064.             }
  10065.             else {
  10066.                 params += 'sku=' + orderObject.order_items[0].product_sku;
  10067.                 params += '&';
  10068.                 params += 'brillentyp=' + orderObject.order_items[0].product_type;
  10069.             }
  10070.             if (typeof(orderObject.customer.id) == 'string') {
  10071.                 params += '&';
  10072.                 params += 'customer_id=' + orderObject.customer.id;
  10073.             }
  10074.             if (typeof(window.order_object) == 'object') {
  10075.                 wkstatus = '00';
  10076.             }
  10077.             params += '&';
  10078.             params += 'wk_status=' + wkstatus;
  10079.             var ssl = $.getlocations().ssl ? 's' : '';
  10080.             var path = 'http' + ssl + '://brille24.emsecure.net/optiext/optiextension.dll';
  10081.             var img = '<img src="' + path + '?' + params + '" border="0" alt="" />';
  10082.             ___l(params, 'selligent');
  10083.             $('#dynamic').append(img);
  10084.         }
  10085.         catch (err) {
  10086.             ___b24.tracking.error('analytics.selligent2', err);
  10087.         }
  10088.     };
  10089.     var finalChartbeat = function () {
  10090.         if (!tracking) {
  10091.             return false;
  10092.         }
  10093.         window._sf_endpt = (new Date()).getTime();
  10094.         var src = (("https:" == document.location.protocol) ? "https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/js/chartbeat.js" :
  10095.                 "http://static.chartbeat.com/js/chartbeat.js");
  10096.         loadScript(src);
  10097.     };
  10098.     var setUpYahooReMarketing = function () {
  10099.         if (!tracking) {
  10100.             return false;
  10101.         }
  10102.         var order = B24_order_object.getOrder(/yahoo/i);
  10103.         if (!!order) {
  10104.             var img = '<img src="https://ad.yieldmanager.com/pixel?id=1371402&t=2" width="1" height="1" />';
  10105.             $('#dynamic').append(img);
  10106.             ___l(img, 'yahooRemarketing');
  10107.             return true;
  10108.         }
  10109.         return false;
  10110.     };
  10111.     var setUpZanox = function () {
  10112.         if (!tracking) {
  10113.             return false;
  10114.         }
  10115.         var order = B24_order_object.getOrder(/(zx\_aff)|(zanox)/i);
  10116.         if (!!order) {
  10117.             if (new Date().getFullYear() > 2013 || B24_debug_status.getMode('ga')) {
  10118.                 var params = {CustomerID: order.customer.id, OrderID: order.id, CurrencySymbol: 'EUR', TotalPrice: order.payment.netTotal, CID: getPartnerConverionMode(order)};
  10119.                 var url = 'https://ad.zanox.com/pps/?9417C470646257&mode=[[2]]';
  10120.                 ___b24.loadscript.loadImg(url, params);
  10121.                 ___l(params, 'newZanox');
  10122.             }
  10123.             else {
  10124.                 var param_string = '';
  10125.                 param_string += '&CustomerID=' + order.customer.id;
  10126.                 param_string += '&OrderID=' + order.id;
  10127.                 param_string += '&CurrencySymbol=EUR';
  10128.                 param_string += '&TotalPrice=' + order.payment.netTotal;
  10129.                 var img = '<img src="https://ad.zanox.com/pps/?9417C470646257&mode=[[2]]' + param_string + '" width="1" height="1" />';
  10130.                 $('#dynamic').append(img);
  10131.                 ___l(img, 'zanox');
  10132.             }
  10133.             return true;
  10134.         }
  10135.         return false;
  10136.     };
  10137.     var setUpCommissionJunction = function () {
  10138.         if (!tracking) {
  10139.             return false;
  10140.         }
  10141.         var order = B24_order_object.getOrder(/^cj/i);
  10142.         if (!!order) {
  10143.             var itemMode = 'WK_Error';
  10144.             switch (getPartnerConverionMode(order)) {
  10145.                 case 1:
  10146.                     itemMode = 'WK_60_oG';
  10147.                     break;
  10148.                 case 2:
  10149.                     itemMode = 'WK_60_mG';
  10150.                     break;
  10151.                 case 3:
  10152.                     itemMode = 'WK_60-01_120_oG';
  10153.                     break;
  10154.                 case 4:
  10155.                     itemMode = 'WK_60-01_120_mG';
  10156.                     break;
  10157.                 case 5:
  10158.                     itemMode = 'WK_120-01_oG';
  10159.                     break;
  10160.                 case 6:
  10161.                     itemMode = 'WK_120-01_mG';
  10162.                     break;
  10163.                 case 7:
  10164.                     itemMode = 'WK_CL';
  10165.                     break;
  10166.             }
  10167.             var params = {'CID': '1502798', 'OID': order.id, 'TYPE': '362057', 'ITEM1': itemMode, 'AMT1': order.payment.netTotal, 'QTY1': 1, 'CURRENCY': 'EUR', 'METHOD': 'IMG'};
  10168.             ___b24.loadscript.loadImg('https://www.kdukvh.com/u', params);
  10169.             ___l(params, 'CJ');
  10170.         }
  10171.         return false;
  10172.     };
  10173.     var getPartnerConverionMode = function (ord) {
  10174.         var mode = 0;
  10175.         var price = ord.payment.netTotal
  10176.         var discount = ord.discount_description != '';
  10177.         var glass = true;
  10178.         $.each(ord.order_items, function (index, value) {
  10179.             if (value.product_type_extended.sort != 'Glass') {
  10180.                 glass = false;
  10181.             }
  10182.         });
  10183.         if (!glass) {
  10184.             mode = 7;
  10185.         }
  10186.         else if (price < 60) {
  10187.             mode = !discount ? 1 : 2;
  10188.         }
  10189.         else if (price < 120) {
  10190.             mode = !discount ? 3 : 4;
  10191.         }
  10192.         else {
  10193.             mode = !discount ? 5 : 6;
  10194.         }
  10195.         return mode;
  10196.     };
  10197.     var setUpAccado = function () {
  10198.         if (!tracking) {
  10199.             return false;
  10200.         }
  10201.         if (B24_shoplocation.get() == 'homepage') {
  10202.             var img = '<iframe src="https://accado.adspirit.de/admultitrack.php?output=2&id=94&PARAMETER" width="1" height="1" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe>';
  10203.             $('#dynamic').append(img);
  10204.             ___l(img, 'Accado');
  10205.             return true;
  10206.         }
  10207.         var order = B24_order_object.getOrder(/accado/i);
  10208.         if (!!order) {
  10209.             var img = '<iframe src="https://accado.adspirit.de/admultitrack.php?output=2&id=93&saleid=' + order.id + '&price='
  10210.                     + order.payment.netTotal + '" width="1" height="1" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe>';
  10211.             $('#dynamic').append(img);
  10212.             ___l(img, 'Accado');
  10213.             return true;
  10214.         }
  10215.         return false;
  10216.     };
  10217.     var setUpUDMarin = function () {
  10218.         if (!tracking) {
  10219.             return false;
  10220.         }
  10221.         var order = B24_order_object.getOrder(/(GOOGLE|YAHOO|adwords_11|2011_CPC_GOOGLECONTENT|2011_SEARCH_GOOGLE|2011_BANNER_GOOGLE|2011_CPC_YOUTUBE|retargeting-gr|SEARCH_GOOGLE)/i);
  10222.         if (!!order) {
  10223.             var saleType = 'sale';
  10224.             $.each(order.order_items, function (index, value) {
  10225.                 if (typeof(value.lensvalues) == 'object' && typeof(value.lensvalues.LColor) == 'string') {
  10226.                     var tintingRate = parseInt(value.lensvalues.LColor.match(/\d{2}$/i)[0]);
  10227.                     if (tintingRate > 40) {
  10228.                         saleType = 'sale_sonnenbrille';
  10229.                     }
  10230.                 }
  10231.             });
  10232.             var img = '<img src="https://tracker.marinsm.com/tp?act=2&cid=8iy913f5t0&currency=EUR&trans=UTM:T|' + order.id + '||'
  10233.                     + order.payment.netTotal + '|||||%0AUTM:I|' + order.id + '|' + saleType + '|||' + order.payment.netTotal
  10234.                     + '|" width="1" height="1" />';
  10235.             $('#dynamic').append(img);
  10236.             ___l(img, 'Marin');
  10237.             return true;
  10238.         }
  10239.         return false;
  10240.     };
  10241.     var setUpFacebookConversion = function () {
  10242.         if (!tracking) {
  10243.             return false;
  10244.         }
  10245.         var order = B24_order_object.getOrder();
  10246.         if (!!order) {
  10247.             window.fb_param = {};
  10248.             fb_param.pixel_id = '6007721195337';
  10249.             fb_param.value = order.payment.netTotal;
  10250.             ___l(fb_param, 'Facebook');
  10251.             loadScript('//connect.facebook.net/en_US/fp.js', true, true);
  10252.         }
  10253.         return false;
  10254.     };
  10255.     var loadScript = function (source, sync, utf8) {
  10256.         var script = document.createElement('script');
  10257.         script.type = 'text/javascript';
  10258.         if (typeof(sync) == 'boolean' && sync) {
  10259.             script.async = true;
  10260.         }
  10261.         else {
  10262.             script.async = false;
  10263.         }
  10264.         if (typeof(utf8) == 'boolean' && utf8) {
  10265.             script.charset = 'utf-8';
  10266.         }
  10267.         script.src = source;
  10268.         var scriptDOM = document.getElementsByTagName('script')[0];
  10269.         scriptDOM.parentNode.insertBefore(script, scriptDOM);
  10270.     }
  10271.     pub.loadScript = loadScript;
  10272.     init();
  10273.     $(DOMready);
  10274.     return pub;
  10275. })(window, jQuery, undefined);
  10276. ;
  10277. var ___b24 = ___b24 || {};
  10278. ___b24.frontmode = (function (window, $) {
  10279.     var pub = {};
  10280.     var name = 'frontmode';
  10281.     var prefix = name;
  10282.     var storageName = prefix;
  10283.     var modes = {};
  10284.     var classes = '';
  10285.     var expTTL = 86400000;
  10286.     var expTTLD = 1;
  10287.     var init = function () {
  10288.         modes = extendModes(getStorage(), getParams());
  10289.         classes = setModes(modes);
  10290.         setStorage(modes);
  10291.     };
  10292.     var clearModes = function () {
  10293.         $('html').removeClass(classes.join(' '));
  10294.         modes = {};
  10295.         setStorage(modes);
  10296.         return modes;
  10297.     };
  10298.     pub.clearModes = clearModes;
  10299.     var extendModes = function (tar, src) {
  10300.         var m = $.extend(tar, src);
  10301.         var out = {};
  10302.         $.each(m, function (key, value) {
  10303.             key = key.toLowerCase(), value = value.toLowerCase();
  10304.             if (value != 'false') {
  10305.                 out[key] = value;
  10306.             }
  10307.         });
  10308.         return out;
  10309.     };
  10310.     var setModes = function (m) {
  10311.         var cls = [];
  10312.         $.each(m, function (key, value) {
  10313.             var c = key;
  10314.             if (value != 'true') {
  10315.                 c += '_' + value;
  10316.             }
  10317.             cls.push(c);
  10318.         });
  10319.         $('html').addClass(cls.join(' '));
  10320.         return cls;
  10321.     };
  10322.     var getParams = function () {
  10323.         var params = $.getlocations().params;
  10324.         var collection = {};
  10325.         $.each(params, function (key, value) {
  10326.             if (!!key.match(new RegExp('^' + prefix + '_', 'i'))) {
  10327.                 collection[key] = value;
  10328.             }
  10329.         });
  10330.         return collection;
  10331.     };
  10332.     var getStorage = function () {
  10333.         return!!$.cookie(storageName) ? JSON.parse($.cookie(storageName)) : {};
  10334.     };
  10335.     var setStorage = function (j) {
  10336.         $.cookie(storageName, JSON.stringify(j), {'path': '/', 'expires': expTTLD});
  10337.         return true;
  10338.     };
  10339.     init();
  10340.     return pub;
  10341. })(window, jQuery, undefined);
  10342. ;
  10343. ; //
  10344.  
  10345. /* Brille24
  10346.  * optimise-it implementation
  10347.  * #3513
  10348.  */
  10349. //
  10350. // var ___b24 = ___b24 || {};
  10351. //
  10352. // ___b24.optimiseIt  = (function(window, $){
  10353. //  
  10354. // var tracking = B24_debug_status.getMode('tracking');
  10355. //  
  10356. // var pub = {};
  10357. //  
  10358. // var DOMready = function() {
  10359. // stopTrackingByConversionComment();
  10360. // if(!tracking) {
  10361. // return false;
  10362. // }
  10363. // basiCall();
  10364. // conversion();
  10365. // };
  10366. //  
  10367. //
  10368. // var stopTrackingByConversionComment = function() {
  10369. // // disables the conversionTracking by a customer-order-comment
  10370. // var order = B24_order_object.getOrder();
  10371. // if(!!order && typeof(order.customer_comment) == 'string' && !!order.customer_comment.match(/\#test\#/i)) {
  10372. // tracking = false;
  10373. // }
  10374. // };
  10375. //  
  10376. // var basiCall = function() {
  10377. // var loc = B24_shoplocation.get();
  10378. // var departmentId = 1;
  10379. // if(loc == 'homepage') {
  10380. // departmentId = 1;
  10381. // }
  10382. // if(loc == 'other') {
  10383. // if(!!location.pathname.match(/selbsttoenende-brillenglaeser.html/i)) {
  10384. // departmentId = 4;
  10385. // }
  10386. // else if(!!location.pathname.match(/polarisierende-brillenglaeser.html/i)) {
  10387. // departmentId = 5;
  10388. // }
  10389. // else {
  10390. // departmentId = 2;
  10391. // }
  10392. // }
  10393. // if(loc == 'listing') {
  10394. // departmentId = 3;
  10395. // }
  10396. // if(loc == 'detail') {
  10397. // departmentId = 6;
  10398. // }
  10399. // if(loc == 'cart') {
  10400. // departmentId = 7;
  10401. // }
  10402. // if(loc == 'checkout') {
  10403. // departmentId = 8;
  10404. // }
  10405. // if(loc == 'success') {
  10406. // return false;
  10407. // }
  10408. // var url = 'https://chat.brille24.de/system/scripts/rp_status.php';
  10409. // var params = {};
  10410. // params.deptid = departmentId.toString();
  10411. // params.pagename = location.pathname;
  10412. // params.json = {
  10413. // nothing: 'NOTHING',
  10414. // }
  10415. // var getP = '?';
  10416. // $.each(params, function(key, value) {
  10417. // if(typeof(value) == 'object') {
  10418. // value = JSON.stringify(value);
  10419. // }
  10420. // getP += key + '=' + encodeURIComponent(value) + '&';
  10421. // });
  10422. // getP = getP.replace(/\&$/i, '');
  10423. // url += getP;
  10424. // ___l(url, 'OPTIMISE');
  10425. // ___b24.analytics.loadScript(url);
  10426. // };
  10427. //
  10428. // var conversion = function() {
  10429. // if(!tracking) {
  10430. // return false;
  10431. // }
  10432. // var order = B24_order_object.getOrder();
  10433. // if(!order) {
  10434. // return false;
  10435. // }
  10436. // var url = 'https://chat.brille24.de/system/report.php';
  10437. // var params = {};
  10438. // params.OrderNumber = order.id;
  10439. // params.json = {
  10440. // nothing: 'NOTHING'
  10441. // }
  10442. // var getP = '?';
  10443. // $.each(params, function(key, value) {
  10444. // if(typeof(value) == 'object') {
  10445. // value = JSON.stringify(value);
  10446. // }
  10447. // getP += key + '=' + encodeURIComponent(value) + '&';
  10448. // });
  10449. // getP = getP.replace(/\&$/i, '');
  10450. // url += getP;
  10451. // ___l(url, 'OPTIMISE');
  10452. // ___b24.analytics.loadScript(url);
  10453. // };
  10454. //
  10455. // $(DOMready);
  10456. //  
  10457. // return pub;
  10458. //  
  10459. // })(window, jQuery, undefined);
  10460.  
  10461. (function ($) {
  10462.     $(document).on('click', '#TRYON_ADAPTION', function (event) {
  10463.         if (typeof event == 'undefined') {
  10464.             event = window.event;
  10465.         }
  10466.         var $this = $(this);
  10467.         var x = event.clientX - $this.offset().left + $(document).scrollLeft();
  10468.         var y = event.clientY - $this.offset().top + $(document).scrollTop();
  10469.         $.log($this.offset().top);
  10470.         $.log(event);
  10471.         $.log(x + ' x ' + y);
  10472.         if ($('#EYEPOINT_x1').val() == '') {
  10473.             $('#EYEPOINT_x1').val(x);
  10474.             $('#EYEPOINT_y1').val(y);
  10475.             $('#EYEPOINT_GHOST_1').css({top: (y - 22) + 'px', left: (x - 22) + 'px'});
  10476.         }
  10477.         else {
  10478.             $('#EYEPOINT_x2').val(x);
  10479.             $('#EYEPOINT_y2').val(y);
  10480.             $('#tryon_adaption .ADAPT_SAVE').removeAttr('disabled').removeClass('disabled');
  10481.             $('#EYEPOINT_GHOST_2').css({top: (y - 22) + 'px', left: (x - 22) + 'px'});
  10482.         }
  10483.         $('.part_3').removeClass('step_error');
  10484.     });
  10485.     $(document).on('click', '#tryon_adaption .ADAPT_REDO', function () {
  10486.         $.log(1);
  10487.         $('#EYEPOINT_x1, #EYEPOINT_y1, #EYEPOINT_x2, #EYEPOINT_y2').val('');
  10488.         $('#tryon_adaption .ADAPT_SAVE').addClass('disabled');
  10489.         $('#EYEPOINT_GHOST_1, #EYEPOINT_GHOST_2').css({top: '-100px', left: '-100px'});
  10490.         $('.part_3').removeClass('step_error');
  10491.         return false;
  10492.     });
  10493.     $(document).on('click', '#tryon_adaption .ADAPT_SAVE', function () {
  10494.         if ($(this).hasClass('disabled')) {
  10495.             $('.part_3').addClass('step_error');
  10496.             return false;
  10497.         }
  10498.         else {
  10499.             return true;
  10500.         }
  10501.     });
  10502.     $(document).on('change', '#tryon_ajax_options .refreshTryonAjax', function () {
  10503.         var frame_selectiD = $('.b24_frame').val();
  10504.         var frame_t = "Frame_" + frame_selectiD;
  10505.         $.log("Frame t " + frame_t);
  10506.         var objectstringpath = "FrameOptions.selectionId_" + frame_selectiD + ".sku";
  10507.         var frame_sku = eval("$('#BUNDLEOPTIONS').metadata()." + objectstringpath);
  10508.         var frame = frame_sku;
  10509.         $.log("frame " + frame);
  10510.         var glass = $('.b24_lensshape').val();
  10511.         var color = $('.b24_lenscolor').val();
  10512.         $('.PRODUCTLINK').attr('href', $('.PRODUCTLINK').data('link') + "?frame=" + frame);
  10513.         url = '/shop/tryon/image/glassasblock/frame/' + frame + '/glass/' + glass + '/color/' + color + '/category/' + B24Tools.getCategory();
  10514.         $('#tryonloader').show();
  10515.         $('#userglasses').hide();
  10516.         $.ajax({url: url, success: function (data) {
  10517.             $('#tryonloader').hide();
  10518.             $('#userglasses').html(data);
  10519.             $('#userglasses').show();
  10520.             $.log(data);
  10521.         }});
  10522.     });
  10523.     $(document).on('click', '#CATALOG_TRYON_PREVIOUS, #CATALOG_TRYON_NEXT', function () {
  10524.         $t = $(this);
  10525.         var $overlaybox = $('#overlayBox');
  10526.         var $container = $(".contentWrap", $overlaybox);
  10527.         $container.html("");
  10528.         $overlaybox.addClass("indicator");
  10529.         var url = $t.attr('href');
  10530.         url = url.replace(/(\?)/i, '?category=' + B24Tools.getCategory() + '&');
  10531.         var selector = url.match(/\#[^\?\#]+/i);
  10532.         if (selector == null || typeof(selector) == "undefined" || selector.length < 1) {
  10533.             selector = false;
  10534.         }
  10535.         else {
  10536.             selector = selector[0];
  10537.         }
  10538.         var baseURL = "/";
  10539.         var rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
  10540.         $.ajax({url: url, type: 'GET', dataType: "html", cache: false, complete: function (jqXHR, status, responseText) {
  10541.             $overlaybox.removeClass("indicator");
  10542.             responseText = jqXHR.responseText;
  10543.             jqXHR.done(function (r) {
  10544.                 responseText = r;
  10545.             });
  10546.             var $extract = $();
  10547.             if (selector) {
  10548.                 $extract = jQuery("<div>").append(responseText.replace(rscript, "")).find(selector);
  10549.                 if (!$extract.length) {
  10550.                     $extract = jQuery("<div>").append(responseText.replace(rscript, ""));
  10551.                 }
  10552.             }
  10553.             else {
  10554.                 $extract = jQuery("<div>").append(responseText.replace(rscript, ""));
  10555.             }
  10556.             $container.html('').append($extract).show();
  10557.             $('.PRODUCTLINK').data('link', $('.PRODUCTLINK').attr('href'));
  10558.         }});
  10559.         return false;
  10560.     });
  10561.     $(document).on('click', '.OVERLAYBOX_TRYON', function (e) {
  10562.         var whom = $.trim($(this).closest('.item').find('.product-name .product_name_inner').text());
  10563.         if (!whom) {
  10564.             whom = "Brille-Default_ECode=61515162427934027";
  10565.         }
  10566.         if (!$('#overlayBox').length) {
  10567.             $('body').append('<div id="overlayBox"><div class="head grad_grey"><span class="headline"></span><a class="close"><span>X</span></a></div><div class="error"></div><div class="contentWrap"></div></div>');
  10568.         }
  10569.         e.preventDefault();
  10570.         window.$overlay =
  10571.                 $(this).overlay({target: '#overlayBox', api: true, load: true, mask: {color: '#000', opacity: 0.6, loadSpeed: 0, closeSpeed: 0}, onClose: function () {
  10572.                     $t = this.getOverlay();
  10573.                     $t.removeClass("tryon_ajax indicator");
  10574.                 }, onBeforeLoad: function () {
  10575.                     $t = this.getOverlay();
  10576.                     $t.addClass("tryon_ajax indicator");
  10577.                     var $container = $t.find(".contentWrap");
  10578.                     $container.html("");
  10579.                     $t.find('.headline').text(this.getTrigger().text());
  10580.                     var url = this.getTrigger().metadata().url;
  10581.                     url = url.replace(/(\?)/i, '?category=' + B24Tools.getCategory() + '&');
  10582.                     var selector = url.match(/\#[^\?\#]+/i);
  10583.                     if (selector == null || typeof(selector) == "undefined" || selector.length < 1) {
  10584.                         selector = false;
  10585.                     }
  10586.                     else {
  10587.                         selector = selector[0];
  10588.                     }
  10589.                     var baseURL = "/";
  10590.                     var rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
  10591.                     $.ajax({url: url, type: 'GET', dataType: "html", cache: false, complete: function (jqXHR, status, responseText) {
  10592.                         responseText = jqXHR.responseText;
  10593.                         jqXHR.done(function (r) {
  10594.                             responseText = r;
  10595.                         });
  10596.                         var $extract = $();
  10597.                         if (selector) {
  10598.                             $extract = jQuery("<div>").append(responseText.replace(rscript, "")).find(selector);
  10599.                             if (!$extract.length) {
  10600.                                 $extract = jQuery("<div>").append(responseText.replace(rscript, ""));
  10601.                             }
  10602.                         }
  10603.                         else {
  10604.                             $extract = jQuery("<div>").append(responseText.replace(rscript, ""));
  10605.                         }
  10606.                         ___b24.tracking.freeEvent('Tryon_ProductView', whom);
  10607.                         $container.html('').append($extract).show().parent().removeClass('indicator');
  10608.                         $('.PRODUCTLINK').data('link', $('.PRODUCTLINK').attr('href'));
  10609.                     }});
  10610.                 }});
  10611.     });
  10612.     $(document).on('click', '#TRYONEDIT', function (e) {
  10613.         $('#tryon_quick_change').addClass('load');
  10614.         $('#tryon_quick_change').show();
  10615.         $('#tryon_quick_change,#b24_tryon').expose({color: '#000', opacity: 0.6, loadSpeed: 0, closeSpeed: 0, onClose: function (event) {
  10616.             $('#tryon_quick_change').hide(0, function () {
  10617.                 $('#tryon_quick_change .canvas, #tryon_quick_change .nav').remove();
  10618.             });
  10619.         }});
  10620.         $.ajax({url: '/shop/tryon/productview/', success: function (data) {
  10621.             $('#tryon_quick_change').append(data);
  10622.             $('#tryon_quick_change').removeClass('load');
  10623.             $('#tryon_quick_change .canvas').show();
  10624.         }, error: function (data) {
  10625.             $.mask.close();
  10626.             ___b24.tracking.error('tryon.js', 'Open tryon overlay.ajax');
  10627.             alert($('#tryon_quick_change').metadata().error);
  10628.         }});
  10629.         ___b24.tracking.freeEvent('Tryon_ProductView', 'Open the overlay');
  10630.         return false;
  10631.     });
  10632.     $(document).on('click', '#tryon_quick_change .CHANGETRYON', function (e) {
  10633.         var $t = $(this);
  10634.         var picurl = '/shop/tryon/productview/set/userpic_id/' + $t.attr('href');
  10635.         var picSelector = picurl.replace('/shop/tryon/productview/set/userpic_id/', '').charAt(0);
  10636.         $.ajax({url: picurl, success: function (data) {
  10637.             $('#tryonloader').show();
  10638.             $('#userglasses, #userpic').hide();
  10639.             $('#tryon_quick_change .pic').removeClass('active');
  10640.             $t.addClass('active');
  10641.             $.ajax({url: '/shop/tryon/image/userpicasblock/', success: function (data) {
  10642.                 $('#userpic').html(data);
  10643.                 $('#userpic, #userglasses').show();
  10644.                 $('#tryonloader').hide();
  10645.                 if (picSelector == 's') {
  10646.                     $('#CATWALKSTATUS').addClass('STANDARDUSERPIC');
  10647.                 }
  10648.                 else {
  10649.                     $('#CATWALKSTATUS').removeClass('STANDARDUSERPIC');
  10650.                 }
  10651.             }, error: function (data) {
  10652.                 $('#tryonloader').hide();
  10653.                 $('#userglasses, #userpic').show();
  10654.                 $('#userpic').show();
  10655.                 ___b24.tracking.error('tryon.js', 'Change photo.ajax.picasblock');
  10656.                 alert($('#tryon_quick_change').metadata().error);
  10657.             }});
  10658.         }, error: function (data) {
  10659.             $('#tryonloader').hide();
  10660.             $('#userglasses, #userpic').show();
  10661.             ___b24.tracking.error('tryon.js', 'Change photo.ajax.picurl');
  10662.             alert($('#tryon_quick_change').metadata().error);
  10663.         }});
  10664.         ___b24.tracking.freeEvent('Tryon_ProductView', 'Change photo');
  10665.         return false;
  10666.     });
  10667.     $(document).on('click', '#tryon_quick_change .RIGHT', function (e) {
  10668.         var slideposition = $('#tryonpics').position();
  10669.         var slides = $('#tryonpics').width() - 960;
  10670.         if (slides + slideposition.left >= 910) {
  10671.             slide = 910;
  10672.             $('#tryon_quick_change .LEFT').removeClass('disable');
  10673.         }
  10674.         else {
  10675.             slide = slides + slideposition.left;
  10676.             $('#tryon_quick_change .RIGHT').addClass('disable');
  10677.         }
  10678.         $('#tryonpics').animate({left: '-=' + slide}, {queue: false, duration: 350});
  10679.         return false;
  10680.     });
  10681.     $(document).on('click', '#tryon_quick_change .LEFT', function (e) {
  10682.         var slideposition = $('#tryonpics').position();
  10683.         var slides = $('#tryonpics').width() - 960;
  10684.         if (Math.abs(slideposition.left) >= 910) {
  10685.             slide = '+=' + 910;
  10686.             $('#tryon_quick_change .RIGHT').fadeIn();
  10687.             $('#tryon_quick_change .RIGHT').removeClass('disable');
  10688.         }
  10689.         else {
  10690.             slide = 0;
  10691.             $('#tryon_quick_change .LEFT').addClass('disable');
  10692.         }
  10693.         $('#tryonpics').animate({left: slide}, {queue: false, duration: 350});
  10694.         return false;
  10695.     });
  10696.     $(document).on('click', '#tryon_quick_change .close', function (e) {
  10697.         $('#tryon_quick_change').fadeOut('fast', function () {
  10698.             $('#tryon_quick_change .canvas, #tryon_quick_change .nav').remove();
  10699.         });
  10700.         $.mask.close();
  10701.         return false;
  10702.     });
  10703.     $(document).on('click', '#UPLOAD .save.REQUIRED', function (e) {
  10704.         if ($('#file_uploader').val() == "") {
  10705.             ___b24.tracking.freeEvent('Tryon', 'Kein Bild ausgewählt');
  10706.         }
  10707.         else {
  10708.             ___b24.tracking.freeEvent('Tryon', 'Bild hochgeladen');
  10709.         }
  10710.     });
  10711.     if ($('html').hasClass('video')) {
  10712.         $('.webcam_foto_upload').prop('display', 'block');
  10713.     }
  10714.     $(document).on("click", "a.offsite", function () {
  10715.         alert("Goodbye!");
  10716.     });
  10717.     $(document).on("click", ".webcam_foto_upload_now.activecambutton", function (e) {
  10718.         var Pic = document.getElementById("canvas_big").toDataURL("image/jpeg");
  10719.         $('#userpic_canvas').attr('value', Pic);
  10720.         $('.userpic_canvas').attr('src', Pic);
  10721.         $("#UPLOAD_CANVAS").submit();
  10722.         event.preventDefault();
  10723.     });
  10724.     $(document).ready(function () {
  10725.         function hasGetUserMedia() {
  10726.             return!!(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
  10727.         }
  10728.  
  10729.         if (hasGetUserMedia()) {
  10730.         }
  10731.         else {
  10732.             $('.webcamuploaddiv').html(" ");
  10733.         }
  10734.     });
  10735.     $(document).on("click", ".webcam_foto_upload", function (e) {
  10736.         localStorage.removeItem("webcamheight");
  10737.         localStorage.removeItem("webcamwidth");
  10738.         localStorage.removeItem("webcamabstand_seiten");
  10739.         localStorage.removeItem("webcamaratio");
  10740.         localStorage.clear();
  10741.         if ($('.webcamdummy').length > 0) {
  10742.             var dummy = $('.webcamdummy').html();
  10743.             $('body').prepend(dummy);
  10744.             $('.webcamdummy').html(" ");
  10745.         }
  10746.         $('#bottommenu').hide();
  10747.         $('#overlayBoxWebcam').show();
  10748.         e.preventDefault();
  10749.         var OK = true;
  10750.         window.$overlay =
  10751.                 $(this).overlay({target: '#overlayBoxWebcam', api: true, load: true, fixed: false, mask: {color: '#000', opacity: 0.6, loadSpeed: 0, closeSpeed: 0}, onBeforeLoad: function (event) {
  10752.                     $thisOverlay = this.getOverlay();
  10753.                 }, onClose: function (event) {
  10754.                 }});
  10755.         $(document).on("click", "#overlayBoxWebcam .close", function (e) {
  10756.             $.mask.close();
  10757.             return false;
  10758.         });
  10759.         var canvas = document.getElementById("canvas"), canvas_big = document.getElementById("canvas_big"), context = canvas.getContext("2d"), context_big = canvas_big.getContext("2d"), video = document.getElementById("video"), videoObj = {"video": true}, errBack = function (error) {
  10760.             ___("Video capture error: ", error.code);
  10761.         };
  10762.         if (!$('#video').hasClass('webcam_mirror')) {
  10763.             context.translate(233, 0);
  10764.             context.scale(-1, 1);
  10765.             context_big.translate(233, 0);
  10766.             context_big.scale(-1, 1);
  10767.             $('#video').addClass('webcam_mirror');
  10768.         }
  10769.         if (navigator.getUserMedia) {
  10770.             navigator.getUserMedia(videoObj, function (stream) {
  10771.                 video.src = stream;
  10772.                 video.play();
  10773.                 video.style.cssText = "-moz-transform: scale(-1, 1); \
  10774.   -webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1); \
  10775.   transform: scale(-1, 1); filter: FlipH;";
  10776.             }, errBack);
  10777.         }
  10778.         else if (navigator.webkitGetUserMedia) {
  10779.             navigator.webkitGetUserMedia(videoObj, function (stream) {
  10780.                 video.src = window.webkitURL.createObjectURL(stream);
  10781.                 video.play();
  10782.                 video.style.cssText = "-moz-transform: scale(-1, 1); \
  10783. -webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1); \
  10784. transform: scale(-1, 1); filter: FlipH;";
  10785.             }, errBack);
  10786.         }
  10787.         else if (navigator.mozGetUserMedia) {
  10788.             navigator.mozGetUserMedia(videoObj, function (stream) {
  10789.                 video.src = window.URL.createObjectURL(stream);
  10790.                 video.play();
  10791.                 video.style.cssText = "-moz-transform: scale(-1, 1); \
  10792. -webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1); \
  10793. transform: scale(-1, 1); filter: FlipH;";
  10794.             }, errBack);
  10795.         }
  10796.         vidresolution = SetCanvisVideoSize();
  10797.         function SetCanvisVideoSize() {
  10798.             var retryCount = 0;
  10799.             var retryLimit = 100;
  10800.             var video = $('#video')[0];
  10801.             video.onplaying = function (e) {
  10802.                 var videoWidth = this.videoWidth;
  10803.                 var videoHeight = this.videoHeight;
  10804.                 if (!videoWidth || !videoHeight) {
  10805.                     if (retryCount < retryLimit) {
  10806.                         retryCount++;
  10807.                         window.setTimeout(function () {
  10808.                             video.pause();
  10809.                             video.play();
  10810.                         }, 100);
  10811.                     }
  10812.                     else {
  10813.                         video.onplaying = undefined;
  10814.                     }
  10815.                 }
  10816.                 else {
  10817.                     video.onplaying = undefined;
  10818.                     defaultheight = 310;
  10819.                     defaultwidth = Math.round(defaultheight * (videoWidth / videoHeight));
  10820.                     defaultratio = defaultwidth / defaultheight;
  10821.                     faktor_zoom = videoWidth / defaultwidth;
  10822.                     $('#video').attr('height', defaultheight);
  10823.                     $('#video').attr('width', defaultwidth);
  10824.                     webcamabstand_seiten = Math.round(((defaultwidth - 233) / 2) * faktor_zoom);
  10825.                     webcamabstand_seiten_div = Math.round(((defaultwidth - 233) / 2));
  10826.                     localStorage.setItem("webcamwidth", videoWidth);
  10827.                     localStorage.setItem("webcamheight", videoHeight);
  10828.                     localStorage.setItem("webcamratio", videoWidth / videoHeight);
  10829.                     localStorage.setItem("webcamabstand_seiten", webcamabstand_seiten);
  10830.                     $('#video').css('left', -webcamabstand_seiten_div);
  10831.                     $('.LeftBoxWebcamButton').show();
  10832.                     $('.overlay-webcam-position').show();
  10833.                 }
  10834.             };
  10835.         }
  10836.     });
  10837.     $(document).on("click", "#snap", function () {
  10838.         var height = localStorage.getItem("webcamheight");
  10839.         var width = localStorage.getItem("webcamwidth");
  10840.         var abstand_seiten = localStorage.getItem("webcamabstand_seiten");
  10841.         var webcamratio = localStorage.getItem("webcamratio");
  10842.         var canvas = document.getElementById("canvas"), canvas_big = document.getElementById("canvas_big"), context = canvas.getContext("2d"), context_big = canvas_big.getContext("2d"), video = document.getElementById("video"), videoObj = {"video": true}, errBack = function (error) {
  10843.         };
  10844.         source_width = Math.round(((width) - (abstand_seiten * 2)));
  10845.         source_height = height;
  10846.         $('.fotoinforechts').hide();
  10847.         context.drawImage(video, abstand_seiten, 0, source_width, source_height, 0, 0, 233, 310);
  10848.         context_big.drawImage(video, abstand_seiten, 0, source_width, source_height, 0, 0, 233, 310);
  10849.         window.localStorage.setItem("SHOWTRYON", "1");
  10850.         $('button.webcam_foto_upload_now').addClass('activecambutton');
  10851.     });
  10852. })(jQuery);
  10853. ;
  10854.  
  10855. (function ($) {
  10856.     $(function () {
  10857.         $('#search_head').on('submit', function () {
  10858.             var $inp = $('input', $(this));
  10859.             var searchPhrase = $inp.val();
  10860.             if (searchPhrase == $inp.prop('defaultValue')) {
  10861.                 return false;
  10862.             }
  10863.             ___b24.tracking.search(searchPhrase);
  10864.             return true;
  10865.         });
  10866.     });
  10867. })(jQuery);
  10868. ;
  10869.  
  10870. (function (root, factory) {
  10871.     if (typeof define === 'function' && define.amd) {
  10872.         define(factory);
  10873.     }
  10874.     else if (typeof exports === 'object') {
  10875.         module.exports = factory(require, exports, module);
  10876.     }
  10877.     else {
  10878.         root.ouibounce = factory();
  10879.     }
  10880. }(this, function (require, exports, module) {
  10881.     return function ouibounce(el, config) {
  10882.         var config = config || {}, aggressive = config.aggressive || false, sensitivity = setDefault(config.sensitivity,
  10883.                 20), timer = setDefault(config.timer, 1000), delay = setDefault(config.delay, 0), callback = config.callback || function () {
  10884.         }, cookieExpire = setDefaultCookieExpire(config.cookieExpire) || '', cookieDomain = config.cookieDomain ? ';domain=' + config.cookieDomain :
  10885.                 '', sitewide = config.sitewide === true ? ';path=/' : '', _delayTimer = null, _html = document.documentElement;
  10886.  
  10887.         function setDefault(_property, _default) {
  10888.             return typeof _property === 'undefined' ? _default : _property;
  10889.         }
  10890.  
  10891.         function setDefaultCookieExpire(days) {
  10892.             var ms = days * 24 * 60 * 60 * 1000;
  10893.             var date = new Date();
  10894.             date.setTime(date.getTime() + ms);
  10895.             return"; expires=" + date.toUTCString();
  10896.         }
  10897.  
  10898.         setTimeout(attachOuiBounce, timer);
  10899.         function attachOuiBounce() {
  10900.             _html.addEventListener('mouseleave', handleMouseleave);
  10901.             _html.addEventListener('mouseenter', handleMouseenter);
  10902.             _html.addEventListener('keydown', handleKeydown);
  10903.         }
  10904.  
  10905.         function handleMouseleave(e) {
  10906.             if (e.clientY > sensitivity || (checkCookieValue('viewedOuibounceModal', 'true') && !aggressive)) {
  10907.                 return;
  10908.             }
  10909.             _delayTimer = setTimeout(_fireAndCallback, delay);
  10910.         }
  10911.  
  10912.         function handleMouseenter(e) {
  10913.             if (_delayTimer) {
  10914.                 clearTimeout(_delayTimer);
  10915.                 _delayTimer = null;
  10916.             }
  10917.         }
  10918.  
  10919.         var disableKeydown = false;
  10920.  
  10921.         function handleKeydown(e) {
  10922.             if (disableKeydown || checkCookieValue('viewedOuibounceModal', 'true') && !aggressive) {
  10923.                 return;
  10924.             }
  10925.             else if (!e.metaKey || e.keyCode !== 76) {
  10926.                 return;
  10927.             }
  10928.             disableKeydown = true;
  10929.             _delayTimer = setTimeout(_fireAndCallback, delay);
  10930.         }
  10931.  
  10932.         function checkCookieValue(cookieName, value) {
  10933.             return parseCookies()[cookieName] === value;
  10934.         }
  10935.  
  10936.         function parseCookies() {
  10937.             var cookies = document.cookie.split('; ');
  10938.             var ret = {};
  10939.             for (var i = cookies.length - 1; i >= 0; i--) {
  10940.                 var el = cookies[i].split('=');
  10941.                 ret[el[0]] = el[1];
  10942.             }
  10943.             return ret;
  10944.         }
  10945.  
  10946.         function _fireAndCallback() {
  10947.             fire();
  10948.             callback();
  10949.         }
  10950.  
  10951.         function fire() {
  10952.             if (el) {
  10953.                 el.style.display = 'block';
  10954.             }
  10955.             disable();
  10956.         }
  10957.  
  10958.         function disable(options) {
  10959.             var options = options || {};
  10960.             if (typeof options.cookieExpire !== 'undefined') {
  10961.                 cookieExpire = setDefaultCookieExpire(options.cookieExpire);
  10962.             }
  10963.             if (options.sitewide === true) {
  10964.                 sitewide = ';path=/';
  10965.             }
  10966.             if (typeof options.cookieDomain !== 'undefined') {
  10967.                 cookieDomain = ';domain=' + options.cookieDomain;
  10968.             }
  10969.             document.cookie = 'viewedOuibounceModal=true' + cookieExpire + cookieDomain + sitewide;
  10970.             _html.removeEventListener('mouseleave', handleMouseleave);
  10971.             _html.removeEventListener('mouseenter', handleMouseenter);
  10972.             _html.removeEventListener('keydown', handleKeydown);
  10973.         }
  10974.  
  10975.         return{fire: fire, disable: disable};
  10976.     };
  10977. }));
  10978. ;
  10979.  
  10980. (function ($) {
  10981.     if (jQuery.browser.mobile === true) {
  10982.         $("html").addClass('is_mobile');
  10983.     }
  10984.     eKomiIntegrationConfig = new Array({certId: '73215AD7D54A234'});
  10985.     if (typeof eKomiIntegrationConfig != "undefined") {
  10986.         var eKomiIntegrationLoop = 0;
  10987.     }
  10988.     $(document).on('click', '.REQUIRED', function () {
  10989.         var message = $(this).metadata().message;
  10990.         var field = $(this).metadata().field;
  10991.         var $field = $(field);
  10992.         if ($field.val() == "") {
  10993.             $field.parent().addClass('redborder');
  10994.             alert(message)
  10995.             return false;
  10996.         }
  10997.         else {
  10998.             return true;
  10999.         }
  11000.         return false;
  11001.     });
  11002.     $(document).on('click', '.CONFIRM', function () {
  11003.         var data = $(this).metadata();
  11004.         if (typeof(data) != 'object') {
  11005.             return true;
  11006.         }
  11007.         if (typeof(data.message) != 'string') {
  11008.             return true;
  11009.         }
  11010.         if (confirm(data.message)) {
  11011.             return true;
  11012.         }
  11013.         return false;
  11014.     });
  11015.     $(document).on('click', '.ALERT', function () {
  11016.         var data = $(this).metadata();
  11017.         if (typeof(data) != 'object') {
  11018.             return true;
  11019.         }
  11020.         if (typeof(data.message) != 'string') {
  11021.             return true;
  11022.         }
  11023.         alert(data.message);
  11024.         return false;
  11025.     });
  11026.     $(document).on('click', '.SKU_HIDDEN_HINT', function (e) {
  11027.         if (!e.ctrlKey) {
  11028.             return true;
  11029.         }
  11030.         $t = $(this);
  11031.         if (typeof($t.metadata().sku) == 'string') {
  11032.             $t.append('<span style="color: white; background: red" />');
  11033.             $t.find('span').text($t.metadata().sku);
  11034.             $t.css('overflow', 'visible');
  11035.         }
  11036.         return false;
  11037.     });
  11038.     $(document).on('click', '.COUPON_CODE_SETTER', function () {
  11039.         var code = $(this).find('span').text();
  11040.         $('#coupon_code').val(code);
  11041.     });
  11042.     $(document).on('focusout', '.TRIM', function () {
  11043.         $t = $(this);
  11044.         $t.val($.trim($t.val()));
  11045.     });
  11046.     var categoryBannerSwitch = function () {
  11047.         var name = 'b24_banner_switch';
  11048.         var expTTL = 86400000;
  11049.         var variant = $.jStorage.get(name, "0");
  11050.         if (typeof($.getlocations().params.b24_banner_switch) == 'string') {
  11051.             variant = $.getlocations().params.b24_banner_switch;
  11052.             $.jStorage.set(name, variant, {TTL: expTTL});
  11053.         }
  11054.         $('html').addClass(name + '_' + variant);
  11055.     };
  11056.     $(function () {
  11057.         categoryBannerSwitch();
  11058.         $('.COUNTDOWN').each(function () {
  11059.             var $t = $(this);
  11060.             var text = $t.text();
  11061.             var match = text.match(/(\d)+/i);
  11062.             if (match != null || !match.length) {
  11063.                 var url = $t.metadata().url;
  11064.                 if (typeof(url) == 'undefined') {
  11065.                     url = '/';
  11066.                 }
  11067.                 var interval = setInterval(function () {
  11068.                     var number = parseInt($t.text().match(/(\d)+/i)[0]);
  11069.                     number--;
  11070.                     $t.text($t.text().replace(/(\d)+/i, number));
  11071.                     if (number < 1) {
  11072.                         window.clearInterval(interval);
  11073.                         $.getlocations(url);
  11074.                     }
  11075.                 }, 1000);
  11076.             }
  11077.         });
  11078.         $('.FACEBOOK_LIKES').each(function () {
  11079.             var $this = $(this);
  11080.             if ($('link[rel=canonical]').length > 0) {
  11081.                 var fb_url = $('link[rel=canonical]').attr('href');
  11082.             }
  11083.             else {
  11084.                 var fb_url = $(location).attr('href').split('?')[0];
  11085.             }
  11086.             $.getJSON("https://graph.facebook.com/fql?q=SELECT url,normalized_url,share_count,like_count,comment_count,total_count FROM link_stat WHERE url='"
  11087.                     + fb_url + "'", function (data) {
  11088.                 if ((data['data'][0].like_count + data['data'][0].share_count) > 0) {
  11089.                     $this.text(data['data'][0].like_count + data['data'][0].share_count);
  11090.                 }
  11091.                 else {
  11092.                     $this.text('0');
  11093.                 }
  11094.             });
  11095.         });
  11096.     });
  11097.     $(function () {
  11098.         if ($('body').hasClass('catalog-product-view')) {
  11099.             var b24ProductBanner = ['hamburg', 'dusseldorf', 'berlin', 'bremen', 'munchen', 'koln'];
  11100.             var bodyClass = $('body').attr('class').match(/.*\bproduct-([a-zA-Z]*)\b.*/m);
  11101.             if (b24ProductBanner.indexOf(bodyClass[1]) != -1) {
  11102.                 $('.breadcrumbs').after('<div class="bannerAD"><img src="http://asset.brille24.de/fileadmin/Redakteur/shopbanner/productview/'
  11103.                         + bodyClass[1] + '.jpg" class="bannerADclick"></div>');
  11104.             }
  11105.         }
  11106.         ;
  11107.         if ($('html').hasClass('frontmode_heine')
  11108.                 && !$('body').is('.checkout-onepage-index, .checkout-onepage-success, .category-kontaktlinsen, .category-pflegemittel')) {
  11109.             $('.breadcrumbs').after('<div class="bannerAD"><img src="//asset.brille24.de/fileadmin/Redakteur/shopbanner/Banner_Heine_04_2014.jpg"></div>');
  11110.         }
  11111.         ;
  11112.     });
  11113.     $(document).on('click', '.cockpit_navigation.clearfix .nav', function () {
  11114.         ___b24.tracking.freeEvent('cockpit', $(this).attr('data-track'));
  11115.         if ($(this).hasClass('socialnetworks')) {
  11116.             if ($('.nav.socialnetworks').hasClass('active')) {
  11117.                 $('.SOCIALNETWORKS .box').animate({left: 200}, 500, function () {
  11118.                     $('.nav.socialnetworks').removeClass('active');
  11119.                     $('.cockpit_navigation .SOCIALNETWORKS .box-canvas').hide();
  11120.                 });
  11121.             }
  11122.             else {
  11123.                 $('.SOCIALNETWORKS .box').animate({left: 0}, 500);
  11124.                 $('.nav.socialnetworks').addClass('active');
  11125.                 $('.cockpit_navigation .SOCIALNETWORKS .box-canvas').show();
  11126.             }
  11127.             return false;
  11128.         }
  11129.     });
  11130.     $(document).on('click', 'body', function () {
  11131.         if ($('.cockpit_navigation .nav').hasClass("active")) {
  11132.             $('.SOCIALNETWORKS .box').animate({left: 200}, 500, function () {
  11133.                 $('.nav.socialnetworks').removeClass('active');
  11134.                 $('.cockpit_navigation .SOCIALNETWORKS .box-canvas').hide();
  11135.             });
  11136.         }
  11137.     });
  11138. })(jQuery);
  11139. var B24Tools = {getCategory: function () {
  11140.     if (typeof(category_id) == "number") {
  11141.         return category_id;
  11142.     }
  11143.     var $ = jQuery;
  11144.     window.category_id = $('body').attr('class').match(/\bcategory-id-\d+/i);
  11145.     if (category_id == null) {
  11146.         category_id = 0;
  11147.     }
  11148.     else {
  11149.         category_id = category_id[0].match(/\d+/i)[0];
  11150.         category_id
  11151.     }
  11152.     category_id = parseInt(category_id);
  11153.     return category_id;
  11154. }, json2string: function (json) {
  11155.     if (typeof(json) != 'object') {
  11156.         return"{}";
  11157.     }
  11158.     var string = '{';
  11159.     jQuery.each(json, function (key, value) {
  11160.         string += '"' + key + '":"' + value + '",';
  11161.     });
  11162.     string = string.replace(/\,$/i, '');
  11163.     string += '}';
  11164.     return string;
  11165. }};
  11166. (function ($) {
  11167.     $(document).ready(function () {
  11168.         var oiboxloginstatus = false;
  11169.         if ($.cookie('newsletter_status') == '1') {
  11170.             oiboxloginstatus = true;
  11171.         }
  11172.         if (oiboxloginstatus === false) {
  11173.             var oiboxcontent = '<!-- OuiBounce Modal --><div id="ouibounce-modal"><div class="underlay"></div><div class="modal"><div class="modal-body"><div class="buttonclose">X</div><form style="top: 115px; position: relative" method="post" action="/shop/manage/newsletter/anonsubscribe/"><input type="hidden" name="SUBSCRIBE_SOURCE" value="newsletter_exitintent"><input type="email" required="required" style="    font-size: 18px;height: 35px; padding-left: 10px; width: 258px;" title="Anmeldung für unseren Newsletter" id="MAIL" placeholder="Ihre E-Mail-Adresse" name="MAIL"><span id="info-hint" style="margin-top:5px !important; position: relative; float: left"></span><div class="buttonrow"><button class="marginbutton" value="M" name="GENDER" type="submit" id="nl_website_form_male"><span>Männlich</span></button><button value="F" name="GENDER" type="submit" id="nl_website_form_female"><span>Weiblich</span></button></form></div><div class="modal-footer"><p>>> Nein danke, ich möchte keinen Newsletter erhalten.</p><div style="font-size:11px; line-height: 12px; color: #545454;">Hinweis: Sie können Ihren Newsletter jederzeit wieder abbestellen. Für den Versand unseres Newsletters gelten unsere <a class="OVERLAYBOX" href="/index.php?id=50#cobject_49">Datenschutzbestimmungen</a></div><div class="paragraph"><!--###paragraph### begin --><span class="star"><!--###star### begin -->¹)<!--###star### end --></span>Nur einlösbar auf Brillen. Nicht einlösbar auf bereits reduzierte Brillen.<!--###paragraph### end --></div></div></div></div>';
  11174.             $('body').append(oiboxcontent);
  11175.             var _ouibounce = ouibounce(document.getElementById('ouibounce-modal'),
  11176.                     {aggressive: false, cookieExpire: 31, sitewide: true, callback: function () {
  11177.                         ___b24.tracking.freeEvent('ExitIntent', 'fired');
  11178.                     }});
  11179.             $('body').on('click', function () {
  11180.                 $('#ouibounce-modal').hide();
  11181.             });
  11182.             $('#ouibounce-modal .modal-footer, #ouibounce-modal .buttonclose').on('click', function () {
  11183.                 $('#ouibounce-modal').hide();
  11184.             });
  11185.             $('#ouibounce-modal .modal').on('click', function (e) {
  11186.                 e.stopPropagation();
  11187.             });
  11188.         }
  11189.     });
  11190. })(jQuery);
  11191. ;
  11192. ;
  11193. (function ($) {
  11194.     $(function () {
  11195.         $.fn.extend({Check_For_Coupon_Values: function () {
  11196.             if ($('.checkout-onepage-success').length > 0) {
  11197.                 $.fn.Delete_Coupon_Values();
  11198.             }
  11199.             else if (($.getlocations().params.coupon_t != null) && ($.getlocations().params.coupon_t != "") && ($.getlocations().params.coupon_c
  11200.                     != null) && ($.getlocations().params.coupon_c != "") && ($.getlocations().params.coupon_v != null)
  11201.                     && ($.getlocations().params.coupon_v != "")) {
  11202.                 var coupon_t = decodeURIComponent($.getlocations().params.coupon_t);
  11203.                 var coupon_v = decodeURIComponent($.getlocations().params.coupon_v);
  11204.                 var coupon_c = decodeURIComponent($.getlocations().params.coupon_c);
  11205.                 $.fn.Write_Coupon_Values({coupon_t: coupon_t, coupon_v: coupon_v, coupon_c: coupon_c});
  11206.             }
  11207.             else if (((sessionStorage.getItem("coupon_t") != null) && (sessionStorage.getItem("coupon_t") != ""))
  11208.                     && ((sessionStorage.getItem("coupon_c") != null) && (sessionStorage.getItem("coupon_c") != ""))
  11209.                     && ((sessionStorage.getItem("coupon_v") != null) && (sessionStorage.getItem("coupon_v") != ""))) {
  11210.                 var coupon_t = sessionStorage.getItem("coupon_t");
  11211.                 var coupon_c = sessionStorage.getItem("coupon_c");
  11212.                 var coupon_v = sessionStorage.getItem("coupon_v");
  11213.                 $.fn.Write_Coupon_Values({coupon_t: coupon_t, coupon_v: coupon_v, coupon_c: coupon_c});
  11214.             }
  11215.             ;
  11216.         }, Load_Coupon_Values: function () {
  11217.             coupon_t = sessionStorage.getItem("coupon_t");
  11218.             coupon_c = sessionStorage.getItem("coupon_c");
  11219.             coupon_v = sessionStorage.getItem("coupon_v");
  11220.             $.fn.Show_Coupon_Footer({coupon_t: coupon_t, coupon_v: coupon_v, coupon_c: coupon_c});
  11221.         }, Delete_Coupon_Values: function () {
  11222.             sessionStorage.removeItem("coupon_t");
  11223.             sessionStorage.removeItem("coupon_c");
  11224.             sessionStorage.removeItem("coupon_v");
  11225.         }, Write_Coupon_Values: function (options) {
  11226.             var defaults = {coupon_t: null, coupon_c: null, coupon_v: null};
  11227.             var options = $.extend(defaults, options);
  11228.             sessionStorage.setItem("coupon_t", options.coupon_t);
  11229.             sessionStorage.setItem("coupon_c", options.coupon_c);
  11230.             sessionStorage.setItem("coupon_v", options.coupon_v);
  11231.             $.fn.Show_Coupon_Footer({coupon_t: options.coupon_t, coupon_v: options.coupon_v, coupon_c: options.coupon_c});
  11232.         }, Show_Coupon_Footer: function (options) {
  11233.             var defaults = {coupon_t: null, coupon_c: null, coupon_v: null};
  11234.             var showCouponCode = '<div id="COUPON_FOOTER"><div class="text">';
  11235.             showCouponCode += options.coupon_t + ' <div class="coupon_code">' + options.coupon_c + '</div> ' + options.coupon_v;
  11236.             showCouponCode += '<button class="green"><span>Jetzt einlösen</span></button></div></div>';
  11237.             $('body').append(showCouponCode);
  11238.             $('html').addClass('footer_coupon_true');
  11239.             $('#COUPON_FOOTER').show();
  11240.             if ($('body').hasClass('checkout-cart-index')) {
  11241.                 if (document.getElementById('noCouponMode')) {
  11242.                     $('#COUPON_FOOTER').prepend('<div class="COUPON_FOOTER_NOT_AVAIABLE">Ihr Gutschein ist für Aktionsmodelle und Kontaktlinsen nicht einlösbar. Wenn Sie den/die Artikel wieder entfernen, ist der Gutschein wieder einlösbar.</div>');
  11243.                 }
  11244.                 ;
  11245.                 if (document.getElementById('coupon_code')) {
  11246.                     $('#coupon_code').attr('value', options.coupon_c);
  11247.                     $('#coupon_code').css({"color": "#444"});
  11248.                     if ($('#remove-coupone').val() == 0) {
  11249.                         $('#COUPON_FOOTER button').show();
  11250.                         $(document).on('click', '#COUPON_FOOTER button', function () {
  11251.                             $('form#discount-coupon-form').submit();
  11252.                         });
  11253.                     }
  11254.                 }
  11255.                 ;
  11256.             }
  11257.         }});
  11258.         $.fn.Check_For_Coupon_Values();
  11259.     });
  11260. })(jQuery);
  11261. ;
  11262. ;
  11263. function bodyinit() {
  11264. }
  11265. (function ($) {
  11266.     $(function () {
  11267.         if (typeof($.cookie) == 'function' && !!$.cookie('personalisation')) {
  11268.             userPersonalisation = $.parseJSON($.cookie('personalisation'));
  11269.             if (userPersonalisation.logged_in) {
  11270.                 $('html').addClass('logged_in');
  11271.             }
  11272.             else {
  11273.                 $('html').addClass('logged_out');
  11274.             }
  11275.             $('.cart_items').text(userPersonalisation.cart_count);
  11276.         }
  11277.         wishlistCountSet = function () {
  11278.             var wishlistCount = 0;
  11279.             if ($.cookie('wishlist_count') != null) {
  11280.                 wishlistCount = $.cookie('wishlist_count');
  11281.             }
  11282.             else {
  11283.                 $.ajax({type: "GET", url: '/shop/wishlist/index/ajaxindex/', dataType: 'json', cache: false, success: function (data) {
  11284.                     var wishlistItems = JSON.stringify(data);
  11285.                     window.localStorage.setItem('wishlist', wishlistItems);
  11286.                     var wishlistItemsCount = $.parseJSON(wishlistItems);
  11287.                     var wishlistCount = 0;
  11288.                     $.each(wishlistItemsCount, function (i, items) {
  11289.                         wishlistCount = wishlistCount + 1;
  11290.                         console.log(wishlistCount);
  11291.                     });
  11292.                     $.cookie('wishlist_count', wishlistCount, {path: '/'});
  11293.                     if (wishlistCount > 0) {
  11294.                         $('#header .wishlist .count').html('(' + wishlistCount + ')');
  11295.                     }
  11296.                     else {
  11297.                         $('#header .wishlist .count').html('');
  11298.                     }
  11299.                 }, error: function (data) {
  11300.                     ___b24.tracking.error('Wishlist', 'AjaxError');
  11301.                 }});
  11302.             }
  11303.             if (wishlistCount > 0) {
  11304.                 $('#header .wishlist .count').html('(' + wishlistCount + ')');
  11305.             }
  11306.             else {
  11307.                 $('#header .wishlist .count').html('');
  11308.             }
  11309.         }
  11310.         if (typeof($.cookie) == 'function') {
  11311.             wishlistCountSet();
  11312.         }
  11313.         $(document).on('click', '.HISTORY_BACK', function () {
  11314.             history.back();
  11315.             return false;
  11316.         });
  11317.         $(document).on('click', '.NEW_WINDOW, .OUTBOUND', function () {
  11318.             var href = this.href;
  11319.             ___b24.tracking.freeEvent('Outbound', href);
  11320.             setTimeout(function () {
  11321.                 window.open(href);
  11322.             }, 800);
  11323.             return false;
  11324.         });
  11325.         window.$breadcrumb = $('#breadcrumb, .breadcrumbs');
  11326.         if (!$breadcrumb.find('.reference').length) {
  11327.             $breadcrumb.find('.reference_this').hide();
  11328.         }
  11329.         $breadcrumb.show();
  11330.         if (history.length > 1) {
  11331.             $breadcrumb.prepend('<a href="#" class="HISTORY_BACK">&lt; Zurück</a> | ');
  11332.         }
  11333.         $("img.lazy").unveil(200, function () {
  11334.             $(this).load(function () {
  11335.                 this.style.opacity = 1;
  11336.             });
  11337.         });
  11338.     });
  11339. })(jQuery);
  11340. (function ($) {
  11341.     $(function () {
  11342.         if (typeof($.getlocations().params.bb_geschlecht) == 'string' && typeof($.getlocations().params.bb_brille) == 'string') {
  11343.             var gender = $.getlocations().params.bb_geschlecht;
  11344.             var glass = $.getlocations().params.bb_brille;
  11345.             var bb_gender_man = '14579.68698';
  11346.             var bb_gender_woman = '14579.68699';
  11347.             var bb_glass_single = '15699.73378';
  11348.             var bb_glass_progressive = '15699.73379';
  11349.             if ($('#brillenberater').length) {
  11350.                 var bb_url = $('#brillenberater').attr('src');
  11351.                 if (gender == 'herren' && glass == 'einstaerkenbrille') {
  11352.                     $('#brillenberater').attr('src', bb_url + '&p=' + bb_gender_man + '&p=' + bb_glass_single);
  11353.                 }
  11354.                 else if (gender == 'herren' && glass == 'gleitsichtbrille') {
  11355.                     $('#brillenberater').attr('src', bb_url + '&p=' + bb_gender_man + '&p=' + bb_glass_progressive);
  11356.                 }
  11357.                 else if (gender == 'damen' && glass == 'einstaerkenbrille') {
  11358.                     $('#brillenberater').attr('src', bb_url + '&p=' + bb_gender_woman + '&p=' + bb_glass_single);
  11359.                 }
  11360.                 else if (gender == 'damen' && glass == 'gleitsichtbrille') {
  11361.                     $('#brillenberater').attr('src', bb_url + '&p=' + bb_gender_woman + '&p=' + bb_glass_progressive);
  11362.                 }
  11363.             }
  11364.         }
  11365.     });
  11366. })(jQuery);
  11367. (function ($) {
  11368.     if (typeof($.getlocations().params.b24_associate) == 'string') {
  11369.         var associate = $.getlocations().params.b24_associate;
  11370.         associate = associate.toLowerCase();
  11371.         associate = $.trim(associate);
  11372.         associate = associate.replace(/[äöü\?\ ]/gi, '_');
  11373.         if (associate != 'null') {
  11374.             $.cookie('b24_associate', 'associate_' + associate, {path: '/'});
  11375.         }
  11376.         else {
  11377.             $.cookie('b24_associate', null, {path: '/'});
  11378.         }
  11379.     }
  11380.     if ($.cookie('b24_associate') != null) {
  11381.         $('html').addClass($.cookie('b24_associate'));
  11382.     }
  11383. })(jQuery);
  11384. var B24_survey_layer = (function ($) {
  11385.     var pub = {};
  11386.     var displayMode = null;
  11387.     pub.init = function () {
  11388.         if (getDisplayMode() && B24_shoplocation.get() == 'homepage') {
  11389.             setTimeout(setLayer, 1000);
  11390.         }
  11391.     }
  11392.     getDisplayMode = function () {
  11393.         if (displayMode != null) {
  11394.             return displayMode;
  11395.         }
  11396.         setDisplayMode();
  11397.         return displayMode;
  11398.     }
  11399.     setDisplayMode = function () {
  11400.         var c = $.cookie('b24_survey');
  11401.         if (c == null) {
  11402.             displayMode = getOneOfThree();
  11403.             $.cookie('b24_survey', displayMode ? '1' : '0', {path: '/'});
  11404.             return displayMode;
  11405.         }
  11406.         displayMode = c == '1' ? true : false;
  11407.         return displayMode;
  11408.     }
  11409.     pub.setMode = function (mode) {
  11410.         displayMode = mode;
  11411.         $.cookie('b24_survey', displayMode ? '1' : '0', {path: '/'});
  11412.         displayMode ? setLayer() : removeLayer();
  11413.         return displayMode;
  11414.     }
  11415.     pub.getMode = function () {
  11416.         return getDisplayMode();
  11417.     }
  11418.     getOneOfThree = function () {
  11419.         var ran = Math.round(Math.random() * 10) % 3;
  11420.         if (ran == 1) {
  11421.             return true;
  11422.         }
  11423.         return false;
  11424.     }
  11425.     setLayer = function () {
  11426.         $('#survey_layer').remove();
  11427.         $('body').append('<div id="survey_layer" style="position:absolute;width:460px;height:330px;left:50%;top:200px;margin:0 0 0 -230px;z-index: 6;"><a href="https://de.surveymonkey.com/s/L8CVTFQ" onClick="B24_survey_layer.setMode(false)" class="NEW_WINDOW"><img src="fileadmin/template/images/survey_yes.png" style="vertical-align:top"/></a><a href="#" onClick="B24_survey_layer.setMode(false)"><img src="fileadmin/template/images/survey_no.png" /></a></div>');
  11428.     }
  11429.     removeLayer = function () {
  11430.         $('#survey_layer').remove();
  11431.     }
  11432.     return pub;
  11433. })(jQuery);
  11434. ;
  11435.  
  11436. window.B24_items = {};
  11437. (function ($) {
  11438.     $(init);
  11439.     function init() {
  11440.         $ci = $('.CALL_ITEMS');
  11441.         if (!$ci.length) {
  11442.             return false;
  11443.         }
  11444.         $ci.each(function () {
  11445.             renderItems($(this));
  11446.         });
  11447.     }
  11448.  
  11449.     function renderItems($t) {
  11450.         var url = '/shop/productinfo/index/multiple/data/[' + getItemsList($t) + ']';
  11451.         $.ajax({url: url, cache: false, dataType: 'json', success: function (data) {
  11452.             B24_items.push(data);
  11453.             buildItems($t, data);
  11454.         }, error: function () {
  11455.             $t.html('<p class="error">Ein Fehler ist aufgetaucht. Bitte laden Sie diese Seite neu.</p>');
  11456.         }});
  11457.         return true;
  11458.     }
  11459.  
  11460.     function getItemsList($t) {
  11461.         var sku_arr = $t.metadata().items;
  11462.         var sku_json = '';
  11463.         $.each(sku_arr, function (index, value) {
  11464.             sku_json += '"' + value + '",';
  11465.         });
  11466.         sku_json = sku_json.replace(/\,$/i, '');
  11467.         window.B24_items = sku_arr;
  11468.         return sku_json;
  11469.     }
  11470.  
  11471.     function buildItems($t, data) {
  11472.         var $item = $('<div />');
  11473.         $item.html('<div class="item"><h2 />  <div class="img"><a class="link"><img class="image"/></a></div>  <a class="price" /><a class="button arrow_right_inv"><span>Hier geht es zur Brille</span></a></div>');
  11474.         $.each(data, function (key, value) {
  11475.             if (value.is_salable) {
  11476.                 var $clone = $item.clone();
  11477.                 $clone.find('h2').text(value.name);
  11478.                 $clone.find('img').attr('src', value.generated_images[220]);
  11479.                 $clone.find('p.description').html(value.short_description);
  11480.                 if ($ci.hasClass('progressive')) {
  11481.                     formated_price = '149,90 € *';
  11482.                 }
  11483.                 else {
  11484.                     var formated_price = value.calculated_price;
  11485.                     formated_price = formated_price.toFixed(2) + ' ';
  11486.                     formated_price = formated_price.replace(/\./i, ',');
  11487.                     formated_price += '€ *';
  11488.                 }
  11489.                 $clone.find('.price').html('<div class="category-from-price">ab </div>' + formated_price);
  11490.                 if ($ci.hasClass('progressive')) {
  11491.                     $clone.find('a').attr('href', value.url_path + '?glass=progressive');
  11492.                 }
  11493.                 else {
  11494.                     $clone.find('a').attr('href', value.url_path);
  11495.                 }
  11496.                 $t.append($clone.show());
  11497.             }
  11498.         });
  11499.     }
  11500. })(jQuery);
  11501. (function ($) {
  11502.     $(init);
  11503.     function init() {
  11504.         $lp = $('.LOAD_PRODUCTS');
  11505.         if (!$lp.length) {
  11506.             return false;
  11507.         }
  11508.         $lp.each(function () {
  11509.             renderProducts($(this));
  11510.         });
  11511.     }
  11512.  
  11513.     function renderProducts($t) {
  11514.         var products = $t.data('products').replace(/,/g, '","');
  11515.         var url = '/shop/productinfo/index/products/products/["' + products + '"]?load';
  11516.         if ($t.data('glass')) {
  11517.             url += '&glass=' + $t.data('glass');
  11518.             if ($t.data('glass') == 'progressive') {
  11519.                 $t.addClass('progressive');
  11520.             }
  11521.         }
  11522.         if ($t.data('glassmode')) {
  11523.             url += '&mode=' + $t.data('glassmode');
  11524.         }
  11525.         if ($t.data('sticker')) {
  11526.             if ($t.data('sticker') == 'new') {
  11527.                 $t.addClass('sticker new');
  11528.             }
  11529.             else if ($t.data('sticker') == 'top') {
  11530.                 $t.addClass('sticker top');
  11531.             }
  11532.             else if ($t.data('sticker') == 'sport') {
  11533.                 $t.addClass('sticker sport');
  11534.             }
  11535.             else if ($t.data('sticker') == 'percent') {
  11536.                 $t.addClass('sticker percent');
  11537.             }
  11538.         }
  11539.         $.ajax({url: url, cache: true, dataType: 'json', success: function (data) {
  11540.             buildProductList($t, data);
  11541.         }, error: function () {
  11542.             $t.html('<p class="error">Ein Fehler ist aufgetaucht. Bitte laden Sie diese Seite neu. [1510]</p>');
  11543.         }});
  11544.         return true;
  11545.     }
  11546.  
  11547.     function formatPrice(price) {
  11548.         var formated_price = price;
  11549.         formated_price = formated_price.toFixed(2) + ' ';
  11550.         formated_price = formated_price.replace(/\./i, ',');
  11551.         formated_price += '€*';
  11552.         return formated_price;
  11553.     }
  11554.  
  11555.     function buildProductList($t, data) {
  11556.         var $item = $('<div class="item" />');
  11557.         $item.html('<a><h2 /><span class="img"><img class="image" width="210" height="140"></span><span class="price" /></a>');
  11558.         $.each(data, function (key, value) {
  11559.             if (value.is_salable) {
  11560.                 var $clone = $item.clone();
  11561.                 $clone.find('h2').text(value.name);
  11562.                 $clone.find('img').attr('src', value.generated_images[210]);
  11563.                 $clone.find('p.description').html(value.short_description);
  11564.                 $clone.find('a').attr('href', value.url_path);
  11565.                 var formated_price = formatPrice(value.uvp);
  11566.                 $clone.find('.price').html('<span class="b24_normal_price">' + formated_price + '</div>');
  11567.                 if (value.uvp > value.calculated_price) {
  11568.                     $clone.find('a').addClass('b24_special_price');
  11569.                     var formated_price = formatPrice(value.calculated_price);
  11570.                     $clone.find('.b24_normal_price').after('<span class="b24_special_price">ab ' + formated_price + '</span>');
  11571.                 }
  11572.                 if ($t.data('sticker')) {
  11573.                     $clone.find('.img').prepend('<span class="sticker"/>');
  11574.                 }
  11575.                 $t.append($clone);
  11576.             }
  11577.         });
  11578.     }
  11579. })(jQuery);
  11580. (function ($) {
  11581.     $(init);
  11582.     function init() {
  11583.         $ls = $('.LOAD_SLIDER');
  11584.         if (!$ls.length) {
  11585.             return false;
  11586.         }
  11587.         $ls.each(function () {
  11588.             renderProducts($(this));
  11589.         });
  11590.     }
  11591.  
  11592.     function CallSlickSliderFunction(classname, porductcount) {
  11593.         $('div.' + classname).slick({dots: false, infinite: true, slidesToShow: porductcount, slidesToScroll: porductcount});
  11594.     }
  11595.  
  11596.     function renderProducts($t) {
  11597.         var products = $t.data('products').replace(/,/g, '","');
  11598.         var url = '/shop/productinfo/index/products/products/["' + products + '"]?load';
  11599.         if ($t.data('glass')) {
  11600.             url += '&glass=' + $t.data('glass');
  11601.             if ($t.data('glass') == 'progressive') {
  11602.                 $t.addClass('progressive');
  11603.             }
  11604.         }
  11605.         if ($t.data('glassmode')) {
  11606.             url += '&mode=' + $t.data('glassmode');
  11607.         }
  11608.         if ($t.data('sticker')) {
  11609.             if ($t.data('sticker') == 'new') {
  11610.                 $t.addClass('sticker new');
  11611.             }
  11612.             else if ($t.data('sticker') == 'top') {
  11613.                 $t.addClass('sticker top');
  11614.             }
  11615.             else if ($t.data('sticker') == 'sport') {
  11616.                 $t.addClass('sticker sport');
  11617.             }
  11618.             else if ($t.data('sticker') == 'percent') {
  11619.                 $t.addClass('sticker percent');
  11620.             }
  11621.         }
  11622.         $.ajax({url: url, cache: true, dataType: 'json', success: function (data) {
  11623.             buildSlider($t, data);
  11624.         }, error: function () {
  11625.             $t.html('<p class="error">Ein Fehler ist aufgetaucht. Bitte laden Sie diese Seite neu. [1510]</p>');
  11626.         }});
  11627.         return true;
  11628.     }
  11629.  
  11630.     function formatPrice(price) {
  11631.         var formated_price = price;
  11632.         formated_price = formated_price.toFixed(2) + ' ';
  11633.         formated_price = formated_price.replace(/\./i, ',');
  11634.         formated_price += '€*';
  11635.         return formated_price;
  11636.     }
  11637.  
  11638.     function buildSlider($t, data) {
  11639.         var $item = "";
  11640.         $.each(data, function (key, value) {
  11641.             if (value.is_salable) {
  11642.                 $item += '<div class="swiper-slide">';
  11643.                 $item += '<a href="' + value.url_path + '">';
  11644.                 if ($t.data('sticker')) {
  11645.                     $item += '<span class="sticker"></span>';
  11646.                 }
  11647.                 var formated_price = formatPrice(value.uvp);
  11648.                 if (value.uvp > value.calculated_price) {
  11649.                     var formated_special_price = formatPrice(value.calculated_price);
  11650.                     $item +=
  11651.                             '<span class="price b24_special"><span class="b24_normal_price">' + formated_price
  11652.                             + '</span><span class="b24_special_price"><div class="category-from-price">ab </div>' + formated_special_price
  11653.                             + '</span></span>';
  11654.                 }
  11655.                 else {
  11656.                     $item +=
  11657.                             '<span class="price"><span class="b24_normal_price"><div class="category-from-price">ab </div>' + formated_price
  11658.                             + '</span></span>';
  11659.                 }
  11660.                 $item += '<span class="name">Modell: ' + value.name + '</span>';
  11661.                 $item += '<img src="' + value.generated_images[210] + '" width="150" />';
  11662.                 $item += '</a>';
  11663.                 $item += '</div>';
  11664.             }
  11665.         });
  11666.         if ($t.hasClass('big')) {
  11667.             product_count = 5;
  11668.         }
  11669.         else {
  11670.             product_count = 4;
  11671.         }
  11672.         var time = new Date().getTime();
  11673.         var uniqueclassname = "SLICK_" + time;
  11674.         $t.addClass(uniqueclassname);
  11675.         var sliderCanvas = $item;
  11676.         $t.html(sliderCanvas);
  11677.         CallSlickSliderFunction(uniqueclassname, product_count);
  11678.     }
  11679. })(jQuery);
  11680. (function ($) {
  11681.     $(init_slider);
  11682.     function init_slider() {
  11683.         $ciSlider = $('.CALL_SLIDER');
  11684.         if (!$ciSlider.length) {
  11685.             return false;
  11686.         }
  11687.         $ciSlider.each(function () {
  11688.             renderSliderItems($(this));
  11689.         });
  11690.     }
  11691.  
  11692.     function getItemsList($t) {
  11693.         var sku_arr = $t.metadata().items;
  11694.         var sku_json = '';
  11695.         $.each(sku_arr, function (index, value) {
  11696.             sku_json += '"' + value + '",';
  11697.         });
  11698.         sku_json = sku_json.replace(/\,$/i, '');
  11699.         window.B24_items = sku_arr;
  11700.         return sku_json;
  11701.     }
  11702.  
  11703.     function renderSliderItems($t) {
  11704.         var url = '/shop/productinfo/index/multiple/data/[' + getItemsList($t) + ']';
  11705.         $.ajax({url: url, cache: false, dataType: 'json', success: function (data) {
  11706.             var $item = "";
  11707.             $.each(data, function (key, value) {
  11708.                 if (value.is_salable) {
  11709.                     $item += '<div class="swiper-slide">';
  11710.                     if ($t.hasClass('progressive')) {
  11711.                         $item += '<a href="' + value.url_path + '?glass=progressive">';
  11712.                     }
  11713.                     else {
  11714.                         $item += '<a href="' + value.url_path + '">';
  11715.                     }
  11716.                     if ($t.hasClass('progressive')) {
  11717.                         var formated_price = value.calculated_price;
  11718.                         formated_price = formated_price + 110;
  11719.                         formated_price = formated_price.toFixed(2) + ' ';
  11720.                         formated_price = formated_price.replace(/\./i, ',');
  11721.                         formated_price += '€ *';
  11722.                     }
  11723.                     else {
  11724.                         var formated_price = value.calculated_price;
  11725.                         formated_price = formated_price.toFixed(2) + ' ';
  11726.                         formated_price = formated_price.replace(/\./i, ',');
  11727.                         formated_price += '€ *';
  11728.                     }
  11729.                     $item += '<span class="price"><div class="category-from-price">ab </div>' + formated_price + '</span>';
  11730.                     $item += '<span class="name">Modell: ' + value.name + '</span>';
  11731.                     if ($t.hasClass('sticker_top')) {
  11732.                         $item += '<span class="sticker top"></span>';
  11733.                     }
  11734.                     else if ($t.hasClass('sticker_new')) {
  11735.                         $item += '<span class="sticker new"></span>';
  11736.                     }
  11737.                     $item += '<img src="' + value.generated_images[220] + '" width="150" />';
  11738.                     $item += '</a>';
  11739.                     $item += '</div>';
  11740.                 }
  11741.             });
  11742.             var sliderCanvas = '<div class="glasses-slider swiper"><div class="arrow-left gradient"></div><div class="glasses-container swiper-container"><div class="swiper-wrapper">'
  11743.                     + $item + '</div></div><div class="arrow-right gradient"></div></div>';
  11744.             $t.after(sliderCanvas);
  11745.             $t.remove();
  11746.             if ($t.hasClass('big')) {
  11747.                 $('.glasses-slider').addClass('bigSlider');
  11748.                 var glassesSlider = $('.glasses-container').swiper({slidesPerView: 5, slidesPerGroup: 5, loop: true, calculateHeight: true, useCSS3Transforms: false});
  11749.             }
  11750.             else {
  11751.                 var glassesSlider = $('.glasses-container').swiper({slidesPerView: 4, slidesPerGroup: 4, loop: true, calculateHeight: true});
  11752.             }
  11753.             $('.arrow-left').on('click', function (e) {
  11754.                 glassesSlider.swipePrev();
  11755.             })
  11756.             $('.arrow-right').on('click', function (e) {
  11757.                 glassesSlider.swipeNext();
  11758.             })
  11759.         }, error: function () {
  11760.             $t.html('<p class="error">Ein Fehler ist aufgetaucht. Bitte laden Sie diese Seite neu.</p>');
  11761.         }});
  11762.         return true;
  11763.     }
  11764. })(jQuery);
  11765. ;
  11766.  
  11767. if (($.jStorage.get('b24_mobile') != 0 && $.browser.mobile && location.pathname.match(/^\//i) && $.getlocations().params.b24_m != 0)
  11768.         || ($.getlocations().params.b24_m == 1)) {
  11769.     $('html').addClass('mobilepage');
  11770.     $(function () {
  11771.         var mobileSlider = $('.swiper-container').swiper({loop: true, autoplay: true, speed: 700, autoplay: 3000, calculateHeight: true, pagination: '.pagination', paginationClickable: true});
  11772.     });
  11773. }
  11774. else if ($.getlocations().params.b24_m == 0) {
  11775.     $.jStorage.set('b24_mobile', 0);
  11776. }
  11777. ;
  11778. ;
  11779.  
  11780. (function ($) {
  11781.     function maybeCall(thing, ctx) {
  11782.         return(typeof thing == 'function') ? (thing.call(ctx)) : thing;
  11783.     };
  11784.     function isElementInDOM(ele) {
  11785.         while (ele = ele.parentNode) {
  11786.             if (ele == document) {
  11787.                 return true;
  11788.             }
  11789.         }
  11790.         return false;
  11791.     };
  11792.     function Tipsy(element, options) {
  11793.         this.$element = $(element);
  11794.         this.options = options;
  11795.         this.enabled = true;
  11796.         this.fixTitle();
  11797.     };
  11798.     Tipsy.prototype = {show: function () {
  11799.         var title = this.getTitle();
  11800.         if (title && this.enabled) {
  11801.             var $tip = this.tip();
  11802.             $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
  11803.             $tip[0].className = 'tipsy';
  11804.             $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
  11805.             var pos = $.extend({}, this.$element.offset(), {width: this.$element[0].offsetWidth, height: this.$element[0].offsetHeight});
  11806.             var actualWidth = $tip[0].offsetWidth, actualHeight = $tip[0].offsetHeight, gravity = maybeCall(this.options.gravity, this.$element[0]);
  11807.             var tp;
  11808.             switch (gravity.charAt(0)) {
  11809.                 case'n':
  11810.                     tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
  11811.                     break;
  11812.                 case's':
  11813.                     tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
  11814.                     break;
  11815.                 case'e':
  11816.                     tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
  11817.                     break;
  11818.                 case'w':
  11819.                     tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
  11820.                     break;
  11821.             }
  11822.             if (gravity.length == 2) {
  11823.                 if (gravity.charAt(1) == 'w') {
  11824.                     tp.left = pos.left + pos.width / 2 - 15;
  11825.                 }
  11826.                 else {
  11827.                     tp.left = pos.left + pos.width / 2 - actualWidth + 15;
  11828.                 }
  11829.             }
  11830.             $tip.css(tp).addClass('tipsy-' + gravity);
  11831.             $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
  11832.             if (this.options.className) {
  11833.                 $tip.addClass(maybeCall(this.options.className, this.$element[0]));
  11834.             }
  11835.             if (this.options.fade) {
  11836.                 $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
  11837.             }
  11838.             else {
  11839.                 $tip.css({visibility: 'visible', opacity: this.options.opacity});
  11840.             }
  11841.         }
  11842.     }, hide: function () {
  11843.         if (this.options.fade) {
  11844.             this.tip().stop().fadeOut(function () {
  11845.                 $(this).remove();
  11846.             });
  11847.         }
  11848.         else {
  11849.             this.tip().remove();
  11850.         }
  11851.     }, fixTitle: function () {
  11852.         var $e = this.$element;
  11853.         if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
  11854.             $e.attr('original-title', $e.attr('title') || '').removeAttr('title');
  11855.         }
  11856.     }, getTitle: function () {
  11857.         var title, $e = this.$element, o = this.options;
  11858.         this.fixTitle();
  11859.         var title, o = this.options;
  11860.         if (typeof o.title == 'string') {
  11861.             title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
  11862.         }
  11863.         else if (typeof o.title == 'function') {
  11864.             title = o.title.call($e[0]);
  11865.         }
  11866.         title = ('' + title).replace(/(^\s*|\s*$)/, "");
  11867.         return title || o.fallback;
  11868.     }, tip: function () {
  11869.         if (!this.$tip) {
  11870.             this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
  11871.             this.$tip.data('tipsy-pointee', this.$element[0]);
  11872.         }
  11873.         return this.$tip;
  11874.     }, validate: function () {
  11875.         if (!this.$element[0].parentNode) {
  11876.             this.hide();
  11877.             this.$element = null;
  11878.             this.options = null;
  11879.         }
  11880.     }, enable: function () {
  11881.         this.enabled = true;
  11882.     }, disable: function () {
  11883.         this.enabled = false;
  11884.     }, toggleEnabled: function () {
  11885.         this.enabled = !this.enabled;
  11886.     }};
  11887.     $.fn.tipsy = function (options) {
  11888.         if (options === true) {
  11889.             return this.data('tipsy');
  11890.         }
  11891.         else if (typeof options == 'string') {
  11892.             var tipsy = this.data('tipsy');
  11893.             if (tipsy) {
  11894.                 tipsy[options]();
  11895.             }
  11896.             return this;
  11897.         }
  11898.         options = $.extend({}, $.fn.tipsy.defaults, options);
  11899.         function get(ele) {
  11900.             var tipsy = $.data(ele, 'tipsy');
  11901.             if (!tipsy) {
  11902.                 tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
  11903.                 $.data(ele, 'tipsy', tipsy);
  11904.             }
  11905.             return tipsy;
  11906.         }
  11907.  
  11908.         function enter() {
  11909.             var tipsy = get(this);
  11910.             tipsy.hoverState = 'in';
  11911.             if (options.delayIn == 0) {
  11912.                 tipsy.show();
  11913.             }
  11914.             else {
  11915.                 tipsy.fixTitle();
  11916.                 setTimeout(function () {
  11917.                     if (tipsy.hoverState == 'in') {
  11918.                         tipsy.show();
  11919.                     }
  11920.                 }, options.delayIn);
  11921.             }
  11922.         };
  11923.         function leave() {
  11924.             var tipsy = get(this);
  11925.             tipsy.hoverState = 'out';
  11926.             if (options.delayOut == 0) {
  11927.                 tipsy.hide();
  11928.             }
  11929.             else {
  11930.                 setTimeout(function () {
  11931.                     if (tipsy.hoverState == 'out') {
  11932.                         tipsy.hide();
  11933.                     }
  11934.                 }, options.delayOut);
  11935.             }
  11936.         };
  11937.         if (!options.live) {
  11938.             this.each(function () {
  11939.                 get(this);
  11940.             });
  11941.         }
  11942.         if (options.trigger != 'manual') {
  11943.             var eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
  11944.             if (options.live) {
  11945.                 $(this.context).on(eventIn, this.selector, enter).on(eventOut, this.selector, leave);
  11946.             }
  11947.             else {
  11948.                 this.on(eventIn, enter).on(eventOut, leave);
  11949.             }
  11950.         }
  11951.         return this;
  11952.     };
  11953.     $.fn.tipsy.defaults =
  11954.     {className: null, delayIn: 0, delayOut: 0, fade: false, fallback: '', gravity: 'n', html: false, live: false, offset: 0, opacity: 0.8, title: 'title', trigger: 'hover'};
  11955.     $.fn.tipsy.revalidate = function () {
  11956.         $('.tipsy').each(function () {
  11957.             var pointee = $.data(this, 'tipsy-pointee');
  11958.             if (!pointee || !isElementInDOM(pointee)) {
  11959.                 $(this).remove();
  11960.             }
  11961.         });
  11962.     };
  11963.     $.fn.tipsy.elementOptions = function (ele, options) {
  11964.         return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
  11965.     };
  11966.     $.fn.tipsy.autoNS = function () {
  11967.         return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
  11968.     };
  11969.     $.fn.tipsy.autoWE = function () {
  11970.         return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
  11971.     };
  11972.     $.fn.tipsy.autoBounds = function (margin, prefer) {
  11973.         return function () {
  11974.             var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)}, boundTop = $(document).scrollTop()
  11975.                     + margin, boundLeft = $(document).scrollLeft() + margin, $this = $(this);
  11976.             if ($this.offset().top < boundTop) {
  11977.                 dir.ns = 'n';
  11978.             }
  11979.             if ($this.offset().left < boundLeft) {
  11980.                 dir.ew = 'w';
  11981.             }
  11982.             if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) {
  11983.                 dir.ew = 'e';
  11984.             }
  11985.             if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) {
  11986.                 dir.ns = 's';
  11987.             }
  11988.             return dir.ns + (dir.ew ? dir.ew : '');
  11989.         }
  11990.     };
  11991. })(jQuery);
  11992. ;
  11993.  
  11994. (function ($) {
  11995.     function toIntegersAtLease(n) {
  11996.         return n < 10 ? '0' + n : n;
  11997.     }
  11998.  
  11999.     Date.prototype.toJSON = function (date) {
  12000.         return this.getUTCFullYear() + '-' + toIntegersAtLease(this.getUTCMonth()) + '-' + toIntegersAtLease(this.getUTCDate());
  12001.     };
  12002.     var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g;
  12003.     var meta = {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\'};
  12004.     $.quoteString = function (string) {
  12005.         if (escapeable.test(string)) {
  12006.             return'"' + string.replace(escapeable, function (a) {
  12007.                 var c = meta[a];
  12008.                 if (typeof c === 'string') {
  12009.                     return c;
  12010.                 }
  12011.                 c = a.charCodeAt();
  12012.                 return'\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
  12013.             }) + '"';
  12014.         }
  12015.         return'"' + string + '"';
  12016.     };
  12017.     $.toJSON = function (o, compact) {
  12018.         var type = typeof(o);
  12019.         if (type == "undefined") {
  12020.             return"undefined";
  12021.         }
  12022.         else if (type == "number" || type == "boolean") {
  12023.             return o + "";
  12024.         }
  12025.         else if (o === null) {
  12026.             return"null";
  12027.         }
  12028.         if (type == "string") {
  12029.             return $.quoteString(o);
  12030.         }
  12031.         if (type == "object" && typeof o.toJSON == "function") {
  12032.             return o.toJSON(compact);
  12033.         }
  12034.         if (type != "function" && typeof(o.length) == "number") {
  12035.             var ret = [];
  12036.             for (var i = 0; i < o.length; i++) {
  12037.                 ret.push($.toJSON(o[i], compact));
  12038.             }
  12039.             if (compact) {
  12040.                 return"[" + ret.join(",") + "]";
  12041.             }
  12042.             else {
  12043.                 return"[" + ret.join(", ") + "]";
  12044.             }
  12045.         }
  12046.         if (type == "function") {
  12047.             throw new TypeError("Unable to convert object of type 'function' to json.");
  12048.         }
  12049.         var ret = [];
  12050.         for (var k in o) {
  12051.             var name;
  12052.             type = typeof(k);
  12053.             if (type == "number") {
  12054.                 name = '"' + k + '"';
  12055.             }
  12056.             else if (type == "string") {
  12057.                 name = $.quoteString(k);
  12058.             }
  12059.             else {
  12060.                 continue;
  12061.             }
  12062.             var val = $.toJSON(o[k], compact);
  12063.             if (typeof(val) != "string") {
  12064.                 continue;
  12065.             }
  12066.             if (compact) {
  12067.                 ret.push(name + ":" + val);
  12068.             }
  12069.             else {
  12070.                 ret.push(name + ": " + val);
  12071.             }
  12072.         }
  12073.         return"{" + ret.join(", ") + "}";
  12074.     };
  12075.     $.compactJSON = function (o) {
  12076.         return $.toJSON(o, true);
  12077.     };
  12078.     $.evalJSON = function (src) {
  12079.         return eval("(" + src + ")");
  12080.     };
  12081.     $.secureEvalJSON = function (src) {
  12082.         var filtered = src;
  12083.         filtered = filtered.replace(/\\["\\\/bfnrtu]/g, '@');
  12084.         filtered = filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
  12085.         filtered = filtered.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
  12086.         if (/^[\],:{}\s]*$/.test(filtered)) {
  12087.             return eval("(" + src + ")");
  12088.         }
  12089.         else {
  12090.             throw new SyntaxError("Error parsing JSON, source is not valid.");
  12091.         }
  12092.     };
  12093. })(jQuery);
  12094. ;
  12095. ;
  12096. var ___b24 = ___b24 || {};
  12097. ___b24.RDEdisplay = (function (window, $) {
  12098.     var pub = {}, tracking = B24_debug_status.getMode('tracking'), tplIds = [], content = {}, $RDEdisplay, RDEdata = {}, $jQsData = {}, controlgroup = false;
  12099.     callerIndex = 0, pub.$jQsData = $jQsData;
  12100.     pub.RDEdata = RDEdata;
  12101.     pub.tplIds = tplIds;
  12102.     var init = function () {
  12103.         try {
  12104.             if (!tracking) {
  12105.                 return false;
  12106.             }
  12107.             $RDEdisplay = $('.rde_display');
  12108.             if (!$RDEdisplay.length) {
  12109.                 return false;
  12110.             }
  12111.             $.each($RDEdisplay, function (index, value) {
  12112.                 var tmpl = getTplId($(this));
  12113.                 if (!!tmpl.id) {
  12114.                     tplIds.push({$rde: $(this), tlp: tmpl});
  12115.                 }
  12116.             });
  12117.             startCall(tplIds[callerIndex]);
  12118.             return true;
  12119.         }
  12120.         catch (err) {
  12121.             ___b24.tracking.error('RDEdisplay.init', err);
  12122.             return true;
  12123.         }
  12124.     };
  12125.     pub.init = init;
  12126.     var registerABTest = function (a) {
  12127.         var expID = !a ? '398317' : '398316';
  12128.         window.___b24_experiments = window.___b24_experiments || {};
  12129.         if (typeof(window.___b24_experiments.RDE_Part_iii) === 'undefined') {
  12130.             window.___b24_experiments.RDE_Part_iii = new ___b24.experiment('RDE_Part_iii', ['398316', '398317'], 2, expID);
  12131.             ___b24.tracking.freeEvent('AB-RDE-iii', location.pathname, 'Exp_' + window.___b24_experiments.RDE_Part_iii.getExperiment());
  12132.         }
  12133.         if (window.___b24_experiments.RDE_Part_iii.getExperiment().toString() == '398317') {
  12134.             return true;
  12135.         }
  12136.         return false;
  12137.     };
  12138.     var getTplId = function ($o) {
  12139.         var tplId = {id: false, params: {}};
  12140.         var cart = B24_cart_object.getCart();
  12141.         var product = B24_product_object.get().sku_extended_clean;
  12142.         if (!!cart) {
  12143.             tplId.id = 'BSKB24';
  12144.             var skus = [];
  12145.             $.each(cart.order_items, function (key, value) {
  12146.                 skus.push(value.product_sku_extended_clean);
  12147.             });
  12148.             tplId.params = {productid: skus.join(',')};
  12149.         }
  12150.         else if (product !== 'undefined') {
  12151.             tplId.params = {productid: product};
  12152.         }
  12153.         if ($o.hasClass('rde_homepage')) {
  12154.             tplId.id = 'HPB24';
  12155.         }
  12156.         else if ($o.hasClass('rde_lp_clean')) {
  12157.             tplId.id = 'B24LPClean';
  12158.         }
  12159.         else if ($o.hasClass('rde_lp_progressive')) {
  12160.             tplId.id = 'B24LPProgessive';
  12161.         }
  12162.         else if ($o.hasClass('rde_lp_sunglass')) {
  12163.             tplId.id = 'B24LPSunglass';
  12164.         }
  12165.         else if ($o.hasClass('rde_cart')) {
  12166.             var cart = B24_cart_object.getCart();
  12167.             if (!!cart) {
  12168.                 tplId.id = 'BSKB24';
  12169.                 var skus = [];
  12170.                 $.each(cart.order_items, function (key, value) {
  12171.                     skus.push(value.product_sku_extended_clean);
  12172.                 });
  12173.                 tplId.params = {productid: skus.join(',')};
  12174.             }
  12175.         }
  12176.         else if ($o.hasClass('rde_productview')) {
  12177.             tplId.id = 'PPB24';
  12178.             tplId.params = {productid: B24_product_object.get().sku_extended_clean};
  12179.         }
  12180.         else if (!!$o.attr('class').match(/rde_tpl_([-_a-z0-9]+)/i)) {
  12181.             tplId.id = $o.attr('class').match(/rde_tpl_([-_a-z0-9]+)/i)[1];
  12182.         }
  12183.         return tplId;
  12184.     };
  12185.     pub.getTplId = getTplId;
  12186.     var startCall = function (t) {
  12187.         if (typeof($jQsData[t.tlp.id]) === 'object') {
  12188.             display(t, $jQsData[t.tlp.id]);
  12189.             return true;
  12190.         }
  12191.         var url = '/___rde/rde_server/res/B24P/recomm/' + t.tlp.id + '/sid/' + ___b24.frontendSession.get();
  12192.         $.ajax({url: url, dataType: 'json', data: t.tlp.params, error: function () {
  12193.             ___b24.tracking.error('RDEdisplay.startCall', url + '?' + $.param(t.tlp.params));
  12194.             nextCall();
  12195.         }, success: function (data) {
  12196.             gatherData(t, data);
  12197.         }});
  12198.     };
  12199.     var nextCall = function () {
  12200.         callerIndex++;
  12201.         if (callerIndex < tplIds.length) {
  12202.             startCall(tplIds[callerIndex]);
  12203.         }
  12204.     }
  12205.     var gatherData = function (t, data) {
  12206.         data = reorderData(data);
  12207.         RDEdata[t.tlp.id] = data;
  12208.         if (controlgroup) {
  12209.             detachRDE(t.$rde);
  12210.             return false;
  12211.         }
  12212.         $jQs = buildjQuerys(data, t);
  12213.         $jQsData[t.tlp.id] = $jQs;
  12214.         display(t, $jQs);
  12215.     };
  12216.     var display = function (t, $jQs) {
  12217.         nextCall();
  12218.         var boxAttr = false;
  12219.         if (!t.$rde.hasClass('rde_box_all')) {
  12220.             boxAttr = $.grep(t.$rde.attr('class').split(' '), function (a) {
  12221.                 return!!a.match(/^rde_box\d+/i);
  12222.             });
  12223.         }
  12224.         var $leaves = t.$rde.find('.rde_leave');
  12225.         t.$rde.empty();
  12226.         if (!!boxAttr) {
  12227.             $.each(boxAttr, function (i, v) {
  12228.                 var theBox = v.replace(/^.*(box\d+).*$/i, '$1');
  12229.                 if (typeof($jQs[theBox]) === 'object') {
  12230.                     t.$rde.append($($jQs[theBox].find('.rdeslot')).clone());
  12231.                 }
  12232.             });
  12233.         }
  12234.         else {
  12235.             $.each($jQs, function (i, v) {
  12236.                 t.$rde.append($(v.find('.rdeslot')).clone());
  12237.             });
  12238.         }
  12239.         if (!t.$rde.find('.rdeslot').length) {
  12240.             t.$rde.remove();
  12241.             return false;
  12242.         }
  12243.         t.$rde.show();
  12244.         $leaves.insertBefore(t.$rde).show();
  12245.         if (t.$rde.hasClass('rde_slider')) {
  12246.             initSwiper(t.$rde);
  12247.         }
  12248.         registerEvents(t.$rde);
  12249.     };
  12250.     var detachRDE = function ($rde) {
  12251.         $rde.find('rde_leave').remove();
  12252.         $rdeChilds = $rde.children();
  12253.         if (!$rdeChilds.length) {
  12254.             $rde.remove();
  12255.         }
  12256.         else {
  12257.             $($rdeChilds[0]).unwrap();
  12258.         }
  12259.     }
  12260.     var buildjQuerys = function (data, t) {
  12261.         var jQs = {};
  12262.         $.each(data, function (key, value) {
  12263.             if (!!!key.match(/^global/i)) {
  12264.                 jQs[key] = parse(key, value, getHTML_Tpl().tpl1, t);
  12265.             }
  12266.         });
  12267.         return jQs;
  12268.     };
  12269.     var parse = function (boxName, obj, HTML_Template, t) {
  12270.         var $box = HTML_Template.boxTpl.clone();
  12271.         var $slot;
  12272.         $box.addClass(boxName).addClass('box_' + boxName);
  12273.         $.each(obj, function (index, value) {
  12274.             $slot = HTML_Template.slotTpl.clone();
  12275.             $slot.addClass(value.mode).addClass('box_' + boxName);
  12276.             $.each(value, function (key, value1) {
  12277.                 $slot.find('span.' + key).append('<span>' + value1 + '</span>');
  12278.                 $slot.find('img.' + key).attr('src', value1);
  12279.                 $slot.find('a.' + key).attr('href', value1);
  12280.                 $slot.find('em.' + key).addClass('UID_' + value1);
  12281.                 $slot.find('em.' + key).addClass('box_' + boxName);
  12282.                 $slot.find('em.' + key).addClass('tpl_' + t.tlp.id);
  12283.             });
  12284.             $box.append($slot);
  12285.         });
  12286.         return $box;
  12287.     };
  12288.     var reorderData = function (data) {
  12289.         var boxes = {};
  12290.         $.each(data, function (index, value) {
  12291.             $.each(value, function (key, value1) {
  12292.                 boxes[key] = value1
  12293.             });
  12294.         });
  12295.         $.each(boxes, function (key, value) {
  12296.             if (!!key.match(/box/i)) {
  12297.                 $.each(value, function (index, value1) {
  12298.                     boxes[key][index].mode = 'regular';
  12299.                     if (value1.netUnitPrice != value1.strikeOutPrice) {
  12300.                         boxes[key][index].mode = 'strikeout';
  12301.                     }
  12302.                     $.each(value1, function (key2, value2) {
  12303.                         if (!!key2.match(/price/i)) {
  12304.                             boxes[key][index]['formate_' + key2] = Math.round((value2 * 100)).toString().replace(/(\d{2})$/i, ',$1 €*');
  12305.                         }
  12306.                         if (!!key2.match(/^URL$/i)) {
  12307.                             boxes[key][index][key2] = value2.replace(/^http\:\/\/www\.brille24\.de/, '');
  12308.                         }
  12309.                     });
  12310.                 });
  12311.             }
  12312.         });
  12313.         if (typeof(boxes.global) === 'object' && typeof(boxes.global.controlgroup) === 'string' && boxes.global.controlgroup === 'true') {
  12314.             controlgroup = true;
  12315.         }
  12316.         return boxes;
  12317.     };
  12318.     var registerEvents = function ($o) {
  12319.         $o.find('.rdeslot a').on('click', function () {
  12320.             $UID = $(this).find('.UID');
  12321.             var uid = $UID.attr('class').replace(/^.*UID_([^ ]+).*$/i, '$1');
  12322.             var box = $UID.attr('class').replace(/^.*box_([^ ]+).*$/i, '$1');
  12323.             var tpl = $UID.attr('class').replace(/^.*tpl_([^ ]+).*$/i, '$1');
  12324.             var url = $(this).attr('href');
  12325.             return ___b24.trackRDE.click(uid, box, tpl, url);
  12326.         });
  12327.     };
  12328.     var getHTML_Tpl = function () {
  12329.         var tpls = {};
  12330.         var $box = $('<div class="rdebox" />');
  12331.         var $innerSlot = $('<a class="URL" />').append('<em class="UID">').append('<img class="imageURL"><div />').append('<span class="formate_strikeOutPrice pull_top" style="display: none"></span>').append('<span class="formate_netUnitPrice pull_top"><em>ab </em></span>').append('<span class="param1 pull_top" />').append('<span class="param2 pull_top" />');
  12332.         var $slot = $('<span class="rdeslot" />');
  12333.         $slot.append($innerSlot);
  12334.         tpls.tpl1 = {boxTpl: $box, slotTpl: $slot};
  12335.         return tpls;
  12336.     };
  12337.     var initSwiper = function ($o) {
  12338.         var many = $o.find('.rdeslot').length;
  12339.         $o.wrapInner('<div class="swiper-wrapper" />').wrapInner('<div class="swiper-container" />');
  12340.         $o.find('.rdeslot').addClass('swiper-slide');
  12341.         var mySwiper = $o.find('.swiper-container').swiper({mode: 'horizontal', loop: false, slidesPerView: 4, slidesPerGroup: 4, calculateHeight: true, useCSS3Transforms: false});
  12342.         if (many > 4) {
  12343.             $o.append('<div class="arrow-right gradient">');
  12344.             $o.prepend('<div class="arrow-left gradient">');
  12345.             $o.find('.arrow-left').on('click', function (e) {
  12346.                 mySwiper.swipePrev();
  12347.             });
  12348.             $o.find('.arrow-right').on('click', function (e) {
  12349.                 mySwiper.swipeNext();
  12350.             });
  12351.         }
  12352.     };
  12353.     $(init);
  12354.     return pub;
  12355. })(window, jQuery, undefined);
  12356. var ___b24 = ___b24 || {};
  12357. ___b24.trackRDE = (function (window, $) {
  12358.     var pub = {};
  12359.     var tracking = B24_debug_status.getMode('tracking');
  12360.     var track = function () {
  12361.         if (!tracking) {
  12362.             return false;
  12363.         }
  12364.         try {
  12365.             var ok = false;
  12366.             var loc = B24_shoplocation.get();
  12367.             var params = {};
  12368.             if (loc == 'detail') {
  12369.                 params.productid = B24_product_object.get().sku_extended_clean;
  12370.                 call('event/productview/sid/' + ___b24.frontendSession.get(), params);
  12371.                 ok = true;
  12372.             }
  12373.             if (loc == 'listing') {
  12374.                 params.categoryid = B24_shoplocation.getCategoryID();
  12375.                 call('event/categoryview/sid/' + ___b24.frontendSession.get(), params);
  12376.                 ok = true;
  12377.             }
  12378.             else if (loc == 'cart') {
  12379.                 var order = B24_cart_object.getCart();
  12380.                 if (!!order.order_items.length) {
  12381.                     var itemsA = [];
  12382.                     var qtyA = [];
  12383.                     var priceA = [];
  12384.                     $.each(order.order_items, function (key, value) {
  12385.                         itemsA.push(value.product_sku_extended_clean);
  12386.                         qtyA.push(value.qty_ordered);
  12387.                         priceA.push(value.price);
  12388.                     });
  12389.                     params = {itemids: itemsA.join(','), quantities: qtyA.join(',')};
  12390.                     call('event/basket/sid/' + ___b24.frontendSession.get(), params);
  12391.                     ok = true;
  12392.                 }
  12393.             }
  12394.             else if (loc == 'success') {
  12395.                 var order = B24_order_object.getOrder();
  12396.                 if (!order) {
  12397.                     return false;
  12398.                 }
  12399.                 var itemsA = [];
  12400.                 var qtyA = [];
  12401.                 var priceA = []
  12402.                 $.each(order.order_items, function (key, value) {
  12403.                     itemsA.push(value.product_sku_extended_clean);
  12404.                     qtyA.push(parseInt(value.qty_ordered, 10));
  12405.                     priceA.push(Math.round(parseFloat(value.price) * 100) / 100);
  12406.                 });
  12407.                 params = {itemids: itemsA.join(','), quantities: qtyA.join(','), utp: priceA.join(',')};
  12408.                 call('event/order/sid/' + ___b24.frontendSession.get(), params);
  12409.                 ok = true;
  12410.             }
  12411.             if (ok) {
  12412.                 recognizeCustomer();
  12413.                 ___l(params, 'RDE.track');
  12414.                 return true;
  12415.             }
  12416.         }
  12417.         catch (err) {
  12418.             ___b24.tracking.error('trackRDE.track', err);
  12419.         }
  12420.     };
  12421.     pub.track = track;
  12422.     var click = function (itm, b, tpl, url) {
  12423.         try {
  12424.             if (!tracking) {
  12425.                 return true;
  12426.             }
  12427.             var params = {};
  12428.             if (typeof(itm) != 'string') {
  12429.                 throw'wrong itm';
  12430.             }
  12431.             else {
  12432.                 params.itemid = itm;
  12433.             }
  12434.             if (typeof(tpl) == 'string') {
  12435.                 params.template = tpl;
  12436.             }
  12437.             if (typeof(b) == 'string') {
  12438.                 params.box = b;
  12439.             }
  12440.             call('event/click/sid/' + ___b24.frontendSession.get(), params, function () {
  12441.                 location.href = url;
  12442.             });
  12443.             ___l(params, 'RDE.click');
  12444.             return false;
  12445.         }
  12446.         catch (err) {
  12447.             ___b24.tracking.error('trackRDE.click', err);
  12448.             return true;
  12449.         }
  12450.     };
  12451.     pub.click = click;
  12452.     var recognizeCustomer = function () {
  12453.         if (!tracking) {
  12454.             return true;
  12455.         }
  12456.         var cID = B24_customer_object.getCustomerId();
  12457.         if (cID == false) {
  12458.             return false;
  12459.         }
  12460.         call('event/usertosession/sid/' + ___b24.frontendSession.get() + '/userid/' + cID);
  12461.         ___l(cID, 'RDE.user.track');
  12462.         return true;
  12463.     };
  12464.     var call = function (u, p, fb) {
  12465.         var url = '/___rde/rde_server/res/B24P/';
  12466.         url += u;
  12467.         if (typeof(p) == 'object') {
  12468.             url = makeURL(url, p);
  12469.         }
  12470.         $.ajax({url: url, dataType: 'script', error: function (jqX, errText) {
  12471.             ___b24.tracking.error('trackRDE.call.ajax', errText);
  12472.             if (typeof(fb) == 'function') {
  12473.                 setTimeout(fb, 1000);
  12474.             }
  12475.         }, success: function () {
  12476.             if (typeof(fb) == 'function') {
  12477.                 fb();
  12478.             }
  12479.         }});
  12480.     };
  12481.     var makeURL = function (url, params) {
  12482.         if (typeof(params) == 'object') {
  12483.             params = $.param(params);
  12484.         }
  12485.         else {
  12486.             return url;
  12487.         }
  12488.         if (!!url.match(/\?/i)) {
  12489.             url += '&';
  12490.         }
  12491.         else {
  12492.             url += '?';
  12493.         }
  12494.         url += params;
  12495.         return url;
  12496.     };
  12497.     return pub;
  12498. })(window, jQuery, undefined);
  12499. var ___b24 = ___b24 || {};
  12500. ___b24.frontendSession = (function (window, $) {
  12501.     var pub = {};
  12502.     var session = false;
  12503.     var storage = '___b24s';
  12504.     var expTTL = 365;
  12505.     var init = function () {
  12506.         if (!!$.cookie(storage)) {
  12507.             session = $.cookie(storage);
  12508.         }
  12509.         else {
  12510.             session = setHash();
  12511.         }
  12512.         $.cookie(storage, session, {'path': '/', 'expires': expTTL});
  12513.     };
  12514.     var get = function () {
  12515.         return session;
  12516.     };
  12517.     pub.get = get;
  12518.     var fourDigits = function () {
  12519.         return(((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1).toUpperCase();
  12520.     };
  12521.     var setHash = function () {
  12522.         var rand = fourDigits() + fourDigits() + fourDigits() + fourDigits() + fourDigits() + fourDigits() + fourDigits() + fourDigits()
  12523.                 + new Date().getTime();
  12524.         return $.md5(rand);
  12525.     };
  12526.     init();
  12527.     return pub;
  12528. })(window, jQuery, undefined);
  12529. ;
  12530.  
  12531. function decryptCharcode(n, start, end, offset) {
  12532.     n = n + offset;
  12533.     if (offset > 0 && n > end) {
  12534.         n = start + (n - end - 1);
  12535.     }
  12536.     else if (offset < 0 && n < start) {
  12537.         n = end - (start - n - 1);
  12538.     }
  12539.     return String.fromCharCode(n);
  12540. }
  12541. function decryptString(enc, offset) {
  12542.     var dec = "";
  12543.     var len = enc.length;
  12544.     for (var i = 0; i < len; i++) {
  12545.         var n = enc.charCodeAt(i);
  12546.         if (n >= 0x2B && n <= 0x3A) {
  12547.             dec += decryptCharcode(n, 0x2B, 0x3A, offset);
  12548.         }
  12549.         else if (n >= 0x40 && n <= 0x5A) {
  12550.             dec += decryptCharcode(n, 0x40, 0x5A, offset);
  12551.         }
  12552.         else if (n >= 0x61 && n <= 0x7A) {
  12553.             dec += decryptCharcode(n, 0x61, 0x7A, offset);
  12554.         }
  12555.         else {
  12556.             dec += enc.charAt(i);
  12557.         }
  12558.     }
  12559.     return dec;
  12560. }
  12561. function linkTo_UnCryptMailto(s) {
  12562.     location.href = decryptString(s, -2);
  12563. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement