Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
- * 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
- */
- ;
- window.Modernizr = function (a, b, c) {
- function D(a) {
- j.cssText = a
- }
- function E(a, b) {
- return D(n.join(a + ";") + (b || ""))
- }
- function F(a, b) {
- return typeof a === b
- }
- function G(a, b) {
- return!!~("" + a).indexOf(b)
- }
- function H(a, b) {
- for (var d in a) {
- var e = a[d];
- if (!G(e, "-") && j[e] !== c) {
- return b == "pfx" ? e : !0
- }
- }
- return!1
- }
- function I(a, b, d) {
- for (var e in a) {
- var f = b[a[e]];
- if (f !== c) {
- return d === !1 ? a[e] : F(f, "function") ? f.bind(d || b) : f
- }
- }
- return!1
- }
- function J(a, b, c) {
- var d = a.charAt(0).toUpperCase() + a.slice(1), e = (a + " " + p.join(d + " ") + d).split(" ");
- return F(b, "string") || F(b, "undefined") ? H(e, b) : (e = (a + " " + q.join(d + " ") + d).split(" "), I(e, b, c))
- }
- function K() {
- e.input = function (c) {
- for (var d = 0, e = c.length; d < e; d++) {
- u[c[d]] = c[d]in k;
- }
- return u.list && (u.list = !!b.createElement("datalist") && !!a.HTMLDataListElement), u
- }("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")), e.inputtypes = function (a) {
- for (var d = 0, e, f, h, i = a.length; d < i; d++) {
- k.setAttribute("type", f = a[d]), e = k.type !== "text", e && (k.value = l, k.style.cssText =
- "position:absolute;visibility:hidden;", /^range$/.test(f) && k.style.WebkitAppearance !== c ?
- (g.appendChild(k), h = b.defaultView, e =
- h.getComputedStyle && h.getComputedStyle(k, null).WebkitAppearance !== "textfield" && k.offsetHeight
- !== 0, g.removeChild(k)) :
- /^(search|tel)$/.test(f) || (/^(url|email)$/.test(f) ? e = k.checkValidity && k.checkValidity() === !1 :
- e = k.value != l)), t[a[d]] = !!e;
- }
- return t
- }("search tel url email datetime date month week time datetime-local number range color".split(" "))
- }
- 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,
- c,
- d,
- e) {
- var f, i, j, k, l = b.createElement("div"), m = b.body, n = m || b.createElement("body");
- if (parseInt(d, 10)) {
- while (d--) {
- j = b.createElement("div"), j.id = e ? e[d] : h + (d + 1), l.appendChild(j);
- }
- }
- return f = ["­", '<style id="s', h, '">', a, "</style>"].join(""), l.id = h, (m ? l : n).innerHTML += f, n.appendChild(l), m
- || (n.style.background = "", n.style.overflow = "hidden", k = g.style.overflow, g.style.overflow = "hidden", g.appendChild(n)), i =
- c(l, a), m ? l.parentNode.removeChild(l) : (n.parentNode.removeChild(n), g.style.overflow = k), !!i
- }, z = function (b) {
- var c = a.matchMedia || a.msMatchMedia;
- if (c) {
- return c(b).matches;
- }
- var d;
- return y("@media " + b + " { #" + h + " { position: absolute; } }", function (b) {
- d = (a.getComputedStyle ? getComputedStyle(b, null) : b.currentStyle)["position"] == "absolute"
- }), d
- }, A = function () {
- function d(d, e) {
- e = e || b.createElement(a[d] || "div"), d = "on" + d;
- var f = d in e;
- return f || (e.setAttribute || (e = b.createElement("div")), e.setAttribute && e.removeAttribute && (e.setAttribute(d, ""), f =
- F(e[d], "function"), F(e[d], "undefined") || (e[d] = c), e.removeAttribute(d))), e = null, f
- }
- var a = {select: "input", change: "input", submit: "form", reset: "form", error: "img", load: "img", abort: "img"};
- return d
- }(), B = {}.hasOwnProperty, C;
- !F(B, "undefined") && !F(B.call, "undefined") ? C = function (a, b) {
- return B.call(a, b)
- } : C = function (a, b) {
- return b in a && F(a.constructor.prototype[b], "undefined")
- }, Function.prototype.bind || (Function.prototype.bind = function (b) {
- var c = this;
- if (typeof c != "function") {
- throw new TypeError;
- }
- var d = w.call(arguments, 1), e = function () {
- if (this instanceof e) {
- var a = function () {
- };
- a.prototype = c.prototype;
- var f = new a, g = c.apply(f, d.concat(w.call(arguments)));
- return Object(g) === g ? g : f
- }
- return c.apply(b, d.concat(w.call(arguments)))
- };
- return e
- }), s.flexbox = function () {
- return J("flexWrap")
- }, s.flexboxlegacy = function () {
- return J("boxDirection")
- }, s.canvas = function () {
- var a = b.createElement("canvas");
- return!!a.getContext && !!a.getContext("2d")
- }, s.canvastext = function () {
- return!!e.canvas && !!F(b.createElement("canvas").getContext("2d").fillText, "function")
- }, s.webgl = function () {
- return!!a.WebGLRenderingContext
- }, s.touch = function () {
- var c;
- return"ontouchstart"in a || a.DocumentTouch && b instanceof DocumentTouch ? c = !0 :
- y(["@media (", n.join("touch-enabled),("), h, ")", "{#modernizr{top:9px;position:absolute}}"].join(""), function (a) {
- c = a.offsetTop === 9
- }), c
- }, s.geolocation = function () {
- return"geolocation"in navigator
- }, s.postmessage = function () {
- return!!a.postMessage
- }, s.websqldatabase = function () {
- return!!a.openDatabase
- }, s.indexedDB = function () {
- return!!J("indexedDB", a)
- }, s.hashchange = function () {
- return A("hashchange", a) && (b.documentMode === c || b.documentMode > 7)
- }, s.history = function () {
- return!!a.history && !!history.pushState
- }, s.draganddrop = function () {
- var a = b.createElement("div");
- return"draggable"in a || "ondragstart"in a && "ondrop"in a
- }, s.websockets = function () {
- return"WebSocket"in a || "MozWebSocket"in a
- }, s.rgba = function () {
- return D("background-color:rgba(150,255,150,.5)"), G(j.backgroundColor, "rgba")
- }, s.hsla = function () {
- return D("background-color:hsla(120,40%,100%,.5)"), G(j.backgroundColor, "rgba") || G(j.backgroundColor, "hsla")
- }, s.multiplebgs = function () {
- return D("background:url(https://),url(https://),red url(https://)"), /(url\s*\(.*?){3}/.test(j.background)
- }, s.backgroundsize = function () {
- return J("backgroundSize")
- }, s.borderimage = function () {
- return J("borderImage")
- }, s.borderradius = function () {
- return J("borderRadius")
- }, s.boxshadow = function () {
- return J("boxShadow")
- }, s.textshadow = function () {
- return b.createElement("div").style.textShadow === ""
- }, s.opacity = function () {
- return E("opacity:.55"), /^0.55$/.test(j.opacity)
- }, s.cssanimations = function () {
- return J("animationName")
- }, s.csscolumns = function () {
- return J("columnCount")
- }, s.cssgradients = function () {
- var a = "background-image:", b = "gradient(linear,left top,right bottom,from(#9f9),to(white));", c = "linear-gradient(left top,#9f9, white);";
- return D((a + "-webkit- ".split(" ").join(b + a) + n.join(c + a)).slice(0, -a.length)), G(j.backgroundImage, "gradient")
- }, s.cssreflections = function () {
- return J("boxReflect")
- }, s.csstransforms = function () {
- return!!J("transform")
- }, s.csstransforms3d = function () {
- var a = !!J("perspective");
- return a && "webkitPerspective"in g.style
- && y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}", function (b, c) {
- a = b.offsetLeft === 9 && b.offsetHeight === 3
- }), a
- }, s.csstransitions = function () {
- return J("transition")
- }, s.fontface = function () {
- var a;
- return y('@font-face {font-family:"font";src:url("https://")}', function (c, d) {
- var e = b.getElementById("smodernizr"), f = e.sheet || e.styleSheet, g = f ?
- f.cssRules && f.cssRules[0] ? f.cssRules[0].cssText : f.cssText || "" : "";
- a = /src/i.test(g) && g.indexOf(d.split(" ")[0]) === 0
- }), a
- }, s.generatedcontent = function () {
- var a;
- return y(["#", h, "{font:0/0 a}#", h, ':after{content:"', l, '";visibility:hidden;font:3px/1 a}'].join(""), function (b) {
- a = b.offsetHeight >= 3
- }), a
- }, s.video = function () {
- var a = b.createElement("video"), c = !1;
- try {
- if (c = !!a.canPlayType) {
- c = new Boolean(c), c.ogg = a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ""), c.h264 =
- a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ""), c.webm =
- a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "")
- }
- }
- catch (d) {
- }
- return c
- }, s.audio = function () {
- var a = b.createElement("audio"), c = !1;
- try {
- if (c = !!a.canPlayType) {
- c = new Boolean(c), c.ogg = a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), c.mp3 =
- a.canPlayType("audio/mpeg;").replace(/^no$/, ""), c.wav = a.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""), c.m4a =
- (a.canPlayType("audio/x-m4a;") || a.canPlayType("audio/aac;")).replace(/^no$/, "")
- }
- }
- catch (d) {
- }
- return c
- }, s.localstorage = function () {
- try {
- return localStorage.setItem(h, h), localStorage.removeItem(h), !0
- }
- catch (a) {
- return!1
- }
- }, s.sessionstorage = function () {
- try {
- return sessionStorage.setItem(h, h), sessionStorage.removeItem(h), !0
- }
- catch (a) {
- return!1
- }
- }, s.webworkers = function () {
- return!!a.Worker
- }, s.applicationcache = function () {
- return!!a.applicationCache
- }, s.svg = function () {
- return!!b.createElementNS && !!b.createElementNS(r.svg, "svg").createSVGRect
- }, s.inlinesvg = function () {
- var a = b.createElement("div");
- return a.innerHTML = "<svg/>", (a.firstChild && a.firstChild.namespaceURI) == r.svg
- }, s.smil = function () {
- return!!b.createElementNS && /SVGAnimate/.test(m.call(b.createElementNS(r.svg, "animate")))
- }, s.svgclippaths = function () {
- return!!b.createElementNS && /SVGClipPath/.test(m.call(b.createElementNS(r.svg, "clipPath")))
- };
- for (var L in s) {
- C(s, L) && (x = L.toLowerCase(), e[x] = s[L](), v.push((e[x] ? "" : "no-") + x));
- }
- return e.input || K(), e.addTest = function (a, b) {
- if (typeof a == "object") {
- for (var d in a) {
- C(a, d) && e.addTest(d, a[d]);
- }
- }
- else {
- a = a.toLowerCase();
- if (e[a] !== c) {
- return e;
- }
- b = typeof b == "function" ? b() : b, typeof f != "undefined" && f && (g.className += " " + (b ? "" : "no-") + a), e[a] = b
- }
- return e
- }, D(""), i = k = null, function (a, b) {
- function k(a, b) {
- var c = a.createElement("p"), d = a.getElementsByTagName("head")[0] || a.documentElement;
- return c.innerHTML = "x<style>" + b + "</style>", d.insertBefore(c.lastChild, d.firstChild)
- }
- function l() {
- var a = r.elements;
- return typeof a == "string" ? a.split(" ") : a
- }
- function m(a) {
- var b = i[a[g]];
- return b || (b = {}, h++, a[g] = h, i[h] = b), b
- }
- function n(a, c, f) {
- c || (c = b);
- if (j) {
- return c.createElement(a);
- }
- f || (f = m(c));
- var g;
- return f.cache[a] ? g = f.cache[a].cloneNode() :
- e.test(a) ? g = (f.cache[a] = f.createElem(a)).cloneNode() : g = f.createElem(a), g.canHaveChildren && !d.test(a) ?
- f.frag.appendChild(g) : g
- }
- function o(a, c) {
- a || (a = b);
- if (j) {
- return a.createDocumentFragment();
- }
- c = c || m(a);
- var d = c.frag.cloneNode(), e = 0, f = l(), g = f.length;
- for (; e < g; e++) {
- d.createElement(f[e]);
- }
- return d
- }
- function p(a, b) {
- b.cache || (b.cache = {}, b.createElem = a.createElement, b.createFrag = a.createDocumentFragment, b.frag =
- b.createFrag()), a.createElement = function (c) {
- return r.shivMethods ? n(c, a, b) : b.createElem(c)
- }, a.createDocumentFragment =
- Function("h,f",
- "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + l().join().replace(/\w+/g,
- function (a) {
- return b.createElem(a), b.frag.createElement(a), 'c("' + a + '")'
- }) + ");return n}")(r, b.frag)
- }
- function q(a) {
- a || (a = b);
- var c = m(a);
- return r.shivCSS && !f && !c.hasCSS && (c.hasCSS =
- !!k(a, "article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")), j
- || p(a, c), a
- }
- var c = a.html5
- || {}, 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;
- (function () {
- try {
- var a = b.createElement("a");
- a.innerHTML = "<xyz></xyz>", f = "hidden"in a, j = a.childNodes.length == 1 || function () {
- b.createElement("a");
- var a = b.createDocumentFragment();
- return typeof a.cloneNode == "undefined" || typeof a.createDocumentFragment == "undefined" || typeof a.createElement
- == "undefined"
- }()
- }
- catch (c) {
- f = !0, j = !0
- }
- })();
- var r = {elements: c.elements
- || "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
- !== !1, supportsUnknownElements: j, shivMethods: c.shivMethods
- !== !1, type: "default", shivDocument: q, createElement: n, createDocumentFragment: o};
- a.html5 = r, q(b)
- }(this, b), e._version = d, e._prefixes = n, e._domPrefixes = q, e._cssomPrefixes = p, e.mq = z, e.hasEvent = A, e.testProp = function (a) {
- return H([a])
- }, e.testAllProps = J, e.testStyles = y, g.className = g.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (f ? " js " + v.join(" ") : ""), e
- }(this, this.document), function (a, b, c) {
- function d(a) {
- return"[object Function]" == o.call(a)
- }
- function e(a) {
- return"string" == typeof a
- }
- function f() {
- }
- function g(a) {
- return!a || "loaded" == a || "complete" == a || "uninitialized" == a
- }
- function h() {
- var a = p.shift();
- q = 1, a ? a.t ? m(function () {
- ("c" == a.t ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1)
- }, 0) : (a(), h()) : q = 0
- }
- function i(a, c, d, e, f, i, j) {
- function k(b) {
- if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null, b)) {
- "img" != a && m(function () {
- t.removeChild(l)
- }, 50);
- for (var d in y[c]) {
- y[c].hasOwnProperty(d) && y[c][d].onload()
- }
- }
- }
- var j = j || B.errorTimeout, l = b.createElement(a), o = 0, r = 0, u = {t: d, s: c, e: f, a: i, x: j};
- 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 =
- l.onload = l.onreadystatechange = function () {
- k.call(this, r)
- }, p.splice(e, 0, u), "img" != a && (r || 2 === y[c] ? (t.insertBefore(l, s ? null : n), m(k, j)) : y[c].push(l))
- }
- function j(a, b, c, d, f) {
- 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
- }
- function k() {
- var a = B;
- return a.loader = {load: j, i: 0}, a
- }
- var l = b.documentElement, m = a.setTimeout, n = b.getElementsByTagName("script")[0], o = {}.toString, p = [], q = 0, r = "MozAppearance"
- in l.style, s = r && !!b.createRange().compareNode, t = s ? l : n.parentNode, l = a.opera && "[object Opera]"
- == o.call(a.opera), l = !!b.attachEvent && !l, u = r ? "object" : l ? "script" : "img", v = l ? "script" : u, w = Array.isArray
- || function (a) {
- return"[object Array]" == o.call(a)
- }, x = [], y = {}, z = {timeout: function (a, b) {
- return b.length && (a.timeout = b[0]), a
- }}, A, B;
- B = function (a) {
- function b(a) {
- var a = a.split("!"), b = x.length, c = a.pop(), d = a.length, c = {url: c, origUrl: c, prefixes: a}, e, f, g;
- for (f = 0; f < d; f++) {
- g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g));
- }
- for (f = 0; f < b; f++) {
- c = x[f](c);
- }
- return c
- }
- function g(a, e, f, g, h) {
- var i = b(a), j = i.autoCallback;
- i.url.split(".").pop().split("?").shift(), i.bypass || (e && (e =
- d(e) ? e : e[a] || e[g] || e[a.split("/").pop().split("?")[0]]), i.instead ? i.instead(a, e, f, g, h) :
- (y[i.url] ? i.noexec = !0 : y[i.url] = 1, f.load(i.url,
- i.forceCSS || !i.forceJS && "css" == i.url.split(".").pop().split("?").shift() ? "c" : c,
- i.noexec,
- i.attrs,
- i.timeout), (d(e) || d(j)) && f.load(function () {
- k(), e && e(i.origUrl, h, g), j && j(i.origUrl, h, g), y[i.url] = 2
- })))
- }
- function h(a, b) {
- function c(a, c) {
- if (a) {
- if (e(a)) {
- c || (j = function () {
- var a = [].slice.call(arguments);
- k.apply(this, a), l()
- }), g(a, j, b, 0, h);
- }
- else if (Object(a) === a) {
- for (n in m = function () {
- var b = 0, c;
- for (c in a) {
- a.hasOwnProperty(c) && b++;
- }
- return b
- }(), a) {
- a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function () {
- var a = [].slice.call(arguments);
- k.apply(this, a), l()
- } : j[n] = function (a) {
- return function () {
- var b = [].slice.call(arguments);
- a && a.apply(this, b), l()
- }
- }(k[n])), g(a[n], j, b, n, h))
- }
- }
- }
- else {
- !c && l()
- }
- }
- var h = !!a.test, i = a.load || a.both, j = a.callback || f, k = j, l = a.complete || f, m, n;
- c(h ? a.yep : a.nope, !!i), i && c(i)
- }
- var i, j, l = this.yepnope.loader;
- if (e(a)) {
- g(a, 0, l, 0);
- }
- else if (w(a)) {
- for (i = 0; i < a.length; i++) {
- j = a[i], e(j) ? g(j, 0, l, 0) : w(j) ? B(j) : Object(j) === j && h(j, l);
- }
- }
- else {
- Object(a) === a && h(a, l)
- }
- }, B.addPrefix = function (a, b) {
- z[a] = b
- }, B.addFilter = function (a) {
- x.push(a)
- }, B.errorTimeout = 1e4, null == b.readyState && b.addEventListener && (b.readyState = "loading", b.addEventListener("DOMContentLoaded",
- A = function () {
- b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete"
- },
- 0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function (a, c, d, e, i, j) {
- var k = b.createElement("script"), l, o, e = e || B.errorTimeout;
- k.src = a;
- for (o in d) {
- k.setAttribute(o, d[o]);
- }
- c = j ? h : c || f, k.onreadystatechange = k.onload = function () {
- !l && g(k.readyState) && (l = 1, c(), k.onload = k.onreadystatechange = null)
- }, m(function () {
- l || (l = 1, c(1))
- }, e), i ? k.onload() : n.parentNode.insertBefore(k, n)
- }, a.yepnope.injectCss = function (a, c, d, e, g, i) {
- var e = b.createElement("link"), j, c = i ? h : c || f;
- e.href = a, e.rel = "stylesheet", e.type = "text/css";
- for (j in d) {
- e.setAttribute(j, d[j]);
- }
- g || (n.parentNode.insertBefore(e, n), m(c, 0))
- }
- }(this, document), Modernizr.load = function () {
- yepnope.apply(window, [].slice.call(arguments, 0))
- };
- (function (a) {
- (jQuery.browser = jQuery.browser || {}).mobile =
- /(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)
- || /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,
- 4))
- })(navigator.userAgent || navigator.vendor || window.opera);
- ;
- (function ($) {
- var rotateLeft = function (lValue, iShiftBits) {
- return(lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
- }
- var addUnsigned = function (lX, lY) {
- var lX4, lY4, lX8, lY8, lResult;
- lX8 = (lX & 0x80000000);
- lY8 = (lY & 0x80000000);
- lX4 = (lX & 0x40000000);
- lY4 = (lY & 0x40000000);
- lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
- if (lX4 & lY4) {
- return(lResult ^ 0x80000000 ^ lX8 ^ lY8);
- }
- if (lX4 | lY4) {
- if (lResult & 0x40000000) {
- return(lResult ^ 0xC0000000 ^ lX8 ^ lY8);
- }
- else {
- return(lResult ^ 0x40000000 ^ lX8 ^ lY8);
- }
- }
- else {
- return(lResult ^ lX8 ^ lY8);
- }
- }
- var F = function (x, y, z) {
- return(x & y) | ((~x) & z);
- }
- var G = function (x, y, z) {
- return(x & z) | (y & (~z));
- }
- var H = function (x, y, z) {
- return(x ^ y ^ z);
- }
- var I = function (x, y, z) {
- return(y ^ (x | (~z)));
- }
- var FF = function (a, b, c, d, x, s, ac) {
- a = addUnsigned(a, addUnsigned(addUnsigned(F(b, c, d), x), ac));
- return addUnsigned(rotateLeft(a, s), b);
- };
- var GG = function (a, b, c, d, x, s, ac) {
- a = addUnsigned(a, addUnsigned(addUnsigned(G(b, c, d), x), ac));
- return addUnsigned(rotateLeft(a, s), b);
- };
- var HH = function (a, b, c, d, x, s, ac) {
- a = addUnsigned(a, addUnsigned(addUnsigned(H(b, c, d), x), ac));
- return addUnsigned(rotateLeft(a, s), b);
- };
- var II = function (a, b, c, d, x, s, ac) {
- a = addUnsigned(a, addUnsigned(addUnsigned(I(b, c, d), x), ac));
- return addUnsigned(rotateLeft(a, s), b);
- };
- var convertToWordArray = function (string) {
- var lWordCount;
- var lMessageLength = string.length;
- var lNumberOfWordsTempOne = lMessageLength + 8;
- var lNumberOfWordsTempTwo = (lNumberOfWordsTempOne - (lNumberOfWordsTempOne % 64)) / 64;
- var lNumberOfWords = (lNumberOfWordsTempTwo + 1) * 16;
- var lWordArray = Array(lNumberOfWords - 1);
- var lBytePosition = 0;
- var lByteCount = 0;
- while (lByteCount < lMessageLength) {
- lWordCount = (lByteCount - (lByteCount % 4)) / 4;
- lBytePosition = (lByteCount % 4) * 8;
- lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
- lByteCount++;
- }
- lWordCount = (lByteCount - (lByteCount % 4)) / 4;
- lBytePosition = (lByteCount % 4) * 8;
- lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
- lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
- lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
- return lWordArray;
- };
- var wordToHex = function (lValue) {
- var WordToHexValue = "", WordToHexValueTemp = "", lByte, lCount;
- for (lCount = 0; lCount <= 3; lCount++) {
- lByte = (lValue >>> (lCount * 8)) & 255;
- WordToHexValueTemp = "0" + lByte.toString(16);
- WordToHexValue = WordToHexValue + WordToHexValueTemp.substr(WordToHexValueTemp.length - 2, 2);
- }
- return WordToHexValue;
- };
- var uTF8Encode = function (string) {
- string = string.replace(/\x0d\x0a/g, "\x0a");
- var output = "";
- for (var n = 0; n < string.length; n++) {
- var c = string.charCodeAt(n);
- if (c < 128) {
- output += String.fromCharCode(c);
- }
- else if ((c > 127) && (c < 2048)) {
- output += String.fromCharCode((c >> 6) | 192);
- output += String.fromCharCode((c & 63) | 128);
- }
- else {
- output += String.fromCharCode((c >> 12) | 224);
- output += String.fromCharCode(((c >> 6) & 63) | 128);
- output += String.fromCharCode((c & 63) | 128);
- }
- }
- return output;
- };
- $.extend({md5: function (string) {
- var x = Array();
- var k, AA, BB, CC, DD, a, b, c, d;
- var S11 = 7, S12 = 12, S13 = 17, S14 = 22;
- var S21 = 5, S22 = 9, S23 = 14, S24 = 20;
- var S31 = 4, S32 = 11, S33 = 16, S34 = 23;
- var S41 = 6, S42 = 10, S43 = 15, S44 = 21;
- string = uTF8Encode(string);
- x = convertToWordArray(string);
- a = 0x67452301;
- b = 0xEFCDAB89;
- c = 0x98BADCFE;
- d = 0x10325476;
- for (k = 0; k < x.length; k += 16) {
- AA = a;
- BB = b;
- CC = c;
- DD = d;
- a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
- d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
- c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
- b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
- a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
- d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
- c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
- b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
- a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
- d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
- c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
- b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
- a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
- d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
- c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
- b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
- a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
- d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
- c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
- b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
- a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
- d = GG(d, a, b, c, x[k + 10], S22, 0x2441453);
- c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
- b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
- a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
- d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
- c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
- b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
- a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
- d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
- c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
- b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
- a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
- d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
- c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
- b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
- a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
- d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
- c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
- b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
- a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
- d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
- c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
- b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
- a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
- d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
- c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
- b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
- a = II(a, b, c, d, x[k + 0], S41, 0xF4292244);
- d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
- c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
- b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
- a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
- d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
- c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
- b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
- a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
- d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
- c = II(c, d, a, b, x[k + 6], S43, 0xA3014314);
- b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
- a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
- d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
- c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
- b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
- a = addUnsigned(a, AA);
- b = addUnsigned(b, BB);
- c = addUnsigned(c, CC);
- d = addUnsigned(d, DD);
- }
- var tempValue = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
- return tempValue.toLowerCase();
- }});
- })(jQuery);
- ;
- var JSON;
- if (!JSON) {
- JSON = {};
- }
- (function () {
- 'use strict';
- function f(n) {
- return n < 10 ? '0' + n : n;
- }
- if (typeof Date.prototype.toJSON !== 'function') {
- Date.prototype.toJSON = function (key) {
- return isFinite(this.valueOf()) ?
- this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':'
- + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z' : null;
- };
- String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (key) {
- return this.valueOf();
- };
- }
- 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;
- function quote(string) {
- escapable.lastIndex = 0;
- return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
- var c = meta[a];
- return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- }) + '"' : '"' + string + '"';
- }
- function str(key, holder) {
- var i, k, v, length, mind = gap, partial, value = holder[key];
- if (value && typeof value === 'object' && typeof value.toJSON === 'function') {
- value = value.toJSON(key);
- }
- if (typeof rep === 'function') {
- value = rep.call(holder, key, value);
- }
- switch (typeof value) {
- case'string':
- return quote(value);
- case'number':
- return isFinite(value) ? String(value) : 'null';
- case'boolean':
- case'null':
- return String(value);
- case'object':
- if (!value) {
- return'null';
- }
- gap += indent;
- partial = [];
- if (Object.prototype.toString.apply(value) === '[object Array]') {
- length = value.length;
- for (i = 0; i < length; i += 1) {
- partial[i] = str(i, value) || 'null';
- }
- v =
- partial.length === 0 ? '[]' :
- gap ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : '[' + partial.join(',') + ']';
- gap = mind;
- return v;
- }
- if (rep && typeof rep === 'object') {
- length = rep.length;
- for (i = 0; i < length; i += 1) {
- if (typeof rep[i] === 'string') {
- k = rep[i];
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- }
- else {
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- }
- v = partial.length === 0 ? '{}' : gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : '{' + partial.join(',') + '}';
- gap = mind;
- return v;
- }
- }
- if (typeof JSON.stringify !== 'function') {
- JSON.stringify = function (value, replacer, space) {
- var i;
- gap = '';
- indent = '';
- if (typeof space === 'number') {
- for (i = 0; i < space; i += 1) {
- indent += ' ';
- }
- }
- else if (typeof space === 'string') {
- indent = space;
- }
- rep = replacer;
- if (replacer && typeof replacer !== 'function' && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) {
- throw new Error('JSON.stringify');
- }
- return str('', {'': value});
- };
- }
- if (typeof JSON.parse !== 'function') {
- JSON.parse = function (text, reviver) {
- var j;
- function walk(holder, key) {
- var k, v, value = holder[key];
- if (value && typeof value === 'object') {
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = walk(value, k);
- if (v !== undefined) {
- value[k] = v;
- }
- else {
- delete value[k];
- }
- }
- }
- }
- return reviver.call(holder, key, value);
- }
- text = String(text);
- cx.lastIndex = 0;
- if (cx.test(text)) {
- text = text.replace(cx, function (a) {
- return'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- });
- }
- if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
- '@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
- j = eval('(' + text + ')');
- return typeof reviver === 'function' ? walk({'': j}, '') : j;
- }
- throw new SyntaxError('JSON.parse');
- };
- }
- }());
- ;
- (function () {
- var JSTORAGE_VERSION = "0.3.0", $ = window.jQuery || window.$ || (window.$ = {}), JSON = {parse: window.JSON && (window.JSON.parse
- || window.JSON.decode) || String.prototype.evalJSON && function (str) {
- return String(str).evalJSON();
- } || $.parseJSON || $.evalJSON, stringify: Object.toJSON || window.JSON && (window.JSON.stringify || window.JSON.encode) || $.toJSON};
- if (!JSON.parse || !JSON.stringify) {
- throw new Error("No JSON support found, include //cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js to page");
- }
- 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 "
- + "0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 "
- + "6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 "
- + "FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 "
- + "A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 "
- + "32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 "
- + "56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 "
- + "C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 "
- + "E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 "
- + "6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 "
- + "12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE "
- + "A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 "
- + "DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 "
- + "5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 "
- + "2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF "
- + "04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 "
- + "7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 "
- + "FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 "
- + "A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C "
- + "36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 "
- + "5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 "
- + "C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 "
- + "EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D "
- + "7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 "
- + "18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 "
- + "A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A "
- + "D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A "
- + "53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 "
- + "2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D", _XMLService = {isXML: function (elm) {
- var documentElement = (elm ? elm.ownerDocument || elm : 0).documentElement;
- return documentElement ? documentElement.nodeName !== "HTML" : false;
- }, encode: function (xmlNode) {
- if (!this.isXML(xmlNode)) {
- return false;
- }
- try {
- return new XMLSerializer().serializeToString(xmlNode);
- }
- catch (E1) {
- try {
- return xmlNode.xml;
- }
- catch (E2) {
- }
- }
- return false;
- }, decode: function (xmlString) {
- var dom_parser = ("DOMParser"in window && (new DOMParser()).parseFromString) || (window.ActiveXObject && function (_xmlString) {
- var xml_doc = new ActiveXObject('Microsoft.XMLDOM');
- xml_doc.async = 'false';
- xml_doc.loadXML(_xmlString);
- return xml_doc;
- }), resultXML;
- if (!dom_parser) {
- return false;
- }
- resultXML = dom_parser.call("DOMParser"in window && (new DOMParser()) || window, xmlString, 'text/xml');
- return this.isXML(resultXML) ? resultXML : false;
- }}, _localStoragePolyfillSetKey = function () {
- };
- function _init() {
- var localStorageReallyWorks = false;
- if ("localStorage"in window) {
- try {
- window.localStorage.setItem('_tmptest', 'tmpval');
- localStorageReallyWorks = true;
- window.localStorage.removeItem('_tmptest');
- }
- catch (BogusQuotaExceededErrorOnIos5) {
- }
- }
- if (localStorageReallyWorks) {
- try {
- if (window.localStorage) {
- _storage_service = window.localStorage;
- _backend = "localStorage";
- _observer_update = _storage_service.jStorage_update;
- }
- }
- catch (E3) {
- }
- }
- else if ("globalStorage"in window) {
- try {
- if (window.globalStorage) {
- _storage_service = window.globalStorage[window.location.hostname];
- _backend = "globalStorage";
- _observer_update = _storage_service.jStorage_update;
- }
- }
- catch (E4) {
- }
- }
- else {
- _storage_elm = document.createElement('link');
- if (_storage_elm.addBehavior) {
- _storage_elm.style.behavior = 'url(#default#userData)';
- document.getElementsByTagName('head')[0].appendChild(_storage_elm);
- try {
- _storage_elm.load("jStorage");
- }
- catch (E) {
- _storage_elm.setAttribute("jStorage", "{}");
- _storage_elm.save("jStorage");
- _storage_elm.load("jStorage");
- }
- var data = "{}";
- try {
- data = _storage_elm.getAttribute("jStorage");
- }
- catch (E5) {
- }
- try {
- _observer_update = _storage_elm.getAttribute("jStorage_update");
- }
- catch (E6) {
- }
- _storage_service.jStorage = data;
- _backend = "userDataBehavior";
- }
- else {
- _storage_elm = null;
- return;
- }
- }
- _load_storage();
- _handleTTL();
- _createPolyfillStorage("local");
- _createPolyfillStorage("session");
- _setupObserver();
- _handlePubSub();
- if ("addEventListener"in window) {
- window.addEventListener("pageshow", function (event) {
- if (event.persisted) {
- _storageObserver();
- }
- }, false);
- }
- }
- function _createPolyfillStorage(type, forceCreate) {
- var _skipSave = false, _length = 0, i, storage, storage_source = {};
- var rand = Math.random();
- if (!forceCreate && typeof window[type + "Storage"] != "undefined") {
- return;
- }
- if (type == "local" && window.globalStorage) {
- localStorage = window.globalStorage[window.location.hostname];
- return;
- }
- if (_backend != "userDataBehavior") {
- return;
- }
- if (forceCreate && window[type + "Storage"] && window[type + "Storage"].parentNode) {
- window[type + "Storage"].parentNode.removeChild(window[type + "Storage"]);
- }
- storage = document.createElement("button");
- document.getElementsByTagName('head')[0].appendChild(storage);
- if (type == "local") {
- storage_source = _storage;
- }
- else if (type == "session") {
- _sessionStoragePolyfillUpdate();
- }
- for (i in storage_source) {
- if (storage_source.hasOwnProperty(i) && i != "__jstorage_meta" && i != "length" && typeof storage_source[i] != "undefined") {
- if (!(i in storage)) {
- _length++;
- }
- storage[i] = storage_source[i];
- }
- }
- storage.length = _length;
- storage.key = function (n) {
- var count = 0, i;
- _sessionStoragePolyfillUpdate();
- for (i in storage_source) {
- if (storage_source.hasOwnProperty(i) && i != "__jstorage_meta" && i != "length" && typeof storage_source[i] != "undefined") {
- if (count == n) {
- return i;
- }
- count++;
- }
- }
- }
- storage.getItem = function (key) {
- _sessionStoragePolyfillUpdate();
- if (type == "session") {
- return storage_source[key];
- }
- return $.jStorage.get(key);
- }
- storage.setItem = function (key, value) {
- if (typeof value == "undefined") {
- return;
- }
- storage[key] = (value || "").toString();
- }
- storage.removeItem = function (key) {
- if (type == "local") {
- return $.jStorage.deleteKey(key);
- }
- storage[key] = undefined;
- _skipSave = true;
- if (key in storage) {
- storage.removeAttribute(key);
- }
- _skipSave = false;
- }
- storage.clear = function () {
- if (type == "session") {
- window.name = "";
- _createPolyfillStorage("session", true);
- return;
- }
- $.jStorage.flush();
- }
- if (type == "local") {
- _localStoragePolyfillSetKey = function (key, value) {
- if (key == "length") {
- return;
- }
- _skipSave = true;
- if (typeof value == "undefined") {
- if (key in storage) {
- _length--;
- storage.removeAttribute(key);
- }
- }
- else {
- if (!(key in storage)) {
- _length++;
- }
- storage[key] = (value || "").toString();
- }
- storage.length = _length;
- _skipSave = false;
- }
- }
- function _sessionStoragePolyfillUpdate() {
- if (type != "session") {
- return;
- }
- try {
- storage_source = JSON.parse(window.name || "{}");
- }
- catch (E) {
- storage_source = {};
- }
- }
- function _sessionStoragePolyfillSave() {
- if (type != "session") {
- return;
- }
- window.name = JSON.stringify(storage_source);
- };
- storage.attachEvent("onpropertychange", function (e) {
- if (e.propertyName == "length") {
- return;
- }
- if (_skipSave || e.propertyName == "length") {
- return;
- }
- if (type == "local") {
- if (!(e.propertyName in storage_source) && typeof storage[e.propertyName] != "undefined") {
- _length++;
- }
- }
- else if (type == "session") {
- _sessionStoragePolyfillUpdate();
- if (typeof storage[e.propertyName] != "undefined" && !(e.propertyName in storage_source)) {
- storage_source[e.propertyName] = storage[e.propertyName];
- _length++;
- }
- else if (typeof storage[e.propertyName] == "undefined" && e.propertyName in storage_source) {
- delete storage_source[e.propertyName];
- _length--;
- }
- else {
- storage_source[e.propertyName] = storage[e.propertyName];
- }
- _sessionStoragePolyfillSave();
- storage.length = _length;
- return;
- }
- $.jStorage.set(e.propertyName, storage[e.propertyName]);
- storage.length = _length;
- });
- window[type + "Storage"] = storage;
- }
- function _reloadData() {
- var data = "{}";
- if (_backend == "userDataBehavior") {
- _storage_elm.load("jStorage");
- try {
- data = _storage_elm.getAttribute("jStorage");
- }
- catch (E5) {
- }
- try {
- _observer_update = _storage_elm.getAttribute("jStorage_update");
- }
- catch (E6) {
- }
- _storage_service.jStorage = data;
- }
- _load_storage();
- _handleTTL();
- _handlePubSub();
- }
- function _setupObserver() {
- if (_backend == "localStorage" || _backend == "globalStorage") {
- if ("addEventListener"in window) {
- window.addEventListener("storage", _storageObserver, false);
- }
- else {
- document.attachEvent("onstorage", _storageObserver);
- }
- }
- else if (_backend == "userDataBehavior") {
- setInterval(_storageObserver, 1000);
- }
- }
- function _storageObserver() {
- var updateTime;
- clearTimeout(_observer_timeout);
- _observer_timeout = setTimeout(function () {
- if (_backend == "localStorage" || _backend == "globalStorage") {
- updateTime = _storage_service.jStorage_update;
- }
- else if (_backend == "userDataBehavior") {
- _storage_elm.load("jStorage");
- try {
- updateTime = _storage_elm.getAttribute("jStorage_update");
- }
- catch (E5) {
- }
- }
- if (updateTime && updateTime != _observer_update) {
- _observer_update = updateTime;
- _checkUpdatedKeys();
- }
- }, 25);
- }
- function _checkUpdatedKeys() {
- var oldCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32)), newCrc32List;
- _reloadData();
- newCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32));
- var key, updated = [], removed = [];
- for (key in oldCrc32List) {
- if (oldCrc32List.hasOwnProperty(key)) {
- if (!newCrc32List[key]) {
- removed.push(key);
- continue;
- }
- if (oldCrc32List[key] != newCrc32List[key]) {
- updated.push(key);
- }
- }
- }
- for (key in newCrc32List) {
- if (newCrc32List.hasOwnProperty(key)) {
- if (!oldCrc32List[key]) {
- updated.push(key);
- }
- }
- }
- _fireObservers(updated, "updated");
- _fireObservers(removed, "deleted");
- }
- function _fireObservers(keys, action) {
- keys = [].concat(keys || []);
- if (action == "flushed") {
- keys = [];
- for (var key in _observers) {
- if (_observers.hasOwnProperty(key)) {
- keys.push(key);
- }
- }
- action = "deleted";
- }
- for (var i = 0, len = keys.length; i < len; i++) {
- if (_observers[keys[i]]) {
- for (var j = 0, jlen = _observers[keys[i]].length; j < jlen; j++) {
- _observers[keys[i]][j](keys[i], action);
- }
- }
- }
- }
- function _publishChange() {
- var updateTime = (+new Date()).toString();
- if (_backend == "localStorage" || _backend == "globalStorage") {
- _storage_service.jStorage_update = updateTime;
- }
- else if (_backend == "userDataBehavior") {
- _storage_elm.setAttribute("jStorage_update", updateTime);
- _storage_elm.save("jStorage");
- }
- _storageObserver();
- }
- function _load_storage() {
- if (_storage_service.jStorage) {
- try {
- _storage = JSON.parse(String(_storage_service.jStorage));
- }
- catch (E6) {
- _storage_service.jStorage = "{}";
- }
- }
- else {
- _storage_service.jStorage = "{}";
- }
- _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
- if (!_storage.__jstorage_meta) {
- _storage.__jstorage_meta = {};
- }
- if (!_storage.__jstorage_meta.CRC32) {
- _storage.__jstorage_meta.CRC32 = {};
- }
- }
- function _save() {
- _dropOldEvents();
- try {
- _storage_service.jStorage = JSON.stringify(_storage);
- if (_storage_elm) {
- _storage_elm.setAttribute("jStorage", _storage_service.jStorage);
- _storage_elm.save("jStorage");
- }
- _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
- }
- catch (E7) {
- }
- }
- function _checkKey(key) {
- if (!key || (typeof key != "string" && typeof key != "number")) {
- throw new TypeError('Key name must be string or numeric');
- }
- if (key == "__jstorage_meta") {
- throw new TypeError('Reserved key name');
- }
- return true;
- }
- function _handleTTL() {
- var curtime, i, TTL, CRC32, nextExpire = Infinity, changed = false, deleted = [];
- clearTimeout(_ttl_timeout);
- if (!_storage.__jstorage_meta || typeof _storage.__jstorage_meta.TTL != "object") {
- return;
- }
- curtime = +new Date();
- TTL = _storage.__jstorage_meta.TTL;
- CRC32 = _storage.__jstorage_meta.CRC32;
- for (i in TTL) {
- if (TTL.hasOwnProperty(i)) {
- if (TTL[i] <= curtime) {
- delete TTL[i];
- delete CRC32[i];
- delete _storage[i];
- changed = true;
- deleted.push(i);
- }
- else if (TTL[i] < nextExpire) {
- nextExpire = TTL[i];
- }
- }
- }
- if (nextExpire != Infinity) {
- _ttl_timeout = setTimeout(_handleTTL, nextExpire - curtime);
- }
- if (changed) {
- _save();
- _publishChange();
- _fireObservers(deleted, "deleted");
- }
- }
- function _handlePubSub() {
- if (!_storage.__jstorage_meta.PubSub) {
- return;
- }
- var pubelm, _pubsubCurrent = _pubsub_last;
- for (var i = len = _storage.__jstorage_meta.PubSub.length - 1; i >= 0; i--) {
- pubelm = _storage.__jstorage_meta.PubSub[i];
- if (pubelm[0] > _pubsub_last) {
- _pubsubCurrent = pubelm[0];
- _fireSubscribers(pubelm[1], pubelm[2]);
- }
- }
- _pubsub_last = _pubsubCurrent;
- }
- function _fireSubscribers(channel, payload) {
- if (_pubsub_observers[channel]) {
- for (var i = 0, len = _pubsub_observers[channel].length; i < len; i++) {
- _pubsub_observers[channel][i](channel, JSON.parse(JSON.stringify(payload)));
- }
- }
- }
- function _dropOldEvents() {
- if (!_storage.__jstorage_meta.PubSub) {
- return;
- }
- var retire = +new Date() - 2000;
- for (var i = 0, len = _storage.__jstorage_meta.PubSub.length; i < len; i++) {
- if (_storage.__jstorage_meta.PubSub[i][0] <= retire) {
- _storage.__jstorage_meta.PubSub.splice(i, _storage.__jstorage_meta.PubSub.length - i);
- break;
- }
- }
- if (!_storage.__jstorage_meta.PubSub.length) {
- delete _storage.__jstorage_meta.PubSub;
- }
- }
- function _publish(channel, payload) {
- if (!_storage.__jstorage_meta) {
- _storage.__jstorage_meta = {};
- }
- if (!_storage.__jstorage_meta.PubSub) {
- _storage.__jstorage_meta.PubSub = [];
- }
- _storage.__jstorage_meta.PubSub.unshift([+new Date, channel, payload]);
- _save();
- _publishChange();
- }
- function _crc32(str, crc) {
- crc = crc || 0;
- var n = 0, x = 0;
- crc = crc ^ (-1);
- for (var i = 0, len = str.length; i < len; i++) {
- n = (crc ^ str.charCodeAt(i)) & 0xFF;
- x = "0x" + _crc32Table.substr(n * 9, 8);
- crc = (crc >>> 8) ^ x;
- }
- return crc ^ (-1);
- }
- $.jStorage = {version: JSTORAGE_VERSION, set: function (key, value, options) {
- _checkKey(key);
- options = options || {};
- if (typeof value == "undefined") {
- this.deleteKey(key);
- return value;
- }
- if (_XMLService.isXML(value)) {
- value = {_is_xml: true, xml: _XMLService.encode(value)};
- }
- else if (typeof value == "function") {
- return undefined;
- }
- else if (value && typeof value == "object") {
- value = JSON.parse(JSON.stringify(value));
- }
- _storage[key] = value;
- _storage.__jstorage_meta.CRC32[key] = _crc32(JSON.stringify(value));
- this.setTTL(key, options.TTL || 0);
- _localStoragePolyfillSetKey(key, value);
- _fireObservers(key, "updated");
- return value;
- }, get: function (key, def) {
- _checkKey(key);
- if (key in _storage) {
- if (_storage[key] && typeof _storage[key] == "object" && _storage[key]._is_xml && _storage[key]._is_xml) {
- return _XMLService.decode(_storage[key].xml);
- }
- else {
- return _storage[key];
- }
- }
- return typeof(def) == 'undefined' ? null : def;
- }, deleteKey: function (key) {
- _checkKey(key);
- if (key in _storage) {
- delete _storage[key];
- if (typeof _storage.__jstorage_meta.TTL == "object" && key in _storage.__jstorage_meta.TTL) {
- delete _storage.__jstorage_meta.TTL[key];
- }
- delete _storage.__jstorage_meta.CRC32[key];
- _localStoragePolyfillSetKey(key, undefined);
- _save();
- _publishChange();
- _fireObservers(key, "deleted");
- return true;
- }
- return false;
- }, setTTL: function (key, ttl) {
- var curtime = +new Date();
- _checkKey(key);
- ttl = Number(ttl) || 0;
- if (key in _storage) {
- if (!_storage.__jstorage_meta.TTL) {
- _storage.__jstorage_meta.TTL = {};
- }
- if (ttl > 0) {
- _storage.__jstorage_meta.TTL[key] = curtime + ttl;
- }
- else {
- delete _storage.__jstorage_meta.TTL[key];
- }
- _save();
- _handleTTL();
- _publishChange();
- return true;
- }
- return false;
- }, getTTL: function (key) {
- var curtime = +new Date(), ttl;
- _checkKey(key);
- if (key in _storage && _storage.__jstorage_meta.TTL && _storage.__jstorage_meta.TTL[key]) {
- ttl = _storage.__jstorage_meta.TTL[key] - curtime;
- return ttl || 0;
- }
- return 0;
- }, flush: function () {
- _storage = {__jstorage_meta: {CRC32: {}}};
- _createPolyfillStorage("local", true);
- _save();
- _publishChange();
- _fireObservers(null, "flushed");
- return true;
- }, storageObj: function () {
- function F() {
- }
- F.prototype = _storage;
- return new F();
- }, index: function () {
- var index = [], i;
- for (i in _storage) {
- if (_storage.hasOwnProperty(i) && i != "__jstorage_meta") {
- index.push(i);
- }
- }
- return index;
- }, storageSize: function () {
- return _storage_size;
- }, currentBackend: function () {
- return _backend;
- }, storageAvailable: function () {
- return!!_backend;
- }, listenKeyChange: function (key, callback) {
- _checkKey(key);
- if (!_observers[key]) {
- _observers[key] = [];
- }
- _observers[key].push(callback);
- }, stopListening: function (key, callback) {
- _checkKey(key);
- if (!_observers[key]) {
- return;
- }
- if (!callback) {
- delete _observers[key];
- return;
- }
- for (var i = _observers[key].length - 1; i >= 0; i--) {
- if (_observers[key][i] == callback) {
- _observers[key].splice(i, 1);
- }
- }
- }, subscribe: function (channel, callback) {
- channel = (channel || "").toString();
- if (!channel) {
- throw new TypeError('Channel not defined');
- }
- if (!_pubsub_observers[channel]) {
- _pubsub_observers[channel] = [];
- }
- _pubsub_observers[channel].push(callback);
- }, publish: function (channel, payload) {
- channel = (channel || "").toString();
- if (!channel) {
- throw new TypeError('Channel not defined');
- }
- _publish(channel, payload);
- }, reInit: function () {
- _reloadData();
- }};
- _init();
- })();
- ;
- ;
- window.___ = function () {
- ___.history = ___.history || [];
- ___.history.push(arguments);
- if (this.console) {
- console.log(Array.prototype.slice.call(arguments));
- }
- };
- window.___l = function (str, str2) {
- if (this.console) {
- if (!B24_debug_status || !B24_debug_status.getMode('ga')) {
- return false;
- }
- var output = '';
- if (typeof(str2) == 'string') {
- output += '####### ' + str2 + ' #######';
- }
- if (typeof(str) == 'object') {
- output += ' :::::OBJECT at lifetime: ' + JSON.stringify(str);
- }
- if (typeof(str) == 'string') {
- output += ' ::::: ' + str;
- }
- console.log(output);
- if (typeof(str) == 'object') {
- console.log(str);
- }
- return true;
- }
- return false;
- };
- jQuery.debug = function (bool) {
- return bool
- };
- jQuery.log = window.___;
- ;
- (function ($) {
- $.getlocations = function (href_to_go, target, params) {
- if (typeof window.Get_Locations == 'undefined') {
- var loc_obj = window.location;
- var get_locations = new Object();
- get_locations['location'] = loc_obj;
- var base = $('base') ? $('base').attr('href') : '';
- if (typeof(base) == 'undefined' || base == null) {
- base = "";
- }
- get_locations['baseref'] = base;
- get_locations['baseref_ie'] = get_locations['baseref'].replace(/([^\/])$|\/?[^\/]+\.(php|html|htm)$/i, '$1/');
- get_locations['hash'] = loc_obj.hash;
- get_locations['host'] = loc_obj.host;
- get_locations['hostname'] = loc_obj.hostname;
- get_locations['href'] = loc_obj.href;
- get_locations['pathname'] = loc_obj.pathname;
- get_locations['port'] = loc_obj.port;
- get_locations['protocol'] = loc_obj.protocol;
- get_locations['search'] = loc_obj.search;
- get_locations['ssl'] = loc_obj.protocol.match(/https/) == "https" ? true : false;
- get_locations['pathes'] = new Array();
- get_locations['pathes'] = loc_obj.pathname.split("/");
- get_locations['filename'] = get_locations['pathes'][get_locations['pathes'].length - 1];
- get_locations['topleveldomain'] = loc_obj.hostname.match(/[a-z]+$/i);
- get_locations['domain'] = loc_obj.hostname.match(/[^\.]+\.[a-z]+$/i);
- var params = loc_obj.search.substr(1, loc_obj.search.length).split("&");
- var key_value = new Object();
- for (var i = 0; i < params.length; i++) {
- var param_split = params[i].split("=");
- key_value[param_split[0]] = param_split[1];
- }
- get_locations['params'] = key_value;
- window.Get_Locations = get_locations;
- }
- if (typeof href_to_go == 'string' && href_to_go != '') {
- href_to_go = (href_to_go.match(/^\/|^http/i)) ? href_to_go : Get_Locations['baseref_ie'] + href_to_go;
- if (typeof params == 'string' && params != '') {
- window.open(href_to_go, target, params);
- }
- else if (typeof target == 'string' && target != '') {
- window.open(href_to_go, target);
- }
- else {
- window.location.href = href_to_go;
- }
- }
- return window.Get_Locations;
- }
- })(jQuery);
- ;
- (function ($) {
- $.uniqid = function () {
- return $.sha256(String(Math.random()));
- }
- }(jQuery));
- (function ($) {
- var chrsz = 8;
- var safe_add = function (x, y) {
- var lsw = (x & 0xFFFF) + (y & 0xFFFF);
- var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
- return(msw << 16) | (lsw & 0xFFFF);
- }
- var S = function (X, n) {
- return(X >>> n) | (X << (32 - n));
- }
- var R = function (X, n) {
- return(X >>> n);
- }
- var Ch = function (x, y, z) {
- return((x & y) ^ ((~x) & z));
- }
- var Maj = function (x, y, z) {
- return((x & y) ^ (x & z) ^ (y & z));
- }
- var Sigma0256 = function (x) {
- return(S(x, 2) ^ S(x, 13) ^ S(x, 22));
- }
- var Sigma1256 = function (x) {
- return(S(x, 6) ^ S(x, 11) ^ S(x, 25));
- }
- var Gamma0256 = function (x) {
- return(S(x, 7) ^ S(x, 18) ^ R(x, 3));
- }
- var Gamma1256 = function (x) {
- return(S(x, 17) ^ S(x, 19) ^ R(x, 10));
- }
- var core_sha256 = function (m, l) {
- var K = new Array(0x428A2F98,
- 0x71374491,
- 0xB5C0FBCF,
- 0xE9B5DBA5,
- 0x3956C25B,
- 0x59F111F1,
- 0x923F82A4,
- 0xAB1C5ED5,
- 0xD807AA98,
- 0x12835B01,
- 0x243185BE,
- 0x550C7DC3,
- 0x72BE5D74,
- 0x80DEB1FE,
- 0x9BDC06A7,
- 0xC19BF174,
- 0xE49B69C1,
- 0xEFBE4786,
- 0xFC19DC6,
- 0x240CA1CC,
- 0x2DE92C6F,
- 0x4A7484AA,
- 0x5CB0A9DC,
- 0x76F988DA,
- 0x983E5152,
- 0xA831C66D,
- 0xB00327C8,
- 0xBF597FC7,
- 0xC6E00BF3,
- 0xD5A79147,
- 0x6CA6351,
- 0x14292967,
- 0x27B70A85,
- 0x2E1B2138,
- 0x4D2C6DFC,
- 0x53380D13,
- 0x650A7354,
- 0x766A0ABB,
- 0x81C2C92E,
- 0x92722C85,
- 0xA2BFE8A1,
- 0xA81A664B,
- 0xC24B8B70,
- 0xC76C51A3,
- 0xD192E819,
- 0xD6990624,
- 0xF40E3585,
- 0x106AA070,
- 0x19A4C116,
- 0x1E376C08,
- 0x2748774C,
- 0x34B0BCB5,
- 0x391C0CB3,
- 0x4ED8AA4A,
- 0x5B9CCA4F,
- 0x682E6FF3,
- 0x748F82EE,
- 0x78A5636F,
- 0x84C87814,
- 0x8CC70208,
- 0x90BEFFFA,
- 0xA4506CEB,
- 0xBEF9A3F7,
- 0xC67178F2);
- var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);
- var W = new Array(64);
- var a, b, c, d, e, f, g, h, i, j;
- var T1, T2;
- m[l >> 5] |= 0x80 << (24 - l % 32);
- m[((l + 64 >> 9) << 4) + 15] = l;
- for (var i = 0; i < m.length; i += 16) {
- a = HASH[0];
- b = HASH[1];
- c = HASH[2];
- d = HASH[3];
- e = HASH[4];
- f = HASH[5];
- g = HASH[6];
- h = HASH[7];
- for (var j = 0; j < 64; j++) {
- if (j < 16) {
- W[j] = m[j + i];
- }
- else {
- W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);
- }
- T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);
- T2 = safe_add(Sigma0256(a), Maj(a, b, c));
- h = g;
- g = f;
- f = e;
- e = safe_add(d, T1);
- d = c;
- c = b;
- b = a;
- a = safe_add(T1, T2);
- }
- HASH[0] = safe_add(a, HASH[0]);
- HASH[1] = safe_add(b, HASH[1]);
- HASH[2] = safe_add(c, HASH[2]);
- HASH[3] = safe_add(d, HASH[3]);
- HASH[4] = safe_add(e, HASH[4]);
- HASH[5] = safe_add(f, HASH[5]);
- HASH[6] = safe_add(g, HASH[6]);
- HASH[7] = safe_add(h, HASH[7]);
- }
- return HASH;
- }
- var str2binb = function (str) {
- var bin = Array();
- var mask = (1 << chrsz) - 1;
- for (var i = 0; i < str.length * chrsz; i += chrsz) {
- bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i % 32);
- }
- return bin;
- }
- var binb2hex = function (binarray) {
- var hex_tab = "0123456789abcdef";
- var str = "";
- for (var i = 0; i < binarray.length * 4; i++) {
- str += hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8)) & 0xF);
- }
- return str;
- }
- var core_hmac_sha256 = function (key, data) {
- var bkey = str2binb(key);
- if (bkey.length > 16) {
- bkey = core_sha1(bkey, key.length * chrsz);
- }
- var ipad = Array(16), opad = Array(16);
- for (var i = 0; i < 16; i++) {
- ipad[i] = bkey[i] ^ 0x36363636;
- opad[i] = bkey[i] ^ 0x5C5C5C5C;
- }
- var hash = core_sha256(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
- return core_sha256(opad.concat(hash), 512 + 256);
- }
- var prep = function (string) {
- string = typeof string == 'object' ? $(string).val() : string.toString();
- return string;
- }
- $.extend({sha256: function (string) {
- string = prep(string);
- return binb2hex(core_sha256(str2binb(string), string.length * chrsz));
- }, sha256hmac: function (key, data) {
- key = prep(key);
- data = prep(data);
- return binb2hex(core_hmac_sha256(key, data));
- }, sha256config: function (bits) {
- chrsz = parseInt(bits) || 8;
- }});
- $.fn.sha256 = function (bits) {
- $.sha256config(bits);
- var string = prep($(this).val());
- var val = $.sha256(string);
- $.sha256config(8);
- return val;
- };
- })(jQuery);
- ;
- (function ($, document, undefined) {
- var pluses = /\+/g;
- function raw(s) {
- return s;
- }
- function decoded(s) {
- return decodeURIComponent(s.replace(pluses, ' '));
- }
- var config = $.cookie = function (key, value, options) {
- if (value !== undefined) {
- options = $.extend({}, config.defaults, options);
- if (value === null) {
- options.expires = -1;
- }
- if (typeof options.expires === 'number') {
- var days = options.expires, t = options.expires = new Date();
- t.setDate(t.getDate() + days);
- }
- value = config.json ? JSON.stringify(value) : String(value);
- return(document.cookie =
- [encodeURIComponent(key),
- '=',
- config.raw ? value : encodeURIComponent(value),
- options.expires ? '; expires=' + options.expires.toUTCString() : '',
- options.path ? '; path=' + options.path : '',
- options.domain ? '; domain=' + options.domain : '',
- options.secure ? '; secure' : ''].join(''));
- }
- var decode = config.raw ? raw : decoded;
- var cookies = document.cookie.split('; ');
- for (var i = 0, l = cookies.length; i < l; i++) {
- var parts = cookies[i].split('=');
- if (decode(parts.shift()) === key) {
- var cookie = decode(parts.join('='));
- return config.json ? JSON.parse(cookie) : cookie;
- }
- }
- return null;
- };
- config.defaults = {};
- $.removeCookie = function (key, options) {
- if ($.cookie(key) !== null) {
- $.cookie(key, null, options);
- return true;
- }
- return false;
- };
- })(jQuery, document);
- ;
- (function ($) {
- $.extend({metadata: {defaults: {type: 'class', name: 'metadata', cre: /({.*})/, single: 'metadata'}, setType: function (type, name) {
- this.defaults.type = type;
- this.defaults.name = name;
- }, get: function (elem, opts) {
- var settings = $.extend({}, this.defaults, opts);
- if (!settings.single.length) {
- settings.single = 'metadata';
- }
- var data = $.data(elem, settings.single);
- if (data) {
- return data;
- }
- data = "{}";
- if (settings.type == "class") {
- var m = settings.cre.exec(elem.className);
- if (m) {
- data = m[1];
- }
- }
- else if (settings.type == "elem") {
- if (!elem.getElementsByTagName) {
- return;
- }
- var e = elem.getElementsByTagName(settings.name);
- if (e.length) {
- data = $.trim(e[0].innerHTML);
- }
- }
- else if (elem.getAttribute != undefined) {
- var attr = elem.getAttribute(settings.name);
- if (attr) {
- data = attr;
- }
- }
- if (data.indexOf('{') < 0) {
- data = "{" + data + "}";
- }
- data = eval("(" + data + ")");
- $.data(elem, settings.single, data);
- return data;
- }}});
- $.fn.metadata = function (opts) {
- return $.metadata.get(this[0], opts);
- };
- })(jQuery);
- ;
- /**
- * jQuery Unveil
- * A very lightweight jQuery plugin to lazy load images
- * http://luis-almeida.github.com/unveil
- *
- * Licensed under the MIT license.
- * Copyright 2013 Luís Almeida
- * https://github.com/luis-almeida
- */
- ;
- (function ($) {
- $.fn.unveil = function (threshold, callback) {
- var $w = $(window), th = threshold || 0, retina = window.devicePixelRatio > 1, attrib = retina ? "data-src-retina" :
- "data-src", images = this, loaded;
- this.one("unveil", function () {
- var source = this.getAttribute(attrib);
- source = source || this.getAttribute("data-src");
- if (source) {
- this.setAttribute("src", source);
- if (typeof callback === "function") {
- callback.call(this);
- }
- }
- });
- function unveil() {
- var inview = images.filter(function () {
- var $e = $(this);
- if ($e.is(":hidden")) {
- return;
- }
- var wt = $w.scrollTop(), wb = wt + $w.height(), et = $e.offset().top, eb = et + $e.height();
- return eb >= wt - th && et <= wb + th;
- });
- loaded = inview.trigger("unveil");
- images = images.not(loaded);
- }
- $w.on("scroll.unveil resize.unveil lookup.unveil", unveil);
- unveil();
- return this;
- };
- })(window.jQuery || window.Zepto);
- ;
- var B24_debug_status = (function (window, $) {
- var pub = {};
- 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';
- var init = function () {
- initMode.live = !!location.hostname.match(/(www\.brille24\.)/i);
- initMode.qa = !!location.hostname.match(/(qa\.dev-b24\.)|(www\.brille24\.)/i);
- initMode.tracking = getTrackingMode();
- initMode.divolution = getTrackingMode();
- $.extend(mode, initMode);
- mode = extendWidthStorage(mode);
- mode = extendWidthParams(mode);
- displayMode();
- storageMode(mode);
- };
- var getTrackingMode = function () {
- var ok = true;
- try {
- ok = initMode.live ? true : null;
- var ip = '0.0.0.0';
- if ($.cookie('_b24remip')) {
- ip = $.cookie('_b24remip');
- }
- if (!!ip.match(/(217\.92\.254\.84)|(213\.20\.103\.41)|(192\.168\.100\.)/i)) {
- ok = null;
- }
- }
- catch (e) {
- ok = true;
- }
- return ok;
- };
- var displayMode = function () {
- try {
- $('#b24_debug_display').remove();
- var $diplay = $('<div />').attr('id', 'b24_debug_display');
- var $tempalte = $('<div />').css({'borderBottom': '1px solid white', 'padding': '1px 3px'});
- var someThingDisabled = false;
- if (!mode.tracking) {
- someThingDisabled = true;
- var $tracking = $tempalte.clone();
- $diplay.append($tracking.html('Tracking Disabled: <a href="javascript: B24_debug_status.setMode({tracking:true})">Enable Tracking</a>'));
- }
- if (!mode.divolution) {
- var $abtest = $tempalte.clone();
- someThingDisabled = true;
- $diplay.append($abtest.html('AB-Test Disabled: <a href="javascript: B24_debug_status.setMode({divolution:true})">Enable AB-Test</a>'));
- }
- if (someThingDisabled) {
- $(function () {
- $('body').append($diplay);
- $diplay.css({position: 'fixed', zIndex: '10000', color: 'white !important', backgroundColor: '#CDCDCD', bottom: '0', left: '0', fontSize: '10px', margin: '10px', boxShadow: '6px 6px 5px #888888'});
- });
- }
- }
- catch (err) {
- var message = err;
- }
- return true;
- };
- pub.setMode = function (modeExtented) {
- $.extend(mode, modeExtented);
- displayMode();
- storageMode(mode);
- };
- pub.setFullMode = function () {
- $.each(mode, function (key, value) {
- if (value == null) {
- mode[key] = true;
- }
- });
- displayMode();
- storageMode(mode);
- };
- pub.getMode = function (which) {
- if (!mode[which]) {
- return false;
- }
- return mode[which];
- };
- pub.getFullMode = function () {
- return mode;
- };
- var stopDebug = function () {
- mode = $.extend({}, initMode);
- deletStorage();
- displayMode();
- return mode;
- };
- pub.stopDebug = stopDebug;
- var extendWidthStorage = function (m) {
- var mode = {};
- var content = $.cookie(storageName);
- if (!!content) {
- try {
- mode = JSON.parse(content);
- }
- catch (err) {
- }
- }
- $.extend(m, mode);
- return m;
- };
- var storageMode = function () {
- if (!!mode.success) {
- $.cookie(debugSuccessCookieName, 'true', {path: '/'});
- }
- else {
- $.removeCookie(debugSuccessCookieName, {path: '/'});
- }
- return $.cookie(storageName, JSON.stringify(mode), {path: '/'});
- };
- var extendWidthParams = function (m) {
- var params = $.getlocations().params;
- if (!!params[stopKey]) {
- deletStorage();
- return initMode;
- }
- var pMode = {};
- $.each(params, function (key, value) {
- if (!!key.match(modePattern)) {
- value = (value == 'true' || value == '1') ? true : false;
- pMode[key.replace(modePattern, '')] = value;
- }
- });
- $.extend(m, pMode);
- return m;
- };
- var deletStorage = function () {
- $.removeCookie(debugSuccessCookieName, {path: '/'});
- return $.removeCookie(storageName, {path: '/'});
- };
- init();
- return pub;
- })(window, jQuery, undefined);
- ;
- ;
- var B24_shoplocation = (function ($) {
- var pub = {};
- var loc = null;
- var category = null;
- var categoryID = null;
- var system = null;
- var modus = null;
- var staticModus = null;
- var productType = null;
- var mageParams = null;
- init = function () {
- pub.get();
- return true;
- };
- pub.get = function () {
- if (loc != null) {
- return loc;
- }
- loc = 'other';
- var path = location.pathname;
- var domain = location.hostname;
- if (domain.match(/^start/i) != null) {
- loc = 'start';
- }
- else if (path.match(/\bcart\b/i) != null) {
- if (path.match(/\bconfigure\b/i)) {
- loc = 'configure';
- }
- else {
- loc = 'cart';
- }
- }
- else if (path.match(/\b(success|placement|(paypal\/standard\/redirect))\b/i) != null) {
- loc = 'success';
- }
- else if (path.match(/\bcheckout\b/i) != null) {
- loc = 'checkout';
- }
- else if (path.match(/\bwishlist\b/i) != null) {
- loc = 'wishlist';
- }
- else if (path.match(/^\/shop\/(([^\/]+)\/)?(.*)\.html$/i) != null) {
- loc = 'detail';
- }
- else if (path.match(/^\/shop\/?(([^\/]+)\/?)?(filter\/?.*)?$/i) != null) {
- loc = 'listing';
- }
- else if (path.match(/^\/?$/i) != null) {
- loc = 'homepage';
- }
- return loc;
- };
- pub.getCategory = function (upperCase) {
- var path = location.pathname;
- category = 'cms';
- if (path.match(/^\/shop\//i)) {
- category = 'shop';
- }
- if (path.match(/^\/shop\/[^\.\/]+$/i) != null) {
- path += '/';
- }
- if (path.match(/^\/shop\/([^\/]+)\/(([^\/\.]+).html)?$/i) != null) {
- category = path.replace(/^\/shop\/([^\/]+)\/(([^\/\.]+).html)?$/i, '$1').toLowerCase();
- }
- if ($.type(upperCase) === 'boolean' && upperCase) {
- category = category.replace(/([^- \t]+)/g, function (_, word) {
- return word.capitalize();
- });
- }
- return category;
- };
- var getCategoryID = function () {
- if (categoryID != null) {
- return categoryID;
- }
- categoryID = '-1';
- categoryID = $('body').attr('class').replace(/^.*category\-id\-(\d)+ .*$/i, '$1');
- return categoryID;
- };
- pub.getCategoryID = getCategoryID;
- pub.getSystem = function () {
- if (system != null) {
- return system;
- }
- system = 'cms';
- var path = location.pathname;
- if (path.match(/^\/shop\//i)) {
- system = 'shop';
- }
- return system;
- };
- pub.getModus = function () {
- if (modus != null) {
- return modus;
- }
- modus = 'dev';
- if (B24_debug_status.getMode('live')) {
- modus = 'live';
- return modus;
- }
- var host = location.hostname;
- if (!!host.match(/^(start|www)\.brille24\.de$/i)) {
- modus = 'live';
- }
- else if (!!host.match(/^qa\.dev-b24\.net$/i)) {
- modus = 'qa';
- }
- $('html').addClass('system_modus_' + modus);
- return modus;
- };
- pub.getStaticModus = function () {
- if (staticModus != null) {
- return staticModus;
- }
- staticModus = 'dev';
- var host = location.hostname;
- if (!!host.match(/^(start|www)\.brille24\.de$/i)) {
- staticModus = 'live';
- }
- else if (!!host.match(/^qa\.dev-b24\.net$/i)) {
- staticModus = 'qa';
- }
- $('html').addClass('system_static_modus_' + staticModus);
- return staticModus;
- };
- pub.getProductType = function () {
- if (productType != null) {
- return productType;
- }
- productType = 'glasses';
- var path = location.pathname;
- if (!!path.match(/kontaktlinse/i)) {
- productType = 'contactlens';
- }
- if (!!path.match(/eyestyle/i)) {
- productType = 'eyestyle';
- }
- return productType;
- };
- pub.getMageParams = function () {
- if (mageParams != null) {
- return mageParams;
- }
- mageParams = getMageParamsFromCookie();
- return mageParams;
- };
- putMageParamsToCookie = function (mg) {
- mg.empty = false;
- $.cookie('b24_mage_params', JSON.stringify(mg), {path: '/'});
- return true;
- };
- getMageParamsFromCookie = function () {
- var storeID = '1';
- if (pub.getStaticModus() != 'live') {
- storeID = '9999';
- }
- var customerID = false;
- if (!!jQuery.getlocations().params && !!jQuery.getlocations().params.cidb24 && jQuery.getlocations().params.cidb24 != '0') {
- customerID = jQuery.getlocations().params.cidb24;
- }
- if ($.cookie('personalisation') == null) {
- return{'empty': true, 'C': customerID, 'S': storeID};
- }
- var personalisationJSON = JSON.parse($.cookie('personalisation'), {path: '/'});
- return{'empty': false, 'Q': personalisationJSON.quote_id, 'S': storeID, 'C': (!!personalisationJSON.customer_id ?
- personalisationJSON.customer_id : customerID)};
- };
- init();
- return pub;
- })(jQuery);
- ;
- ;
- var ___b24 = ___b24 || {};
- ___b24.loadscript = (function (window, $) {
- var pub = {};
- var load = function (source, sync, utf8) {
- var script = document.createElement('script');
- script.type = 'text/javascript';
- if (typeof(sync) == 'boolean' && sync) {
- script.async = true;
- }
- else {
- script.async = false;
- }
- if (typeof(utf8) == 'boolean' && utf8) {
- script.charset = 'utf-8';
- }
- script.src = source;
- var scriptDOM = document.getElementsByTagName('script')[0];
- scriptDOM.parentNode.insertBefore(script, scriptDOM);
- };
- pub.load = load;
- var loadImg = function (url, params, subsitute) {
- if (typeof(params) == 'object') {
- url = makeURL(url, params);
- }
- try {
- if (typeof(subsitute) == 'string' && !!subsitute) {
- url = url.replace(/\?/i, subsitute);
- }
- }
- catch (err) {
- ___b24.tracking.error('loadscript.loadImg', err);
- }
- var $img = $('<img />').attr({'class': 'visuallyhidden', 'src': url})
- var $dyn = $('#dynamic');
- if (!$('#dynamic').length) {
- $dyn = $('<div />').attr({'class': 'visuallyhidden', id: 'dynamic'});
- $('body').append(dyn);
- }
- $dyn.append($img);
- };
- pub.loadImg = loadImg;
- var putDOM = function (part) {
- var $dyn = $('#dynamic');
- if (!$('#dynamic').length) {
- $dyn = $('<div />').attr({'class': 'visuallyhidden', id: 'dynamic'});
- $('body').append(dyn);
- }
- $dyn.append(part);
- };
- pub.putDOM = putDOM;
- var loadIFrame = function (url, params) {
- if (typeof(params) == 'object') {
- url = makeURL(url, param);
- }
- $('<iframe />').attr({'class': 'visuallyhidden', 'src': url}).appendTo('body');
- };
- pub.loadIFrame = loadIFrame;
- var makeURL = function (url, params) {
- if (typeof(params) == 'object') {
- params = $.param(params);
- }
- else {
- return url;
- }
- if (!!url.match(/\?/i)) {
- url += '&';
- }
- else {
- url += '?';
- }
- url += params;
- return url;
- };
- return pub;
- })(window, jQuery, undefined);
- ;
- ;
- var ___b24 = ___b24 || {};
- ___b24.experiment = function (name, ids, pageId, defaultID) {
- ___b24.tracking = ___b24.tracking || {error: function () {
- ;
- }};
- var pub = {};
- var $ = jQuery;
- var expClID = 'so_s195_EF5nhCtp4hx07';
- var linkclid = 'divoluso_s195_EF5nhCtp4hx07';
- var storageName = 'b24_experiment1408';
- var expName = name;
- var storedTime = 0;
- var paramName = 'b24_exp_' + name;
- var expVariants = ids;
- var actualVariant = 0;
- var callCycle = 60;
- var expTTL = 30;
- var overload = false;
- var virgin = true;
- var init = function () {
- try {
- if (!B24_debug_status.getMode('divolution')) {
- virgin = false;
- actualVariant = expVariants[0];
- $('html').addClass('b24exp_' + name + '_' + actualVariant);
- return false;
- }
- if (isExpStored()) {
- virgin = false;
- actualVariant = defaultID || getVariant();
- actualVariant = actualVariant.toString();
- storeExp();
- }
- else {
- actualVariant = defaultID || getVariantByRandom();
- actualVariant = actualVariant.toString();
- storeExp();
- }
- $('html').addClass('b24exp_' + name + '_' + actualVariant);
- if (typeof(pageId) != 'undefined') {
- if (typeof(window['rt_pageid' + pageId]) != 'undefined') {
- ___('################################DIVOLUTION################################PROBLEM##################');
- throw'there is allready an Experiment registered: ' + expName + 'pageIde' + pageId;
- return false;
- }
- window['rt_pageid' + pageId] = actualVariant;
- }
- else {
- if (parseInt(actualVariant, 10) > 0) {
- window.rt_clid = 'divolu' + expClID + '|sitedivolu';
- if (typeof(window.rt_pageid) == 'undefined') {
- window.rt_pageid = actualVariant;
- pageId = 1;
- }
- else {
- overload = true;
- for (var i = 2; i < 7; i++) {
- if (typeof(window['rt_pageid' + i]) == 'undefined') {
- window['rt_pageid' + i] = actualVariant;
- overload = false;
- pageId = i;
- break;
- }
- }
- }
- }
- }
- registerEvents();
- callScript();
- }
- catch (err) {
- ___b24.tracking.error('divolution.experiment.init', err);
- }
- };
- var callScript = function () {
- var actualTime = Math.round(new Date().getTime() / 1000 / 60);
- var olderAsAnHour = (actualTime - callCycle) > storedTime;
- if (virgin || olderAsAnHour) {
- storeExp(actualTime);
- window.rt_async = true;
- ___b24.loadscript.load('//rt.divolution.com/js/site/' + expClID + '.js');
- return true;
- }
- return false;
- };
- var getVariantByRandom = function () {
- var param = paramExp();
- if (param != 'none') {
- return param;
- }
- return expVariants[Math.floor((Math.random() * expVariants.length) + 0)].toString();
- };
- pub.setExperiment = function (which) {
- if (typeof(which) == 'undefined') {
- return false;
- }
- $('html').removeClass('b24exp_' + name + '_' + actualVariant);
- actualVariant = which.toString();
- $('html').addClass('b24exp_' + name + '_' + actualVariant);
- storeExp();
- };
- var isExpStored = function () {
- if (!!$.cookie(storageName)) {
- var storedObj = JSON.parse($.cookie(storageName));
- if (typeof(storedObj) == 'object' && typeof(storedObj[name]) != 'undefined') {
- return true;
- }
- }
- return false;
- };
- pub.isExpStored = isExpStored;
- var paramExp = function () {
- if (!!$.getlocations().params && !!$.getlocations().params[paramName] && $.inArray($.getlocations().params[paramName], expVariants)) {
- return $.getlocations().params[paramName];
- }
- else {
- return'none';
- }
- };
- var getVariant = function () {
- try {
- if (!!actualVariant) {
- return actualVariant;
- }
- var param = paramExp();
- if (param != 'none') {
- actualVariant = param;
- storeExp();
- }
- var storedObj = JSON.parse($.cookie(storageName));
- actualVariant = storedObj[name].variant;
- return actualVariant;
- }
- catch (err) {
- ___b24.tracking.error('divolution.experiment.getVariant', err);
- }
- };
- pub.getExperiment = getVariant;
- var storeExp = function (t) {
- try {
- var storedObj = {};
- if (!!$.cookie(storageName)) {
- storedObj = JSON.parse($.cookie(storageName));
- }
- if (typeof(t) != 'undefined') {
- storedTime = t;
- }
- else if (typeof(storedObj[name]) != 'undefined') {
- storedTime = storedObj[name].time;
- }
- else {
- storedTime = Math.round(new Date().getTime() / 1000 / 60);
- }
- var newStore = {};
- newStore[name] = {variant: actualVariant, time: storedTime};
- var toStoredObj = $.extend(storedObj, newStore);
- toStoredObj = JSON.stringify(toStoredObj);
- $.cookie(storageName, toStoredObj, {'path': '/', 'expires': expTTL});
- return true;
- }
- catch (err) {
- ___b24.tracking.error('divolution.experiment.storeExp', err);
- }
- };
- var getExperimentInfo = function () {
- return{ExperimentName: name, ExperimentVariants: expVariants, ExperimentActualVariant: actualVariant, ExperimentLastCallTime: storedTime, ExperimentPageID: pageId};
- };
- pub.getExperimentInfo = getExperimentInfo;
- var registerEvents = function () {
- $(document).on('click', '.DVCLICK', function () {
- var url = $(this).attr('href');
- var clickText;
- if ($(this).attr('alt') != null) {
- clickText = $(this).attr('alt');
- }
- else {
- clickText = url;
- }
- var mr = Math.random();
- var num = mr * 1000000000000000000;
- var encname = encodeURIComponent(clickText);
- var image1 = new Image();
- image1.src = '//rt.divolution.com/cgi-bin/rt.cgi?rt_clid=' + linkclid + '|sitedivoluAction_' + encname + '&rt_typ=2&mt=' + num;
- var rt_zaehler = 0;
- var rt_max_repeat = 50;
- var rt_timeout = function () {
- var rt_kontrolle = image1.height;
- if (rt_kontrolle > 0 | rt_zaehler > rt_max_repeat) {
- location.href = url;
- }
- else {
- rt_zaehler++;
- window.setTimeout(rt_timeout, 500);
- }
- };
- window.setTimeout(rt_timeout, 500);
- return false;
- });
- };
- var call = function (what) {
- if (!B24_debug_status.getMode('divolution')) {
- return false;
- }
- var mr = Math.random();
- var num = mr * 1000000000000000000;
- var image1 = new Image();
- image1.src = '//rt.divolution.com/cgi-bin/rt.cgi?rt_clid=' + linkclid + '|sitedivoluAction_' + what + '&rt_typ=2&mt=' + num;
- return true;
- };
- pub.call = call;
- init();
- if (overload) {
- return false;
- }
- else {
- return pub;
- }
- };
- ;
- ;
- var ___b24 = ___b24 || {};
- ___b24.productmap = (function (window, $) {
- var pub = {};
- 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'};
- 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'}};
- pub.getExtentedMap = function () {
- return extendedmap;
- };
- pub.getMap = function () {
- return map;
- };
- pub.getExtented = function (num) {
- var out = {};
- if (typeof(num) != 'number' && typeof(num) != 'string') {
- out = extendedmap['error'];
- out['sort'] = map['sort'] + num.toString();
- }
- else {
- num.toString();
- }
- if (typeof(map[num]) == 'undefined') {
- out = extendedmap['error'];
- out['sort'] = out['sort'] + num.toString();
- }
- else {
- out = extendedmap[num];
- }
- return out;
- };
- pub.get = function (num) {
- if (typeof(num) != 'number' && typeof(num) != 'string') {
- num = 'error';
- }
- else {
- num.toString();
- }
- if (typeof(map[num]) == 'undefined') {
- return map['error'];
- }
- else {
- return map[num];
- }
- };
- return pub;
- })(window, jQuery, undefined);
- var B24_cart_object = (function ($) {
- var pub = {};
- var cart = null;
- var cartOld = null;
- var cartLength = null;
- var comparedCarts = null;
- var valid = null;
- var customerStatus = null;
- var cartStatus = null;
- var key = 'b24_cart';
- var ttl = 360000;
- var setCart = function (cartSource) {
- cartOld = getCartFromStorage();
- if (validCart(cartSource)) {
- cartSource = extendOrderItem(cartSource);
- cartSource = calculateNetto(cartSource);
- cartSource = mergeCart(cartSource);
- }
- else {
- cartSource = getEmptyCart(false);
- }
- putCartToStorage(cartSource);
- cart = getCartFromStorage();
- setCartStatus();
- return cart;
- };
- pub.setCart = setCart;
- var getEmptyCart = function (valid) {
- var emptyCart = {empty: true, order_items: []};
- if (typeof(valid) == 'boolean') {
- emptyCart.valid = valid;
- }
- else {
- emptyCart.valid = true;
- }
- return emptyCart;
- };
- var getCart = function () {
- return cart;
- };
- pub.getCart = getCart;
- pub.deleteCart = function () {
- return deleteStorage();
- };
- pub.getCartLength = function () {
- if (cartLength != null) {
- return cartLength;
- }
- if (cart == null) {
- pub.getCart();
- }
- if (typeof(cart.order_items) == 'object') {
- cartLength = cart.order_items.length;
- }
- else {
- cartLength = 0;
- }
- return cartLength;
- };
- pub.getCustomerStatus = function () {
- if (customerStatus != null) {
- return customerStatus;
- }
- customerStatus = 'obscureCustomer';
- var cart = pub.getCart();
- if (!!cart && typeof(cart.customer) == 'object' && typeof(cart.customer) != 'undefined') {
- if (typeof(cart.customer.segment_ids) == 'object') {
- if (typeof(cart.customer.segment_ids[0]) != 'undefined' && cart.customer.segment_ids[0] == 1) {
- customerStatus = 'newCustomer';
- }
- else {
- customerStatus = 'existingCustomer';
- }
- }
- }
- return customerStatus;
- };
- var setCartStatus = function () {
- cartStatus = 'empty';
- if (!cart.empty) {
- var positions = cart.order_items.length;
- var positionsOld = cartOld.order_items.length;
- if (!positions) {
- if (positionsOld > 0) {
- cartStatus = 'terminated';
- }
- else {
- cartStatus = 'stillEmpty';
- }
- }
- else {
- if (positionsOld > 0) {
- if (positions > positionsOld) {
- cartStatus = 'addPosition';
- }
- else if (positions < positionsOld) {
- cartStatus = 'deletedPosition';
- }
- else {
- cartStatus = 'haveaLook';
- }
- }
- else {
- cartStatus = 'addPositionFirstTime';
- }
- $.cookie('b24_cart', positions, {path: '/'});
- }
- }
- return cartStatus;
- };
- pub.getCartStatus = function () {
- if (!!cartStatus) {
- return cartStatus;
- }
- cartStatus = 'notincart';
- return cartStatus;
- };
- var validCart = function (cartSource) {
- var error = '';
- if (typeof(cartSource) != 'object') {
- error = 'cart is not an object';
- }
- if (typeof(cartSource.order_items) != 'object') {
- error = 'order_item is not a object';
- if (typeof(cartSource.order_items) != 'object') {
- error = 'there a zero order_items';
- }
- }
- if (!error) {
- valid = true;
- return valid;
- }
- valid = false;
- ___b24.tracking.error('B24_cart_object.validCart', error);
- return valid;
- };
- var mergeCart = function (sourceCart) {
- var mageParams = B24_shoplocation.getMageParams();
- if (!!mageParams.Q) {
- sourceCart.quoteID = mageParams.Q;
- }
- if (!!mageParams.S) {
- sourceCart.shopID = mageParams.S;
- }
- if (!!mageParams.C) {
- sourceCart.customerID = mageParams.C;
- }
- sourceCart.empty = false;
- sourceCart.valid = true;
- return sourceCart;
- };
- var calculateNetto = function (sourceCart) {
- var netTotal = 0;
- $.each(sourceCart.order_items, function (index, value) {
- var netTotalItem = value.qty_ordered * value.price - value.discount_amount;
- var netTotalItemSingle = value.price - value.discount_amount;
- netTotalItem = Math.round(netTotalItem * 100) / 100;
- var netTotalItemShippment = netTotalItem;
- if (value.product_type_extended.sort == 'Glass') {
- var shippment = value.qty_ordered * 5;
- netTotalItemShippment += shippment;
- }
- netTotalItemSingle = Math.round(netTotalItemSingle * 100) / 100;
- var netTotalItemSingleShipping = netTotalItemSingle;
- if (value.product_type_extended.sort == 'Glass') {
- var shippment = 5;
- netTotalItemSingleShipping += shippment;
- }
- sourceCart.order_items[index].netTotal = netTotalItem;
- sourceCart.order_items[index].netTotalSingle = netTotalItemSingle;
- sourceCart.order_items[index].netTotalItemShippment = netTotalItemShippment;
- sourceCart.order_items[index].netTotalItemSingleShipping = netTotalItemSingleShipping;
- netTotal += netTotalItem;
- });
- netTotal = netTotal / 1.19;
- netTotal = Math.round(netTotal * 100) / 100;
- if (typeof(sourceCart.payment) != 'object') {
- sourceCart.payment = {};
- }
- sourceCart.payment.netTotal = netTotal;
- return sourceCart;
- };
- var extendOrderItem = function (sourceCart) {
- $.each(sourceCart.order_items, function (index, value) {
- var pType = parseInt(value.product_type).toString();
- sourceCart.order_items[index].product_type_name = ___b24.productmap.get(pType);
- sourceCart.order_items[index].product_type_extended = ___b24.productmap.getExtented(pType);
- var fgid = value.product_sku;
- if (typeof(___b24.productmap.getExtented(pType).lens) == 'string') {
- fgid += '-' + (___b24.productmap.getExtented(pType).lens.toLowerCase());
- }
- if (typeof(___b24.productmap.getExtented(pType).lensext) == 'string') {
- fgid += '_' + (___b24.productmap.getExtented(pType).lensext.toLowerCase());
- }
- if (typeof(value.lensvalues) == 'object' && typeof(value.lensvalues.LColor) == 'string') {
- fgid += '-' + value.lensvalues.LColor;
- }
- sourceCart.order_items[index].product_sku_extended = fgid;
- sourceCart.order_items[index].product_sku_extended_index = fgid;
- if (typeof(value.product_upselling) != 'undefined' && !!value.product_upselling) {
- var glassindex = value.product_upselling.toString().match(/[\d\.]+/i);
- sourceCart.order_items[index].product_sku_extended_index += !!glassindex ? '-i' + glassindex[0] : '';
- }
- sourceCart.order_items[index].product_sku_extended_clean = fgid.replace(/[-_]/gi, '');
- });
- return sourceCart;
- };
- var putCartToStorage = function (cartParam) {
- $.jStorage.set(key, cart_order_object, {'TTL': ttl});
- return true;
- };
- var getCartFromStorage = function () {
- return $.jStorage.get(key, getEmptyCart());
- };
- var getOldCart = function () {
- return cartOld;
- };
- pub.getOldCart = getOldCart;
- var deleteStorage = function () {
- $.jStorage.deleteKey(key);
- return getEmptyCart();
- };
- pub.getCartAction = function () {
- if (!!comparedCarts) {
- return comparedCarts;
- }
- comparedCarts = compareCarts();
- return comparedCarts;
- };
- var compareCarts = function () {
- if (!cart) {
- cart = getCart();
- }
- if (!cartOld) {
- cartOld = getOldCart();
- }
- var balance = {'action': 'view', 'balance': [], 'balanceId': []};
- var cartIds = [];
- $.each(cart.order_items, function (index, value) {
- cartIds.push(value.id);
- });
- var cartOldIds = [];
- $.each(cartOld.order_items, function (index, value) {
- cartOldIds.push(value.id);
- });
- $.each(cartIds, function (index, value) {
- if ($.inArray(value, cartOldIds) < 0) {
- balance.balanceId.push(value);
- balance.balance.push(cart.order_items[index]);
- balance.action = 'add';
- }
- });
- if (balance.action == 'view') {
- $.each(cartOldIds, function (index, value) {
- if ($.inArray(value, cartIds) < 0) {
- balance.balanceId.push(value);
- balance.balance.push(cartOld.order_items[index]);
- balance.action = 'del';
- }
- });
- }
- if (balance.action == 'view') {
- $.each(cart.order_items, function (index, value) {
- var itemsQty = value.qty_ordered;
- var itemsOtyOld = cartOld.order_items[index].qty_ordered;
- var differ = itemsQty - itemsOtyOld;
- if (differ > 0) {
- balance.action = 'add';
- balance.balanceId.push(value.id);
- var item = $.extend({}, value);
- item.qty_ordered = differ;
- balance.balance.push(item);
- }
- else if (differ < 0) {
- balance.action = 'del';
- balance.balanceId.push(value.id);
- var item = $.extend({}, value);
- item.qty_ordered = differ;
- balance.balance.push(item);
- }
- });
- }
- return balance;
- };
- pub.compareCarts = compareCarts;
- return pub;
- })(jQuery);
- var B24_order_object = (function ($) {
- var pub = {};
- var order = null;
- var shortCut = false;
- pub.getOrder = function (persistent, regex) {
- if ($.type(persistent) === "regexp") {
- regex = persistent;
- }
- if (shortCut) {
- return order;
- }
- if (B24_shoplocation.get() != 'success') {
- order = null;
- return order;
- }
- if ($.type(persistent) !== "boolean" || persistent !== true) {
- if (typeof(order_object) != 'object' || !order_object.virgin) {
- order = null;
- return order;
- }
- }
- try {
- if (typeof(regex) == 'object' && !B24_cpid_object.testCpid(regex)) {
- return null;
- }
- }
- catch (err) {
- ___(err);
- }
- if (order != null) {
- return order;
- }
- order = B24_cart_object.getCart();
- order = mergeOrderWithCart(order);
- if (!B24_debug_status.getMode('success')) {
- B24_cart_object.deleteCart();
- }
- return order;
- }
- pub.setOrder = function (ord) {
- order = null;
- if (typeof(ord) == 'object') {
- order = ord;
- }
- else {
- order = B24_cart_object.getCart();
- }
- shortCut = true;
- return order;
- }
- pub.deleteOrder = function () {
- order = null;
- return order;
- }
- var setQuantity = function (ord) {
- var qty = 0;
- $.each(ord.order_items, function (index, value) {
- qty += parseInt(value.qty_ordered, 10);
- });
- ord.quantity = qty;
- return ord;
- };
- var mergeOrderWithCart = function (ord) {
- var orderObject = extendOrderItem(order_object);
- orderObject = calculateNetto(orderObject);
- orderObject = calculateBrutto(orderObject);
- orderObject = stopTrackingByConversionComment(orderObject);
- orderObject = setQuantity(orderObject);
- return orderObject;
- };
- var calculateNetto = function (sourceCart) {
- var netTotal = 0;
- $.each(sourceCart.order_items, function (index, value) {
- var netTotalItem = value.qty_ordered * value.price - value.discount_amount;
- var netTotalItemSingle = value.price - value.discount_amount;
- netTotalItem = Math.round(netTotalItem * 100) / 100;
- var netTotalItemShippment = netTotalItem;
- if (value.product_type_extended.sort == 'Glass') {
- var shippment = value.qty_ordered * 5;
- netTotalItemShippment += shippment;
- }
- netTotalItemSingle = Math.round(netTotalItemSingle * 100) / 100;
- var netTotalItemSingleShipping = netTotalItemSingle;
- if (value.product_type_extended.sort == 'Glass') {
- var shippment = 5;
- netTotalItemSingleShipping += shippment;
- }
- sourceCart.order_items[index].netTotal = netTotalItem;
- sourceCart.order_items[index].netTotalSingle = netTotalItemSingle;
- sourceCart.order_items[index].netTotalItemShippment = netTotalItemShippment;
- sourceCart.order_items[index].netTotalItemSingleShipping = netTotalItemSingleShipping;
- netTotal += netTotalItem;
- });
- sourceCart.payment.totalClean = Math.round(netTotal * 100) / 100;
- netTotal = netTotal / 1.19;
- netTotal = Math.round(netTotal * 100) / 100;
- if (typeof(sourceCart.payment) != 'object') {
- sourceCart.payment = {};
- }
- sourceCart.payment.netTotal = netTotal;
- return sourceCart;
- };
- var calculateBrutto = function (sourceCart) {
- $.each(sourceCart.order_items, function (index, value) {
- sourceCart.order_items[index].bruttoTotal = value.netTotal;
- if (value.product_type_extended.sort == 'Glass') {
- var shipping = 5 * parseInt(value.qty_ordered, 10);
- sourceCart.order_items[index].bruttoTotal += shipping;
- }
- });
- return sourceCart;
- };
- var extendOrderItem = function (sourceCart) {
- $.each(sourceCart.order_items, function (index, value) {
- var pType = value.product_type + '';
- sourceCart.order_items[index].product_type_name = ___b24.productmap.get(pType);
- sourceCart.order_items[index].product_type_extended = ___b24.productmap.getExtented(pType);
- var fgid = value.product_sku;
- if (typeof(___b24.productmap.getExtented(pType).lens) == 'string') {
- fgid += '-' + (___b24.productmap.getExtented(pType).lens.toLowerCase());
- }
- if (typeof(___b24.productmap.getExtented(pType).lensext) == 'string') {
- fgid += '_' + (___b24.productmap.getExtented(pType).lensext.toLowerCase());
- }
- if (typeof(value.lensvalues) == 'object' && typeof(value.lensvalues.LColor) == 'string') {
- fgid += '-' + value.lensvalues.LColor;
- }
- sourceCart.order_items[index].product_sku_extended = fgid;
- sourceCart.order_items[index].product_sku_extended_index = fgid;
- if (typeof(value.product_upselling) != 'undefined' && !!value.product_upselling) {
- var glassindex = value.product_upselling.toString().match(/[\d\.]+/i);
- sourceCart.order_items[index].product_sku_extended_index += !!glassindex ? '-i' + glassindex[0] : '';
- }
- sourceCart.order_items[index].product_sku_extended_clean = fgid.replace(/[-_]/gi, '');
- });
- return sourceCart;
- };
- var stopTrackingByConversionComment = function (ord) {
- ord.tracking = true;
- if (!!ord && typeof(ord.customer_comment) == 'string' && !!ord.customer_comment.match(/\#test\#/i)) {
- ord.tracking = false;
- }
- return ord;
- };
- return pub;
- })(jQuery);
- var B24_cpid_object = (function ($) {
- var pub = {};
- var cpid = null;
- var source = null;
- var domain = null;
- var init = function () {
- domain = $.getlocations().hostname;
- if (domain.match(/(start|www)\.brille24\.de/i) != null) {
- domain = 'brille24.de';
- }
- setUpCpids();
- };
- pub.init = init;
- var getCpid = function () {
- cpid = $.cookie('b24_entrycpid');
- if (cpid == null) {
- cpid = '';
- }
- return cpid;
- };
- pub.getCpid = getCpid;
- var testCpid = function (regex) {
- if (typeof(regex) != 'object') {
- return false;
- }
- if (typeof(regex.test) != 'function') {
- return false;
- }
- if (cpid == null) {
- getCpid();
- }
- return(cpid.match(regex) != null);
- };
- pub.testCpid = testCpid;
- var setUpCpids = function () {
- var b24_cpid = '';
- if (typeof($.getlocations().params.b24_cpid) == "string") {
- b24_cpid = $.getlocations().params.b24_cpid;
- }
- else if (!!getCpid()) {
- return false;
- }
- else {
- b24_cpid = getSource();
- }
- var exdays = 30;
- if (b24_cpid.match(/^(direct|organic|referrer)$/i) != null) {
- exdays = 1;
- }
- if (b24_cpid == 'null') {
- b24_cpid = null;
- }
- $.cookie("B24_CampaignId", b24_cpid, {'path': '/', 'expires': 30, 'domain': domain});
- $.cookie("b24_entrycpid", b24_cpid, {'path': '/', 'expires': exdays, 'domain': domain});
- return true;
- };
- var getSource = function () {
- if (source != null) {
- return source;
- }
- var referrer = document.referrer;
- var paramarray = referrer.replace(/^[^?]+\?/i, '').split('&');
- var params = {};
- $.each(paramarray, function (index, value) {
- var arr = value.split('=');
- params[arr[0]] = arr[1];
- });
- if (referrer == '') {
- source = 'direct';
- }
- else if (typeof(params.esrc) == 'string') {
- source = 'organic';
- }
- else {
- source = 'referrer';
- }
- return source;
- };
- pub.getSource = getSource;
- pub.init();
- return pub;
- })(jQuery);
- var B24_product_object = (function ($) {
- var pub = {};
- var product = null;
- pub.getList = function (num) {
- var sku = [];
- $('.products .canvas>span a').each(function () {
- var skuext = '';
- var url = $(this).attr('href');
- var matches = url.match(/frame\=([0-9a-z]+).*glass\=([0-9a-z]+)?/i);
- if (!!matches) {
- matches.shift();
- skuext = matches.join('') + '0000';
- sku.push(skuext);
- }
- });
- if (typeof(num) == 'number') {
- sku = sku.slice(0, num);
- }
- return sku;
- };
- pub.get = function () {
- product = {};
- product.sku = 'undefined';
- product.sku_extended = 'undefined';
- product.name = 'undefined';
- product.price = 'undefined';
- product.netPrice = 'undefined';
- product.typeName = 'undefined';
- product.sku_extended_clean = 'undefined';
- try {
- if (typeof(bundleMap) == 'object') {
- product.sku = $.b24_get_sku();
- var tinting = $.b24_get_lenscolor();
- var kind = $.b24_get_glasstype();
- product.sku_extended = product.sku;
- product.sku_extended = product.sku + '-' + kind + '-' + tinting;
- product.sku_extended_clean = product.sku_extended.replace(/[^a-z0-9]/ig, '');
- product.name = $.b24_get_product_name();
- product.price = $.b24_get_total_price();
- product.typeName = 'Brille';
- }
- else if (typeof(b24_product_info) == 'object') {
- product.name = b24_product_info.name;
- product.sku = b24_product_info.sku;
- product.price = optionsPrice.productPrice;
- product.sku_extended = product.sku;
- product.sku_extended_clean = product.sku_extended.replace(/[^a-z0-9]/ig, '');
- }
- if (product.price != 'undefined') {
- try {
- product.netPrice = Math.round(product.price / 1.19 * 100) / 100;
- }
- catch (err) {
- ___b24.tracking.error('B24_product_object.get', err);
- }
- }
- }
- catch (err) {
- ___b24.tracking.error('B24_product_object.get.sku_extended', err);
- }
- return product;
- }
- return pub;
- })(jQuery);
- var B24_customer_object = (function ($) {
- var pub = {};
- var customer = null;
- var loggedIn = function () {
- if (customer != null) {
- return customer;
- }
- customer = false;
- if (typeof($.cookie) != 'undefined' && $.cookie('shoploggedin') == 1) {
- customer = true;
- }
- return customer;
- }
- pub.loggedIn = loggedIn;
- var getCustomerId = function () {
- return B24_shoplocation.getMageParams().C;
- };
- pub.getCustomerId = getCustomerId;
- return pub;
- })(jQuery);
- ;
- (function ($) {
- $.fn.nivoSlider = function (options) {
- var settings = $.extend({}, $.fn.nivoSlider.defaults, options);
- return this.each(function () {
- var vars = {currentSlide: 0, currentImage: '', totalSlides: 0, randAnim: '', running: false, paused: false, stop: false};
- var slider = $(this);
- slider.data('nivo:vars', vars);
- slider.css('position', 'relative');
- slider.width('1px');
- slider.height('1px');
- slider.addClass('nivoSlider');
- var kids = slider.children();
- kids.each(function () {
- var child = $(this);
- if (!child.is('img')) {
- if (child.is('a')) {
- child.addClass('nivo-imageLink')
- }
- child = child.find('img:first')
- }
- var childWidth = child.width();
- if (childWidth == 0) {
- childWidth = child.attr('width');
- }
- var childHeight = child.height();
- if (childHeight == 0) {
- childHeight = child.attr('height');
- }
- if (childWidth > slider.width()) {
- slider.width(childWidth)
- }
- if (childHeight > slider.height()) {
- slider.height(childHeight)
- }
- child.css('display', 'none');
- vars.totalSlides++
- });
- if (settings.startSlide > 0) {
- if (settings.startSlide >= vars.totalSlides) {
- settings.startSlide = vars.totalSlides - 1;
- }
- vars.currentSlide = settings.startSlide
- }
- if ($(kids[vars.currentSlide]).is('img')) {
- vars.currentImage = $(kids[vars.currentSlide])
- }
- else {
- vars.currentImage = $(kids[vars.currentSlide]).find('img:first')
- }
- if ($(kids[vars.currentSlide]).is('a')) {
- $(kids[vars.currentSlide]).css('display', 'block')
- }
- slider.css('background', 'url(' + vars.currentImage.attr('src') + ') no-repeat');
- for (var i = 0; i < settings.slices; i++) {
- var sliceWidth = Math.round(slider.width() / settings.slices);
- if (i == settings.slices - 1) {
- slider.append($('<div class="nivo-slice"></div>').css({left: (sliceWidth * i) + 'px', width: (slider.width() - (sliceWidth * i))
- + 'px'}))
- }
- else {
- slider.append($('<div class="nivo-slice"></div>').css({left: (sliceWidth * i) + 'px', width: sliceWidth + 'px'}))
- }
- }
- slider.append($('<div class="nivo-caption"><p></p></div>').css({display: 'none', opacity: settings.captionOpacity}));
- if (vars.currentImage.attr('title') != '') {
- $('.nivo-caption p', slider).html(vars.currentImage.attr('title'));
- $('.nivo-caption', slider).fadeIn(settings.animSpeed)
- }
- var timer = 0;
- if (!settings.manualAdvance) {
- timer = setInterval(function () {
- nivoRun(slider, kids, settings, false)
- }, settings.pauseTime)
- }
- if (settings.directionNav) {
- slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav">Prev</a><a class="nivo-nextNav">Next</a></div>');
- if (settings.directionNavHide) {
- $('.nivo-directionNav', slider).hide();
- slider.hover(function () {
- $('.nivo-directionNav', slider).show();
- }, function () {
- $('.nivo-directionNav', slider).hide();
- })
- }
- $('a.nivo-prevNav', slider).live('click', function () {
- if (vars.running) {
- return false;
- }
- clearInterval(timer);
- timer = '';
- vars.currentSlide -= 2;
- nivoRun(slider, kids, settings, 'prev')
- });
- $('a.nivo-nextNav', slider).live('click', function () {
- if (vars.running) {
- return false;
- }
- clearInterval(timer);
- timer = '';
- nivoRun(slider, kids, settings, 'next')
- })
- }
- if (settings.controlNav) {
- var nivoControl = $('<div class="nivo-controlNav"></div>');
- slider.append(nivoControl);
- for (var i = 0; i < kids.length; i++) {
- var u = i + 1;
- if (settings.controlNavThumbs) {
- var child = kids.eq(i);
- if (!child.is('img')) {
- child = child.find('img:first')
- }
- nivoControl.append('<a class="nivo-control" rel="' + i + '"><img src="'
- + child.attr('src').replace(settings.controlNavThumbsSearch, settings.controlNavThumbsReplace) + '"></a>')
- }
- else {
- nivoControl.append('<a class="nivo-control" rel="' + i + '">' + u + '</a>')
- }
- }
- $('.nivo-controlNav a:eq(' + vars.currentSlide + ')', slider).addClass('active');
- $(document).on("click", ".nivo-controlNav a, " + slider, function () {
- if (vars.running) {
- return false;
- }
- if ($(this).hasClass('active')) {
- return false;
- }
- clearInterval(timer);
- timer = '';
- slider.css('background', 'url(' + vars.currentImage.attr('src') + ') no-repeat');
- vars.currentSlide = $(this).attr('rel') - 1;
- nivoRun(slider, kids, settings, 'control')
- })
- }
- if (settings.keyboardNav) {
- $(window).keypress(function (event) {
- if (event.keyCode == '37') {
- if (vars.running) {
- return false;
- }
- clearInterval(timer);
- timer = '';
- vars.currentSlide -= 2;
- nivoRun(slider, kids, settings, 'prev')
- }
- if (event.keyCode == '39') {
- if (vars.running) {
- return false;
- }
- clearInterval(timer);
- timer = '';
- nivoRun(slider, kids, settings, 'next')
- }
- })
- }
- if (settings.pauseOnHover) {
- slider.hover(function () {
- vars.paused = true;
- clearInterval(timer);
- timer = ''
- }, function () {
- vars.paused = false;
- if (timer == '' && !settings.manualAdvance) {
- timer = setInterval(function () {
- nivoRun(slider, kids, settings, false)
- }, settings.pauseTime)
- }
- })
- }
- slider.bind('nivo:animFinished', function () {
- vars.running = false;
- $(kids).each(function () {
- if ($(this).is('a')) {
- $(this).css('display', 'none')
- }
- });
- if ($(kids[vars.currentSlide]).is('a')) {
- $(kids[vars.currentSlide]).css('display', 'block')
- }
- if (timer == '' && !vars.paused && !settings.manualAdvance) {
- timer = setInterval(function () {
- nivoRun(slider, kids, settings, false)
- }, settings.pauseTime)
- }
- settings.afterChange.call(this)
- })
- });
- function nivoRun(slider, kids, settings, nudge) {
- var vars = slider.data('nivo:vars');
- if ((!vars || vars.stop) && !nudge) {
- return false;
- }
- settings.beforeChange.call(this);
- if (!nudge) {
- slider.css('background', 'url(' + vars.currentImage.attr('src') + ') no-repeat')
- }
- else {
- if (nudge == 'prev') {
- slider.css('background', 'url(' + vars.currentImage.attr('src') + ') no-repeat')
- }
- if (nudge == 'next') {
- slider.css('background', 'url(' + vars.currentImage.attr('src') + ') no-repeat')
- }
- }
- vars.currentSlide++;
- if (vars.currentSlide == vars.totalSlides) {
- vars.currentSlide = 0;
- settings.slideshowEnd.call(this)
- }
- if (vars.currentSlide < 0) {
- vars.currentSlide = (vars.totalSlides - 1);
- }
- if ($(kids[vars.currentSlide]).is('img')) {
- vars.currentImage = $(kids[vars.currentSlide])
- }
- else {
- vars.currentImage = $(kids[vars.currentSlide]).find('img:first')
- }
- if (settings.controlNav) {
- $('.nivo-controlNav a', slider).removeClass('active');
- $('.nivo-controlNav a:eq(' + vars.currentSlide + ')', slider).addClass('active')
- }
- if (vars.currentImage.attr('title') != '') {
- if ($('.nivo-caption', slider).css('display') == 'block') {
- $('.nivo-caption p', slider).fadeOut(settings.animSpeed, function () {
- $(this).html(vars.currentImage.attr('title'));
- $(this).fadeIn(settings.animSpeed)
- })
- }
- else {
- $('.nivo-caption p', slider).html(vars.currentImage.attr('title'))
- }
- $('.nivo-caption', slider).fadeIn(settings.animSpeed)
- }
- else {
- $('.nivo-caption', slider).fadeOut(settings.animSpeed)
- }
- var i = 0;
- $('.nivo-slice', slider).each(function () {
- var sliceWidth = Math.round(slider.width() / settings.slices);
- $(this).css({height: '0px', opacity: '0', background: 'url(' + vars.currentImage.attr('src') + ') no-repeat -' + ((sliceWidth + (i
- * sliceWidth)) - sliceWidth) + 'px 0%'});
- i++
- });
- if (settings.effect == 'random') {
- var anims = new Array("sliceDownRight",
- "sliceDownLeft",
- "sliceUpRight",
- "sliceUpLeft",
- "sliceUpDown",
- "sliceUpDownLeft",
- "fold",
- "fade");
- vars.randAnim = anims[Math.floor(Math.random() * (anims.length + 1))];
- if (vars.randAnim == undefined) {
- vars.randAnim = 'fade'
- }
- }
- vars.running = true;
- if (settings.effect == 'sliceDown' || settings.effect == 'sliceDownRight' || vars.randAnim == 'sliceDownRight' || settings.effect
- == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft') {
- var timeBuff = 0;
- var i = 0;
- var slices = $('.nivo-slice', slider);
- if (settings.effect == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft') {
- slices = $('.nivo-slice', slider).reverse();
- }
- slices.each(function () {
- var slice = $(this);
- slice.css('top', '0px');
- if (i == settings.slices - 1) {
- setTimeout(function () {
- slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed, '', function () {
- slider.trigger('nivo:animFinished')
- })
- }, (100 + timeBuff))
- }
- else {
- setTimeout(function () {
- slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed)
- }, (100 + timeBuff))
- }
- timeBuff += 50;
- i++
- })
- }
- else if (settings.effect == 'sliceUp' || settings.effect == 'sliceUpRight' || vars.randAnim == 'sliceUpRight' || settings.effect
- == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft') {
- var timeBuff = 0;
- var i = 0;
- var slices = $('.nivo-slice', slider);
- if (settings.effect == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft') {
- slices = $('.nivo-slice', slider).reverse();
- }
- slices.each(function () {
- var slice = $(this);
- slice.css('bottom', '0px');
- if (i == settings.slices - 1) {
- setTimeout(function () {
- slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed, '', function () {
- slider.trigger('nivo:animFinished')
- })
- }, (100 + timeBuff))
- }
- else {
- setTimeout(function () {
- slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed)
- }, (100 + timeBuff))
- }
- timeBuff += 50;
- i++
- })
- }
- else if (settings.effect == 'sliceUpDown' || settings.effect == 'sliceUpDownRight' || vars.randAnim == 'sliceUpDown' || settings.effect
- == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft') {
- var timeBuff = 0;
- var i = 0;
- var v = 0;
- var slices = $('.nivo-slice', slider);
- if (settings.effect == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft') {
- slices = $('.nivo-slice', slider).reverse();
- }
- slices.each(function () {
- var slice = $(this);
- if (i == 0) {
- slice.css('top', '0px');
- i++
- }
- else {
- slice.css('bottom', '0px');
- i = 0
- }
- if (v == settings.slices - 1) {
- setTimeout(function () {
- slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed, '', function () {
- slider.trigger('nivo:animFinished')
- })
- }, (100 + timeBuff))
- }
- else {
- setTimeout(function () {
- slice.animate({height: '100%', opacity: '1.0'}, settings.animSpeed)
- }, (100 + timeBuff))
- }
- timeBuff += 50;
- v++
- })
- }
- else if (settings.effect == 'fold' || vars.randAnim == 'fold') {
- var timeBuff = 0;
- var i = 0;
- $('.nivo-slice', slider).each(function () {
- var slice = $(this);
- var origWidth = slice.width();
- slice.css({top: '0px', height: '100%', width: '0px'});
- if (i == settings.slices - 1) {
- setTimeout(function () {
- slice.animate({width: origWidth, opacity: '1.0'}, settings.animSpeed, '', function () {
- slider.trigger('nivo:animFinished')
- })
- }, (100 + timeBuff))
- }
- else {
- setTimeout(function () {
- slice.animate({width: origWidth, opacity: '1.0'}, settings.animSpeed)
- }, (100 + timeBuff))
- }
- timeBuff += 50;
- i++
- })
- }
- else if (settings.effect == 'fade' || vars.randAnim == 'fade') {
- var i = 0;
- $('.nivo-slice', slider).each(function () {
- $(this).css('height', '100%');
- if (i == settings.slices - 1) {
- $(this).animate({opacity: '1.0'}, (settings.animSpeed * 2), '', function () {
- slider.trigger('nivo:animFinished')
- })
- }
- else {
- $(this).animate({opacity: '1.0'}, (settings.animSpeed * 2))
- }
- i++
- })
- }
- }
- };
- $.fn.nivoSlider.defaults =
- {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 () {
- }, afterChange: function () {
- }, slideshowEnd: function () {
- }};
- $.fn.reverse = [].reverse
- })(jQuery);
- ;
- /*!
- * jQuery Tools v1.2.7 - The missing UI library for the Web
- *
- * overlay/overlay.js
- * toolbox/toolbox.expose.js
- *
- * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
- *
- * http://flowplayer.org/tools/
- *
- */
- (function (a) {
- a.tools = a.tools || {version: "v1.2.7"}, a.tools.overlay = {addEffect: function (a, b, d) {
- c[a] = [b, d]
- }, conf: {close: null, closeOnClick: !0, closeOnEsc: !0, closeSpeed: "fast", effect: "default", fixed: !a.browser.msie || a.browser.version
- > 6, left: "center", load: !1, mask: null, oneInstance: !0, speed: "normal", target: null, top: "10%"}};
- var b = [], c = {};
- a.tools.overlay.addEffect("default", function (b, c) {
- var d = this.getConf(), e = a(window);
- d.fixed || (b.top += e.scrollTop(), b.left += e.scrollLeft()), b.position =
- d.fixed ? "fixed" : "absolute", this.getOverlay().css(b).fadeIn(d.speed, c)
- }, function (a) {
- this.getOverlay().fadeOut(this.getConf().closeSpeed, a)
- });
- function d(d, e) {
- 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);
- l && (typeof l == "string" && (l = {color: l}), l.closeOnClick = l.closeOnEsc = !1);
- var n = e.target || d.attr("rel");
- j = n ? a(n) : null || d;
- if (!j.length) {
- throw"Could not find Overlay: " + n;
- }
- d && d.index(j) == -1 && d.click(function (a) {
- f.load(a);
- return a.preventDefault()
- }), a.extend(f, {load: function (d) {
- if (f.isOpened()) {
- return f;
- }
- var i = c[e.effect];
- if (!i) {
- throw"Overlay: cannot find effect : \"" + e.effect + "\"";
- }
- e.oneInstance && a.each(b, function () {
- this.close(d)
- }), d = d || a.Event(), d.type = "onBeforeLoad", g.trigger(d);
- if (d.isDefaultPrevented()) {
- return f;
- }
- k = !0, l && a(j).expose(l);
- var n = e.top, o = e.left, p = j.outerWidth({margin: !0}), q = j.outerHeight({margin: !0});
- typeof n == "string" && (n = n == "center" ? Math.max((h.height() - q) / 2, 0) : parseInt(n, 10) / 100 * h.height()), o == "center"
- && (o = Math.max((h.width() - p) / 2, 0)), i[0].call(f, {top: n, left: o}, function () {
- k && (d.type = "onLoad", g.trigger(d))
- }), l && e.closeOnClick && a.mask.getMask().one("click", f.close), e.closeOnClick && a(document).on("click." + m, function (b) {
- a(b.target).parents(j).length || f.close(b)
- }), e.closeOnEsc && a(document).on("keydown." + m, function (a) {
- a.keyCode == 27 && f.close(a)
- });
- return f
- }, close: function (b) {
- if (!f.isOpened()) {
- return f;
- }
- b = b || a.Event(), b.type = "onBeforeClose", g.trigger(b);
- if (!b.isDefaultPrevented()) {
- k = !1, c[e.effect][1].call(f, function () {
- b.type = "onClose", g.trigger(b)
- }), a(document).off("click." + m + " keydown." + m), l && a.mask.close();
- return f
- }
- }, getOverlay: function () {
- return j
- }, getTrigger: function () {
- return d
- }, getClosers: function () {
- return i
- }, isOpened: function () {
- return k
- }, getConf: function () {
- return e
- }}), a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","), function (b, c) {
- a.isFunction(e[c]) && a(f).on(c, e[c]), f[c] = function (b) {
- b && a(f).on(c, b);
- return f
- }
- }), i = j.find(e.close || ".close"), !i.length && !e.close && (i = a("<a class=\"close\"></a>"), j.prepend(i)), i.click(function (a) {
- f.close(a)
- }), e.load && f.load()
- }
- a.fn.overlay = function (c) {
- var e = this.data("overlay");
- if (e) {
- return e;
- }
- a.isFunction(c) && (c = {onBeforeLoad: c}), c = a.extend(!0, {}, a.tools.overlay.conf, c), this.each(function () {
- e = new d(a(this), c), b.push(e), a(this).data("overlay", e)
- });
- return c.api ? e : this
- }
- })(jQuery);
- (function (a) {
- a.tools = a.tools || {version: "v1.2.7"};
- var b;
- b =
- a.tools.expose =
- {conf: {maskId: "exposeMask", loadSpeed: "slow", closeSpeed: "fast", closeOnClick: !0, closeOnEsc: !0, zIndex: 9998, opacity: .8, startOpacity: 0, color: "#fff", onLoad: null, onClose: null}};
- function c() {
- if (a.browser.msie) {
- var b = a(document).height(), c = a(window).height();
- return[window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, b - c < 20 ? c : b]
- }
- return[a(document).width(), a(document).height()]
- }
- function d(b) {
- if (b) {
- return b.call(a.mask)
- }
- }
- var e, f, g, h, i;
- a.mask = {load: function (j, k) {
- if (g) {
- return this;
- }
- 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 =
- a("<div/>").attr("id", j.maskId), a("body").append(e));
- var l = c();
- e.css({position: "absolute", top: 0, left: 0, width: l[0], height: l[1], display: "none", opacity: j.startOpacity, zIndex: j.zIndex}), j.color
- && e.css("backgroundColor", j.color);
- if (d(j.onBeforeLoad) === !1) {
- return this;
- }
- j.closeOnEsc && a(document).on("keydown.mask", function (b) {
- b.keyCode == 27 && a.mask.close(b)
- }), j.closeOnClick && e.on("click.mask", function (b) {
- a.mask.close(b)
- }), a(window).on("resize.mask", function () {
- a.mask.fit()
- }), k && k.length && (i = k.eq(0).css("zIndex"), a.each(k, function () {
- var b = a(this);
- /relative|absolute|fixed/i.test(b.css("position")) || b.css("position", "relative")
- }), f = k.css({zIndex: Math.max(j.zIndex + 1, i == "auto" ? 0 : i)})), e.css({display: "block"}).fadeTo(j.loadSpeed, j.opacity, function () {
- a.mask.fit(), d(j.onLoad), g = "full"
- }), g = !0;
- return this
- }, close: function () {
- if (g) {
- if (d(h.onBeforeClose) === !1) {
- return this;
- }
- e.fadeOut(h.closeSpeed, function () {
- d(h.onClose), f && f.css({zIndex: i}), g = !1
- }), a(document).off("keydown.mask"), e.off("click.mask"), a(window).off("resize.mask")
- }
- return this
- }, fit: function () {
- if (g) {
- var a = c();
- e.css({width: a[0], height: a[1]})
- }
- }, getMask: function () {
- return e
- }, isLoaded: function (a) {
- return a ? g == "full" : g
- }, getConf: function () {
- return h
- }, getExposed: function () {
- return f
- }}, a.fn.mask = function (b) {
- a.mask.load(b);
- return this
- }, a.fn.expose = function (b) {
- a.mask.load(b, this);
- return this
- }
- })(jQuery);
- ;
- (function ($) {
- $(document).on('click', '.OVERLAYBOX', function (e) {
- if (!$('#overlayBox').length) {
- $('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>');
- }
- e.preventDefault();
- var OK = true;
- window.$overlay =
- $(this).overlay({target: '#overlayBox', api: true, load: true, fixed: false, mask: {color: '#000', opacity: 0.6, loadSpeed: 0, closeSpeed: 0, }, onClose: function () {
- $thisOverlay = this.getOverlay();
- $thisOverlay.removeClass('smallOverlay bigOverlay');
- }, onBeforeLoad: function () {
- $thisOverlay = this.getOverlay();
- var url = this.getTrigger().attr('href');
- if (this.getTrigger().hasClass('SMALL')) {
- $thisOverlay.addClass("smallOverlay");
- }
- if (this.getTrigger().hasClass('BIG')) {
- $thisOverlay.addClass("bigOverlay");
- }
- if (this.getTrigger().hasClass('OPENNEWWINDOW')) {
- $thisOverlay.find('.headline').after('<a class="opennewwindow" href="' + url
- + '" target="_blank"><span><strong>-></strong></span></a>');
- }
- var $container = $($thisOverlay.find(".contentWrap"));
- $container.html("").addClass('indicator');
- $thisOverlay.find('.headline').text(this.getTrigger().text());
- var selector = url.match(/\#[^\?\#]+/i);
- if (selector == null) {
- selector = "#contentkernel";
- }
- else {
- selector = selector[0];
- }
- $.log(selector);
- var baseURL = "/";
- var rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
- $.ajax({url: url, type: 'GET', dataType: "html", cache: false, complete: function (jqXHR, status, responseText) {
- if (status != "success") {
- $.log('AJAX failed: ' + status);
- $.getlocations(url);
- return false;
- }
- responseText = jqXHR.responseText;
- if (jqXHR.done()) {
- jqXHR.done(function (r) {
- responseText = r;
- });
- responseText = responseText.replace(rscript, "");
- window.$extract = $();
- window.$response = $();
- try {
- var xmlResponse = $.parseXML(responseText);
- $response = $(xmlResponse);
- }
- catch (e) {
- $.log('overlay:XML')
- $.log(e);
- }
- finally {
- ;
- }
- if (!$response.length) {
- $response = jQuery("<div>").append(responseText);
- }
- $extract = $(selector, $response);
- if (!$extract.length) {
- $extract = $response;
- }
- $extract = $('<div id="' + selector.replace(/\#/i, '') + '" />').append($extract.html());
- $extract.hide();
- if (!$extract.children().length) {
- $response = jQuery("<div>").append(responseText);
- $extract = $(selector, $response);
- $extract = $('<div id="' + selector.replace(/\#/i, '') + '" />').append($extract.html());
- $extract.hide();
- }
- if (!$extract.children().length) {
- OK = false;
- }
- try {
- ___b24.tracking.page(url)
- $container.html('').removeClass('indicator').append($extract.show()).show();
- }
- catch (e) {
- OK = false;
- $.log('overlay:INPUT')
- $.log(e);
- }
- if (!OK) {
- $.getlocations(url);
- }
- }
- }});
- }});
- });
- $(document).on('click', '.IMAGE_OVERLAYBOX', function (e) {
- if (!$('#overlayBox').length) {
- $('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>');
- }
- e.preventDefault();
- window.$overlay =
- $(this).overlay({target: '#overlayBox', avpi: true, load: true, fixed: false, mask: {color: '#000', opacity: 0.6, loadSpeed: 0, closeSpeed: 0, }, onClose: function () {
- $thisOverlay = this.getOverlay();
- $thisOverlay.removeClass('IMAGE');
- }, onBeforeLoad: function () {
- $thisOverlay = this.getOverlay();
- $thisOverlay.addClass("IMAGE");
- var url = this.getTrigger().attr('href');
- var $container = $($thisOverlay.find(".contentWrap"));
- $container.html("").addClass('indicator');
- $thisOverlay.find('.headline').text(this.getTrigger().find('img').attr('alt'));
- $container.html('<div class="overlay_image"><img src="' + url + '" id="overlayImage" /></div>').removeClass('indicator');
- }});
- });
- })(jQuery);
- ;
- var Swiper = function (selector, params) {
- if (document.body.__defineGetter__) {
- if (HTMLElement) {
- var element = HTMLElement.prototype;
- if (element.__defineGetter__) {
- element.__defineGetter__("outerHTML", function () {
- return new XMLSerializer().serializeToString(this);
- });
- }
- }
- }
- if (!window.getComputedStyle) {
- window.getComputedStyle = function (el, pseudo) {
- this.el = el;
- this.getPropertyValue = function (prop) {
- var re = /(\-([a-z]){1})/g;
- if (prop === 'float') {
- prop = 'styleFloat';
- }
- if (re.test(prop)) {
- prop = prop.replace(re, function () {
- return arguments[2].toUpperCase();
- });
- }
- return el.currentStyle[prop] ? el.currentStyle[prop] : null;
- }
- return this;
- }
- }
- if (!Array.prototype.indexOf) {
- Array.prototype.indexOf = function (obj, start) {
- for (var i = (start || 0), j = this.length; i < j; i++) {
- if (this[i] === obj) {
- return i;
- }
- }
- return-1;
- }
- }
- if (!document.querySelectorAll) {
- if (!window.jQuery) {
- return;
- }
- }
- function $$(selector, context) {
- if (document.querySelectorAll) {
- return(context || document).querySelectorAll(selector);
- }
- else {
- return jQuery(selector, context);
- }
- }
- if (typeof selector === 'undefined') {
- return;
- }
- if (!(selector.nodeType)) {
- if ($$(selector).length === 0) {
- return;
- }
- }
- var _this = this;
- _this.touches = {start: 0, startX: 0, startY: 0, current: 0, currentX: 0, currentY: 0, diff: 0, abs: 0};
- _this.positions = {start: 0, abs: 0, diff: 0, current: 0};
- _this.times = {start: 0, end: 0};
- _this.id = (new Date()).getTime();
- _this.container = (selector.nodeType) ? selector : $$(selector)[0];
- _this.isTouched = false;
- _this.isMoved = false;
- _this.activeIndex = 0;
- _this.activeLoaderIndex = 0;
- _this.activeLoopIndex = 0;
- _this.previousIndex = null;
- _this.velocity = 0;
- _this.snapGrid = [];
- _this.slidesGrid = [];
- _this.imagesToLoad = [];
- _this.imagesLoaded = 0;
- _this.wrapperLeft = 0;
- _this.wrapperRight = 0;
- _this.wrapperTop = 0;
- _this.wrapperBottom = 0;
- var wrapper, slideSize, wrapperSize, direction, isScrolling, containerSize;
- 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'}
- params = params || {};
- for (var prop in defaults) {
- if (prop in params && typeof params[prop] === 'object') {
- for (var subProp in defaults[prop]) {
- if (!(subProp in params[prop])) {
- params[prop][subProp] = defaults[prop][subProp];
- }
- }
- }
- else if (!(prop in params)) {
- params[prop] = defaults[prop]
- }
- }
- _this.params = params;
- if (params.scrollContainer) {
- params.freeMode = true;
- params.freeModeFluid = true;
- }
- if (params.loop) {
- params.resistance = '100%';
- }
- var isH = params.mode === 'horizontal';
- _this.touchEvents =
- {touchStart: _this.support.touch || !params.simulateTouch ? 'touchstart' :
- (_this.browser.ie10 ? 'MSPointerDown' : 'mousedown'), touchMove: _this.support.touch || !params.simulateTouch ? 'touchmove' :
- (_this.browser.ie10 ? 'MSPointerMove' : 'mousemove'), touchEnd: _this.support.touch || !params.simulateTouch ? 'touchend' :
- (_this.browser.ie10 ? 'MSPointerUp' : 'mouseup')};
- for (var i = _this.container.childNodes.length - 1; i >= 0; i--) {
- if (_this.container.childNodes[i].className) {
- var _wrapperClasses = _this.container.childNodes[i].className.split(' ')
- for (var j = 0; j < _wrapperClasses.length; j++) {
- if (_wrapperClasses[j] === params.wrapperClass) {
- wrapper = _this.container.childNodes[i];
- }
- }
- ;
- }
- }
- ;
- _this.wrapper = wrapper;
- _this._extendSwiperSlide = function (el) {
- el.append = function () {
- if (params.loop) {
- el.insertAfter(_this.slides.length - _this.loopedSlides);
- _this.removeLoopedSlides();
- _this.calcSlides();
- _this.createLoop();
- }
- else {
- _this.wrapper.appendChild(el);
- }
- _this.reInit();
- return el;
- }
- el.prepend = function () {
- if (params.loop) {
- _this.wrapper.insertBefore(el, _this.slides[_this.loopedSlides]);
- _this.removeLoopedSlides();
- _this.calcSlides();
- _this.createLoop();
- }
- else {
- _this.wrapper.insertBefore(el, _this.wrapper.firstChild);
- }
- _this.reInit();
- return el;
- }
- el.insertAfter = function (index) {
- if (typeof index === 'undefined') {
- return false;
- }
- var beforeSlide;
- if (params.loop) {
- beforeSlide = _this.slides[index + 1 + _this.loopedSlides];
- _this.wrapper.insertBefore(el, beforeSlide);
- _this.removeLoopedSlides();
- _this.calcSlides();
- _this.createLoop();
- }
- else {
- beforeSlide = _this.slides[index + 1];
- _this.wrapper.insertBefore(el, beforeSlide)
- }
- _this.reInit();
- return el;
- }
- el.clone = function () {
- return _this._extendSwiperSlide(el.cloneNode(true))
- }
- el.remove = function () {
- _this.wrapper.removeChild(el);
- _this.reInit();
- }
- el.html = function (html) {
- if (typeof html === 'undefined') {
- return el.innerHTML;
- }
- else {
- el.innerHTML = html;
- return el;
- }
- }
- el.index = function () {
- var index;
- for (var i = _this.slides.length - 1; i >= 0; i--) {
- if (el === _this.slides[i]) {
- index = i;
- }
- }
- return index;
- }
- el.isActive = function () {
- if (el.index() === _this.activeIndex) {
- return true;
- }
- else {
- return false;
- }
- }
- if (!el.swiperSlideDataStorage) {
- el.swiperSlideDataStorage = {};
- }
- el.getData = function (name) {
- return el.swiperSlideDataStorage[name];
- }
- el.setData = function (name, value) {
- el.swiperSlideDataStorage[name] = value;
- return el;
- }
- el.data = function (name, value) {
- if (!value) {
- return el.getAttribute('data-' + name);
- }
- else {
- el.setAttribute('data-' + name, value);
- return el;
- }
- }
- el.getWidth = function (outer) {
- return _this.h.getWidth(el, outer);
- }
- el.getHeight = function (outer) {
- return _this.h.getHeight(el, outer);
- }
- el.getOffset = function () {
- return _this.h.getOffset(el);
- }
- return el;
- }
- _this.calcSlides = function (forceCalcSlides) {
- var oldNumber = _this.slides ? _this.slides.length : false;
- _this.slides = [];
- _this.displaySlides = [];
- for (var i = 0; i < _this.wrapper.childNodes.length; i++) {
- if (_this.wrapper.childNodes[i].className) {
- var _className = _this.wrapper.childNodes[i].className;
- var _slideClasses = _className.split(' ');
- for (var j = 0; j < _slideClasses.length; j++) {
- if (_slideClasses[j] === params.slideClass) {
- _this.slides.push(_this.wrapper.childNodes[i]);
- }
- }
- }
- }
- for (i = _this.slides.length - 1; i >= 0; i--) {
- _this._extendSwiperSlide(_this.slides[i]);
- }
- if (!oldNumber) {
- return;
- }
- if (oldNumber !== _this.slides.length || forceCalcSlides) {
- removeSlideEvents();
- addSlideEvents();
- _this.updateActiveSlide();
- if (params.createPagination && _this.params.pagination) {
- _this.createPagination();
- }
- _this.callPlugins('numberOfSlidesChanged');
- }
- }
- _this.createSlide = function (html, slideClassList, el) {
- var slideClassList = slideClassList || _this.params.slideClass;
- var el = el || params.slideElement;
- var newSlide = document.createElement(el);
- newSlide.innerHTML = html || '';
- newSlide.className = slideClassList;
- return _this._extendSwiperSlide(newSlide);
- }
- _this.appendSlide = function (html, slideClassList, el) {
- if (!html) {
- return;
- }
- if (html.nodeType) {
- return _this._extendSwiperSlide(html).append()
- }
- else {
- return _this.createSlide(html, slideClassList, el).append()
- }
- }
- _this.prependSlide = function (html, slideClassList, el) {
- if (!html) {
- return;
- }
- if (html.nodeType) {
- return _this._extendSwiperSlide(html).prepend()
- }
- else {
- return _this.createSlide(html, slideClassList, el).prepend()
- }
- }
- _this.insertSlideAfter = function (index, html, slideClassList, el) {
- if (typeof index === 'undefined') {
- return false;
- }
- if (html.nodeType) {
- return _this._extendSwiperSlide(html).insertAfter(index);
- }
- else {
- return _this.createSlide(html, slideClassList, el).insertAfter(index);
- }
- }
- _this.removeSlide = function (index) {
- if (_this.slides[index]) {
- if (params.loop) {
- if (!_this.slides[index + _this.loopedSlides]) {
- return false;
- }
- _this.slides[index + _this.loopedSlides].remove();
- _this.removeLoopedSlides();
- _this.calcSlides();
- _this.createLoop();
- }
- else {
- _this.slides[index].remove();
- }
- return true;
- }
- else {
- return false;
- }
- }
- _this.removeLastSlide = function () {
- if (_this.slides.length > 0) {
- if (params.loop) {
- _this.slides[_this.slides.length - 1 - _this.loopedSlides].remove();
- _this.removeLoopedSlides();
- _this.calcSlides();
- _this.createLoop();
- }
- else {
- _this.slides[(_this.slides.length - 1)].remove();
- }
- return true;
- }
- else {
- return false;
- }
- }
- _this.removeAllSlides = function () {
- for (var i = _this.slides.length - 1; i >= 0; i--) {
- _this.slides[i].remove()
- }
- }
- _this.getSlide = function (index) {
- return _this.slides[index]
- }
- _this.getLastSlide = function () {
- return _this.slides[_this.slides.length - 1]
- }
- _this.getFirstSlide = function () {
- return _this.slides[0]
- }
- _this.activeSlide = function () {
- return _this.slides[_this.activeIndex]
- }
- var _plugins = [];
- for (var plugin in _this.plugins) {
- if (params[plugin]) {
- var p = _this.plugins[plugin](_this, params[plugin]);
- if (p) {
- _plugins.push(p);
- }
- }
- }
- _this.callPlugins = function (method, args) {
- if (!args) {
- args = {}
- }
- for (var i = 0; i < _plugins.length; i++) {
- if (method in _plugins[i]) {
- _plugins[i][method](args);
- }
- }
- }
- if (_this.browser.ie10 && !params.onlyExternal) {
- _this.wrapper.classList.add('swiper-wp8-' + (isH ? 'horizontal' : 'vertical'));
- }
- if (params.freeMode) {
- _this.container.className += ' swiper-free-mode';
- }
- _this.initialized = false;
- _this.init = function (force, forceCalcSlides) {
- var _width = _this.h.getWidth(_this.container);
- var _height = _this.h.getHeight(_this.container);
- if (_width === _this.width && _height === _this.height && !force) {
- return;
- }
- _this.width = _width;
- _this.height = _height;
- containerSize = isH ? _width : _height;
- var wrapper = _this.wrapper;
- if (force) {
- _this.calcSlides(forceCalcSlides);
- }
- if (params.slidesPerView === 'auto') {
- var slidesWidth = 0;
- var slidesHeight = 0;
- if (params.slidesOffset > 0) {
- wrapper.style.paddingLeft = '';
- wrapper.style.paddingRight = '';
- wrapper.style.paddingTop = '';
- wrapper.style.paddingBottom = '';
- }
- wrapper.style.width = '';
- wrapper.style.height = '';
- if (params.offsetPxBefore > 0) {
- if (isH) {
- _this.wrapperLeft = params.offsetPxBefore;
- }
- else {
- _this.wrapperTop = params.offsetPxBefore;
- }
- }
- if (params.offsetPxAfter > 0) {
- if (isH) {
- _this.wrapperRight = params.offsetPxAfter;
- }
- else {
- _this.wrapperBottom = params.offsetPxAfter;
- }
- }
- if (params.centeredSlides) {
- if (isH) {
- _this.wrapperLeft = (containerSize - this.slides[0].getWidth(true)) / 2;
- _this.wrapperRight = (containerSize - _this.slides[_this.slides.length - 1].getWidth(true)) / 2;
- }
- else {
- _this.wrapperTop = (containerSize - _this.slides[0].getHeight(true)) / 2;
- _this.wrapperBottom = (containerSize - _this.slides[_this.slides.length - 1].getHeight(true)) / 2;
- }
- }
- if (isH) {
- if (_this.wrapperLeft >= 0) {
- wrapper.style.paddingLeft = _this.wrapperLeft + 'px';
- }
- if (_this.wrapperRight >= 0) {
- wrapper.style.paddingRight = _this.wrapperRight + 'px';
- }
- }
- else {
- if (_this.wrapperTop >= 0) {
- wrapper.style.paddingTop = _this.wrapperTop + 'px';
- }
- if (_this.wrapperBottom >= 0) {
- wrapper.style.paddingBottom = _this.wrapperBottom + 'px';
- }
- }
- var slideLeft = 0;
- var centeredSlideLeft = 0;
- _this.snapGrid = [];
- _this.slidesGrid = [];
- var slideMaxHeight = 0;
- for (var i = 0; i < _this.slides.length; i++) {
- var slideWidth = _this.slides[i].getWidth(true);
- var slideHeight = _this.slides[i].getHeight(true);
- if (params.calculateHeight) {
- slideMaxHeight = Math.max(slideMaxHeight, slideHeight)
- }
- var _slideSize = isH ? slideWidth : slideHeight;
- if (params.centeredSlides) {
- var nextSlideWidth = i === _this.slides.length - 1 ? 0 : _this.slides[i + 1].getWidth(true);
- var nextSlideHeight = i === _this.slides.length - 1 ? 0 : _this.slides[i + 1].getHeight(true);
- var nextSlideSize = isH ? nextSlideWidth : nextSlideHeight;
- if (_slideSize > containerSize) {
- for (var j = 0; j <= Math.floor(_slideSize / (containerSize + _this.wrapperLeft)); j++) {
- if (j === 0) {
- _this.snapGrid.push(slideLeft + _this.wrapperLeft);
- }
- else {
- _this.snapGrid.push(slideLeft + _this.wrapperLeft + containerSize * j);
- }
- }
- _this.slidesGrid.push(slideLeft + _this.wrapperLeft);
- }
- else {
- _this.snapGrid.push(centeredSlideLeft);
- _this.slidesGrid.push(centeredSlideLeft);
- }
- centeredSlideLeft += _slideSize / 2 + nextSlideSize / 2;
- }
- else {
- if (_slideSize > containerSize) {
- for (var j = 0; j <= Math.floor(_slideSize / containerSize); j++) {
- _this.snapGrid.push(slideLeft + containerSize * j);
- }
- }
- else {
- _this.snapGrid.push(slideLeft);
- }
- _this.slidesGrid.push(slideLeft);
- }
- slideLeft += _slideSize;
- slidesWidth += slideWidth;
- slidesHeight += slideHeight;
- }
- if (params.calculateHeight) {
- _this.height = slideMaxHeight;
- }
- if (isH) {
- wrapperSize = slidesWidth + _this.wrapperRight + _this.wrapperLeft;
- wrapper.style.width = (slidesWidth) + 'px';
- wrapper.style.height = (_this.height) + 'px';
- }
- else {
- wrapperSize = slidesHeight + _this.wrapperTop + _this.wrapperBottom;
- wrapper.style.width = (_this.width) + 'px';
- wrapper.style.height = (slidesHeight) + 'px';
- }
- }
- else if (params.scrollContainer) {
- wrapper.style.width = '';
- wrapper.style.height = '';
- var wrapperWidth = _this.slides[0].getWidth(true);
- var wrapperHeight = _this.slides[0].getHeight(true);
- wrapperSize = isH ? wrapperWidth : wrapperHeight;
- wrapper.style.width = wrapperWidth + 'px';
- wrapper.style.height = wrapperHeight + 'px';
- slideSize = isH ? wrapperWidth : wrapperHeight;
- }
- else {
- if (params.calculateHeight) {
- var slideMaxHeight = 0;
- var wrapperHeight = 0;
- if (!isH) {
- _this.container.style.height = '';
- }
- wrapper.style.height = '';
- for (var i = 0; i < _this.slides.length; i++) {
- _this.slides[i].style.height = '';
- slideMaxHeight = Math.max(_this.slides[i].getHeight(true), slideMaxHeight);
- if (!isH) {
- wrapperHeight += _this.slides[i].getHeight(true);
- }
- }
- var slideHeight = slideMaxHeight;
- _this.height = slideHeight;
- if (isH) {
- wrapperHeight = slideHeight;
- }
- else {
- containerSize = slideHeight, _this.container.style.height = containerSize + 'px';
- }
- }
- else {
- var slideHeight = isH ? _this.height : _this.height / params.slidesPerView;
- var wrapperHeight = isH ? _this.height : _this.slides.length * slideHeight;
- }
- var slideWidth = isH ? _this.width / params.slidesPerView : _this.width;
- var wrapperWidth = isH ? _this.slides.length * slideWidth : _this.width;
- slideSize = isH ? slideWidth : slideHeight;
- if (params.offsetSlidesBefore > 0) {
- if (isH) {
- _this.wrapperLeft = slideSize * params.offsetSlidesBefore;
- }
- else {
- _this.wrapperTop = slideSize * params.offsetSlidesBefore;
- }
- }
- if (params.offsetSlidesAfter > 0) {
- if (isH) {
- _this.wrapperRight = slideSize * params.offsetSlidesAfter;
- }
- else {
- _this.wrapperBottom = slideSize * params.offsetSlidesAfter;
- }
- }
- if (params.offsetPxBefore > 0) {
- if (isH) {
- _this.wrapperLeft = params.offsetPxBefore;
- }
- else {
- _this.wrapperTop = params.offsetPxBefore;
- }
- }
- if (params.offsetPxAfter > 0) {
- if (isH) {
- _this.wrapperRight = params.offsetPxAfter;
- }
- else {
- _this.wrapperBottom = params.offsetPxAfter;
- }
- }
- if (params.centeredSlides) {
- if (isH) {
- _this.wrapperLeft = (containerSize - slideSize) / 2;
- _this.wrapperRight = (containerSize - slideSize) / 2;
- }
- else {
- _this.wrapperTop = (containerSize - slideSize) / 2;
- _this.wrapperBottom = (containerSize - slideSize) / 2;
- }
- }
- if (isH) {
- if (_this.wrapperLeft > 0) {
- wrapper.style.paddingLeft = _this.wrapperLeft + 'px';
- }
- if (_this.wrapperRight > 0) {
- wrapper.style.paddingRight = _this.wrapperRight + 'px';
- }
- }
- else {
- if (_this.wrapperTop > 0) {
- wrapper.style.paddingTop = _this.wrapperTop + 'px';
- }
- if (_this.wrapperBottom > 0) {
- wrapper.style.paddingBottom = _this.wrapperBottom + 'px';
- }
- }
- wrapperSize = isH ? wrapperWidth + _this.wrapperRight + _this.wrapperLeft : wrapperHeight + _this.wrapperTop + _this.wrapperBottom;
- wrapper.style.width = wrapperWidth + 'px';
- wrapper.style.height = wrapperHeight + 'px';
- var slideLeft = 0;
- _this.snapGrid = [];
- _this.slidesGrid = [];
- for (var i = 0; i < _this.slides.length; i++) {
- _this.snapGrid.push(slideLeft);
- _this.slidesGrid.push(slideLeft);
- slideLeft += slideSize;
- _this.slides[i].style.width = slideWidth + 'px';
- _this.slides[i].style.height = slideHeight + 'px';
- }
- }
- if (!_this.initialized) {
- _this.callPlugins('onFirstInit');
- if (params.onFirstInit) {
- params.onFirstInit(_this);
- }
- }
- else {
- _this.callPlugins('onInit');
- if (params.onInit) {
- params.onInit(_this);
- }
- }
- _this.initialized = true;
- }
- _this.reInit = function (forceCalcSlides) {
- _this.init(true, forceCalcSlides);
- }
- _this.resizeFix = function (reInit) {
- _this.callPlugins('beforeResizeFix');
- _this.init(params.resizeReInit || reInit);
- if (!params.freeMode) {
- _this.swipeTo((params.loop ? _this.activeLoopIndex : _this.activeIndex), 0, false);
- }
- else if (_this.getWrapperTranslate() < -maxWrapperPosition()) {
- _this.setWrapperTransition(0);
- _this.setWrapperTranslate(-maxWrapperPosition());
- }
- _this.callPlugins('afterResizeFix');
- }
- function maxWrapperPosition() {
- var a = (wrapperSize - containerSize);
- if (params.freeMode) {
- a = wrapperSize - containerSize;
- }
- if (params.slidesPerView > _this.slides.length) {
- a = 0;
- }
- if (a < 0) {
- a = 0;
- }
- return a;
- }
- function minWrapperPosition() {
- var a = 0;
- return a;
- }
- function initEvents() {
- var bind = _this.h.addEventListener;
- if (!_this.browser.ie10) {
- if (_this.support.touch) {
- bind(_this.wrapper, 'touchstart', onTouchStart);
- bind(_this.wrapper, 'touchmove', onTouchMove);
- bind(_this.wrapper, 'touchend', onTouchEnd);
- }
- if (params.simulateTouch) {
- bind(_this.wrapper, 'mousedown', onTouchStart);
- bind(document, 'mousemove', onTouchMove);
- bind(document, 'mouseup', onTouchEnd);
- }
- }
- else {
- bind(_this.wrapper, _this.touchEvents.touchStart, onTouchStart);
- bind(document, _this.touchEvents.touchMove, onTouchMove);
- bind(document, _this.touchEvents.touchEnd, onTouchEnd);
- }
- if (params.autoResize) {
- bind(window, 'resize', _this.resizeFix);
- }
- addSlideEvents();
- _this._wheelEvent = false;
- if (params.mousewheelControl) {
- if (document.onmousewheel !== undefined) {
- _this._wheelEvent = "mousewheel";
- }
- try {
- WheelEvent("wheel");
- _this._wheelEvent = "wheel";
- }
- catch (e) {
- }
- if (!_this._wheelEvent) {
- _this._wheelEvent = "DOMMouseScroll";
- }
- if (_this._wheelEvent) {
- bind(_this.container, _this._wheelEvent, handleMousewheel);
- }
- }
- if (params.keyboardControl) {
- bind(document, 'keydown', handleKeyboardKeys);
- }
- if (params.updateOnImagesReady) {
- _this.imagesToLoad = $$('img', _this.container);
- for (var i = 0; i < _this.imagesToLoad.length; i++) {
- _loadImage(_this.imagesToLoad[i].getAttribute('src'))
- }
- }
- function _loadImage(src) {
- var image = new Image();
- image.onload = function () {
- _this.imagesLoaded++;
- if (_this.imagesLoaded == _this.imagesToLoad.length) {
- _this.reInit();
- if (params.onImagesReady) {
- params.onImagesReady(_this);
- }
- }
- }
- image.src = src;
- }
- }
- _this.destroy = function (removeResizeFix) {
- var unbind = _this.h.removeEventListener;
- if (!_this.browser.ie10) {
- if (_this.support.touch) {
- unbind(_this.wrapper, 'touchstart', onTouchStart);
- unbind(_this.wrapper, 'touchmove', onTouchMove);
- unbind(_this.wrapper, 'touchend', onTouchEnd);
- }
- if (params.simulateTouch) {
- unbind(_this.wrapper, 'mousedown', onTouchStart);
- unbind(document, 'mousemove', onTouchMove);
- unbind(document, 'mouseup', onTouchEnd);
- }
- }
- else {
- unbind(_this.wrapper, _this.touchEvents.touchStart, onTouchStart);
- unbind(document, _this.touchEvents.touchMove, onTouchMove);
- unbind(document, _this.touchEvents.touchEnd, onTouchEnd);
- }
- if (params.autoResize) {
- unbind(window, 'resize', _this.resizeFix);
- }
- removeSlideEvents();
- if (params.paginationClickable) {
- removePaginationEvents();
- }
- if (params.mousewheelControl && _this._wheelEvent) {
- unbind(_this.container, _this._wheelEvent, handleMousewheel);
- }
- if (params.keyboardControl) {
- unbind(document, 'keydown', handleKeyboardKeys);
- }
- if (params.autoplay) {
- _this.stopAutoplay();
- }
- _this.callPlugins('onDestroy');
- _this = null;
- }
- function addSlideEvents() {
- var bind = _this.h.addEventListener, i;
- if (params.preventLinks) {
- var links = $$('a', _this.container);
- for (i = 0; i < links.length; i++) {
- bind(links[i], 'click', preventClick);
- }
- }
- if (params.releaseFormElements) {
- var formElements = $$('input, textarea, select', _this.container);
- for (i = 0; i < formElements.length; i++) {
- bind(formElements[i], _this.touchEvents.touchStart, releaseForms, true);
- }
- }
- if (params.onSlideClick) {
- for (i = 0; i < _this.slides.length; i++) {
- bind(_this.slides[i], 'click', slideClick);
- }
- }
- if (params.onSlideTouch) {
- for (i = 0; i < _this.slides.length; i++) {
- bind(_this.slides[i], _this.touchEvents.touchStart, slideTouch);
- }
- }
- }
- function removeSlideEvents() {
- var unbind = _this.h.removeEventListener, i;
- if (params.onSlideClick) {
- for (i = 0; i < _this.slides.length; i++) {
- unbind(_this.slides[i], 'click', slideClick);
- }
- }
- if (params.onSlideTouch) {
- for (i = 0; i < _this.slides.length; i++) {
- unbind(_this.slides[i], _this.touchEvents.touchStart, slideTouch);
- }
- }
- if (params.releaseFormElements) {
- var formElements = $$('input, textarea, select', _this.container);
- for (i = 0; i < formElements.length; i++) {
- unbind(formElements[i], _this.touchEvents.touchStart, releaseForms, true);
- }
- }
- if (params.preventLinks) {
- var links = $$('a', _this.container);
- for (i = 0; i < links.length; i++) {
- unbind(links[i], 'click', preventClick);
- }
- }
- }
- function handleKeyboardKeys(e) {
- var kc = e.keyCode || e.charCode;
- if (kc == 37 || kc == 39 || kc == 38 || kc == 40) {
- var inView = false;
- var swiperOffset = _this.h.getOffset(_this.container);
- var scrollLeft = _this.h.windowScroll().left;
- var scrollTop = _this.h.windowScroll().top;
- var windowWidth = _this.h.windowWidth();
- var windowHeight = _this.h.windowHeight();
- var swiperCoord = [
- [swiperOffset.left, swiperOffset.top],
- [swiperOffset.left + _this.width, swiperOffset.top],
- [swiperOffset.left, swiperOffset.top + _this.height],
- [swiperOffset.left + _this.width, swiperOffset.top + _this.height]
- ]
- for (var i = 0; i < swiperCoord.length; i++) {
- var point = swiperCoord[i];
- if (point[0] >= scrollLeft && point[0] <= scrollLeft + windowWidth && point[1] >= scrollTop && point[1] <= scrollTop + windowHeight) {
- inView = true;
- }
- }
- if (!inView) {
- return;
- }
- }
- if (isH) {
- if (kc == 37 || kc == 39) {
- if (e.preventDefault) {
- e.preventDefault();
- }
- else {
- e.returnValue = false;
- }
- }
- if (kc == 39) {
- _this.swipeNext();
- }
- if (kc == 37) {
- _this.swipePrev();
- }
- }
- else {
- if (kc == 38 || kc == 40) {
- if (e.preventDefault) {
- e.preventDefault();
- }
- else {
- e.returnValue = false;
- }
- }
- if (kc == 40) {
- _this.swipeNext();
- }
- if (kc == 38) {
- _this.swipePrev();
- }
- }
- }
- var allowScrollChange = true;
- function handleMousewheel(e) {
- var we = _this._wheelEvent;
- var delta;
- if (e.detail) {
- delta = -e.detail;
- }
- else if (we == 'mousewheel') {
- delta = e.wheelDelta;
- }
- else if (we == 'DOMMouseScroll') {
- delta = -e.detail;
- }
- else if (we == 'wheel') {
- delta = Math.abs(e.deltaX) > Math.abs(e.deltaY) ? -e.deltaX : -e.deltaY;
- }
- if (!params.freeMode) {
- if (delta < 0) {
- _this.swipeNext();
- }
- else {
- _this.swipePrev();
- }
- }
- else {
- var position = _this.getWrapperTranslate() + delta;
- if (position > 0) {
- position = 0;
- }
- if (position < -maxWrapperPosition()) {
- position = -maxWrapperPosition();
- }
- _this.setWrapperTransition(0);
- _this.setWrapperTranslate(position);
- _this.updateActiveSlide(position);
- }
- if (params.autoplay) {
- _this.stopAutoplay();
- }
- if (e.preventDefault) {
- e.preventDefault();
- }
- else {
- e.returnValue = false;
- }
- return false;
- }
- if (params.grabCursor) {
- var containerStyle = _this.container.style;
- containerStyle.cursor = 'move';
- containerStyle.cursor = 'grab';
- containerStyle.cursor = '-moz-grab';
- containerStyle.cursor = '-webkit-grab';
- }
- _this.allowSlideClick = true;
- function slideClick(event) {
- if (_this.allowSlideClick) {
- setClickedSlide(event);
- params.onSlideClick(_this, event);
- }
- }
- function slideTouch(event) {
- setClickedSlide(event);
- params.onSlideTouch(_this, event);
- }
- function setClickedSlide(event) {
- if (!event.currentTarget) {
- var element = event.srcElement;
- do {
- if (element.className.indexOf(params.slideClass) > -1) {
- break;
- }
- } while (element = element.parentNode);
- _this.clickedSlide = element;
- }
- else {
- _this.clickedSlide = event.currentTarget;
- }
- _this.clickedSlideIndex = _this.slides.indexOf(_this.clickedSlide);
- _this.clickedSlideLoopIndex = _this.clickedSlideIndex - (_this.loopedSlides || 0);
- }
- _this.allowLinks = true;
- function preventClick(e) {
- if (!_this.allowLinks) {
- if (e.preventDefault) {
- e.preventDefault();
- }
- else {
- e.returnValue = false;
- }
- return false;
- }
- }
- function releaseForms(e) {
- if (e.stopPropagation) {
- e.stopPropagation();
- }
- else {
- e.returnValue = false;
- }
- return false;
- }
- var isTouchEvent = false;
- var allowThresholdMove;
- var allowMomentumBounce = true;
- function onTouchStart(event) {
- if (params.preventLinks) {
- _this.allowLinks = true;
- }
- if (_this.isTouched || params.onlyExternal) {
- return false;
- }
- if (params.noSwiping && (event.target || event.srcElement) && noSwipingSlide(event.target || event.srcElement)) {
- return false;
- }
- allowMomentumBounce = false;
- _this.isTouched = true;
- isTouchEvent = event.type == 'touchstart';
- if (!isTouchEvent || event.targetTouches.length == 1) {
- _this.callPlugins('onTouchStartBegin');
- if (!isTouchEvent) {
- if (event.preventDefault) {
- event.preventDefault();
- }
- else {
- event.returnValue = false;
- }
- }
- var pageX = isTouchEvent ? event.targetTouches[0].pageX : (event.pageX || event.clientX);
- var pageY = isTouchEvent ? event.targetTouches[0].pageY : (event.pageY || event.clientY);
- _this.touches.startX = _this.touches.currentX = pageX;
- _this.touches.startY = _this.touches.currentY = pageY;
- _this.touches.start = _this.touches.current = isH ? pageX : pageY;
- _this.setWrapperTransition(0);
- _this.positions.start = _this.positions.current = _this.getWrapperTranslate();
- _this.setWrapperTranslate(_this.positions.start);
- _this.times.start = (new Date()).getTime();
- isScrolling = undefined;
- if (params.moveStartThreshold > 0) {
- allowThresholdMove = false;
- }
- if (params.onTouchStart) {
- params.onTouchStart(_this);
- }
- _this.callPlugins('onTouchStartEnd');
- }
- }
- var velocityPrevPosition, velocityPrevTime;
- function onTouchMove(event) {
- if (!_this.isTouched || params.onlyExternal) {
- return;
- }
- if (isTouchEvent && event.type == 'mousemove') {
- return;
- }
- var pageX = isTouchEvent ? event.targetTouches[0].pageX : (event.pageX || event.clientX);
- var pageY = isTouchEvent ? event.targetTouches[0].pageY : (event.pageY || event.clientY);
- if (typeof isScrolling === 'undefined' && isH) {
- isScrolling = !!(isScrolling || Math.abs(pageY - _this.touches.startY) > Math.abs(pageX - _this.touches.startX));
- }
- if (typeof isScrolling === 'undefined' && !isH) {
- isScrolling = !!(isScrolling || Math.abs(pageY - _this.touches.startY) < Math.abs(pageX - _this.touches.startX));
- }
- if (isScrolling) {
- _this.isTouched = false;
- return;
- }
- if (event.assignedToSwiper) {
- _this.isTouched = false;
- return;
- }
- event.assignedToSwiper = true;
- if (params.preventLinks) {
- _this.allowLinks = false;
- }
- if (params.onSlideClick) {
- _this.allowSlideClick = false;
- }
- if (params.autoplay) {
- _this.stopAutoplay();
- }
- if (!isTouchEvent || event.touches.length == 1) {
- if (!_this.isMoved) {
- _this.callPlugins('onTouchMoveStart');
- if (params.loop) {
- _this.fixLoop();
- _this.positions.start = _this.getWrapperTranslate();
- }
- if (params.onTouchMoveStart) {
- params.onTouchMoveStart(_this);
- }
- }
- _this.isMoved = true;
- if (event.preventDefault) {
- event.preventDefault();
- }
- else {
- event.returnValue = false;
- }
- _this.touches.current = isH ? pageX : pageY;
- _this.positions.current = (_this.touches.current - _this.touches.start) * params.touchRatio + _this.positions.start;
- if (_this.positions.current > 0 && params.onResistanceBefore) {
- params.onResistanceBefore(_this, _this.positions.current);
- }
- if (_this.positions.current < -maxWrapperPosition() && params.onResistanceAfter) {
- params.onResistanceAfter(_this, Math.abs(_this.positions.current + maxWrapperPosition()));
- }
- if (params.resistance && params.resistance != '100%') {
- if (_this.positions.current > 0) {
- var resistance = 1 - _this.positions.current / containerSize / 2;
- if (resistance < 0.5) {
- _this.positions.current = (containerSize / 2);
- }
- else {
- _this.positions.current = _this.positions.current * resistance;
- }
- }
- if (_this.positions.current < -maxWrapperPosition()) {
- var diff = (_this.touches.current - _this.touches.start) * params.touchRatio + (maxWrapperPosition() + _this.positions.start);
- var resistance = (containerSize + diff) / (containerSize);
- var newPos = _this.positions.current - diff * (1 - resistance) / 2;
- var stopPos = -maxWrapperPosition() - containerSize / 2;
- if (newPos < stopPos || resistance <= 0) {
- _this.positions.current = stopPos;
- }
- else {
- _this.positions.current = newPos;
- }
- }
- }
- if (params.resistance && params.resistance == '100%') {
- if (_this.positions.current > 0 && !(params.freeMode && !params.freeModeFluid)) {
- _this.positions.current = 0;
- }
- if ((_this.positions.current) < -maxWrapperPosition() && !(params.freeMode && !params.freeModeFluid)) {
- _this.positions.current = -maxWrapperPosition();
- }
- }
- if (!params.followFinger) {
- return;
- }
- if (!params.moveStartThreshold) {
- _this.setWrapperTranslate(_this.positions.current);
- }
- else {
- if (Math.abs(_this.touches.current - _this.touches.start) > params.moveStartThreshold || allowThresholdMove) {
- allowThresholdMove = true;
- _this.setWrapperTranslate(_this.positions.current);
- }
- else {
- _this.positions.current = _this.positions.start;
- }
- }
- if (params.freeMode || params.watchActiveIndex) {
- _this.updateActiveSlide(_this.positions.current);
- }
- if (params.grabCursor) {
- _this.container.style.cursor = 'move';
- _this.container.style.cursor = 'grabbing';
- _this.container.style.cursor = '-moz-grabbin';
- _this.container.style.cursor = '-webkit-grabbing';
- }
- if (!velocityPrevPosition) {
- velocityPrevPosition = _this.touches.current;
- }
- if (!velocityPrevTime) {
- velocityPrevTime = (new Date).getTime();
- }
- _this.velocity = (_this.touches.current - velocityPrevPosition) / ((new Date).getTime() - velocityPrevTime) / 2;
- if (Math.abs(_this.touches.current - velocityPrevPosition) < 2) {
- _this.velocity = 0;
- }
- velocityPrevPosition = _this.touches.current;
- velocityPrevTime = (new Date).getTime();
- _this.callPlugins('onTouchMoveEnd');
- if (params.onTouchMove) {
- params.onTouchMove(_this);
- }
- return false;
- }
- }
- function onTouchEnd(event) {
- if (isScrolling) {
- _this.swipeReset();
- }
- if (params.onlyExternal || !_this.isTouched) {
- return;
- }
- _this.isTouched = false
- if (params.grabCursor) {
- _this.container.style.cursor = 'move';
- _this.container.style.cursor = 'grab';
- _this.container.style.cursor = '-moz-grab';
- _this.container.style.cursor = '-webkit-grab';
- }
- if (!_this.positions.current && _this.positions.current !== 0) {
- _this.positions.current = _this.positions.start
- }
- if (params.followFinger) {
- _this.setWrapperTranslate(_this.positions.current);
- }
- _this.times.end = (new Date()).getTime();
- _this.touches.diff = _this.touches.current - _this.touches.start
- _this.touches.abs = Math.abs(_this.touches.diff)
- _this.positions.diff = _this.positions.current - _this.positions.start
- _this.positions.abs = Math.abs(_this.positions.diff)
- var diff = _this.positions.diff;
- var diffAbs = _this.positions.abs;
- var timeDiff = _this.times.end - _this.times.start
- if (diffAbs < 5 && (timeDiff) < 300 && _this.allowLinks == false) {
- if (!params.freeMode && diffAbs != 0) {
- _this.swipeReset()
- }
- if (params.preventLinks) {
- _this.allowLinks = true;
- }
- if (params.onSlideClick) {
- _this.allowSlideClick = true;
- }
- }
- setTimeout(function () {
- if (params.preventLinks) {
- _this.allowLinks = true;
- }
- if (params.onSlideClick) {
- _this.allowSlideClick = true;
- }
- }, 100);
- var maxPosition = maxWrapperPosition();
- if (!_this.isMoved && params.freeMode) {
- _this.isMoved = false;
- if (params.onTouchEnd) {
- params.onTouchEnd(_this);
- }
- _this.callPlugins('onTouchEnd');
- return;
- }
- if (!_this.isMoved || _this.positions.current > 0 || _this.positions.current < -maxPosition) {
- _this.swipeReset();
- if (params.onTouchEnd) {
- params.onTouchEnd(_this);
- }
- _this.callPlugins('onTouchEnd');
- return;
- }
- _this.isMoved = false;
- if (params.freeMode) {
- if (params.freeModeFluid) {
- var momentumDuration = 1000 * params.momentumRatio;
- var momentumDistance = _this.velocity * momentumDuration;
- var newPosition = _this.positions.current + momentumDistance
- var doBounce = false;
- var afterBouncePosition;
- var bounceAmount = Math.abs(_this.velocity) * 20 * params.momentumBounceRatio;
- if (newPosition < -maxPosition) {
- if (params.momentumBounce && _this.support.transitions) {
- if (newPosition + maxPosition < -bounceAmount) {
- newPosition = -maxPosition - bounceAmount;
- }
- afterBouncePosition = -maxPosition;
- doBounce = true;
- allowMomentumBounce = true;
- }
- else {
- newPosition = -maxPosition;
- }
- }
- if (newPosition > 0) {
- if (params.momentumBounce && _this.support.transitions) {
- if (newPosition > bounceAmount) {
- newPosition = bounceAmount;
- }
- afterBouncePosition = 0
- doBounce = true;
- allowMomentumBounce = true;
- }
- else {
- newPosition = 0;
- }
- }
- if (_this.velocity != 0) {
- momentumDuration = Math.abs((newPosition - _this.positions.current) / _this.velocity)
- }
- _this.setWrapperTranslate(newPosition);
- _this.setWrapperTransition(momentumDuration);
- if (params.momentumBounce && doBounce) {
- _this.wrapperTransitionEnd(function () {
- if (!allowMomentumBounce) {
- return;
- }
- if (params.onMomentumBounce) {
- params.onMomentumBounce(_this);
- }
- _this.setWrapperTranslate(afterBouncePosition);
- _this.setWrapperTransition(300);
- })
- }
- _this.updateActiveSlide(newPosition)
- }
- if (!params.freeModeFluid || timeDiff >= 300) {
- _this.updateActiveSlide(_this.positions.current)
- }
- if (params.onTouchEnd) {
- params.onTouchEnd(_this)
- }
- _this.callPlugins('onTouchEnd');
- return;
- }
- direction = diff < 0 ? "toNext" : "toPrev"
- if (direction == "toNext" && (timeDiff <= 300)) {
- if (diffAbs < 30 || !params.shortSwipes) {
- _this.swipeReset()
- }
- else {
- _this.swipeNext(true);
- }
- }
- if (direction == "toPrev" && (timeDiff <= 300)) {
- if (diffAbs < 30 || !params.shortSwipes) {
- _this.swipeReset()
- }
- else {
- _this.swipePrev(true);
- }
- }
- var targetSlideSize = 0;
- if (params.slidesPerView == 'auto') {
- var currentPosition = Math.abs(_this.getWrapperTranslate());
- var slidesOffset = 0;
- var _slideSize;
- for (var i = 0; i < _this.slides.length; i++) {
- _slideSize = isH ? _this.slides[i].getWidth(true) : _this.slides[i].getHeight(true);
- slidesOffset += _slideSize;
- if (slidesOffset > currentPosition) {
- targetSlideSize = _slideSize;
- break;
- }
- }
- if (targetSlideSize > containerSize) {
- targetSlideSize = containerSize;
- }
- }
- else {
- targetSlideSize = slideSize * params.slidesPerView;
- }
- if (direction == "toNext" && (timeDiff > 300)) {
- if (diffAbs >= targetSlideSize * 0.5) {
- _this.swipeNext(true)
- }
- else {
- _this.swipeReset()
- }
- }
- if (direction == "toPrev" && (timeDiff > 300)) {
- if (diffAbs >= targetSlideSize * 0.5) {
- _this.swipePrev(true);
- }
- else {
- _this.swipeReset()
- }
- }
- if (params.onTouchEnd) {
- params.onTouchEnd(_this)
- }
- _this.callPlugins('onTouchEnd');
- }
- function noSwipingSlide(el) {
- var noSwiping = false;
- do {
- if (el.className.indexOf(params.noSwipingClass) > -1) {
- noSwiping = true;
- }
- el = el.parentElement;
- } while (!noSwiping && el.parentElement && el.className.indexOf(params.wrapperClass) == -1);
- if (!noSwiping && el.className.indexOf(params.wrapperClass) > -1 && el.className.indexOf(params.noSwipingClass) > -1) {
- noSwiping = true;
- }
- return noSwiping;
- }
- _this.swipeNext = function (internal) {
- if (!internal && params.loop) {
- _this.fixLoop();
- }
- _this.callPlugins('onSwipeNext');
- var currentPosition = _this.getWrapperTranslate();
- var newPosition = currentPosition;
- if (params.slidesPerView == 'auto') {
- for (var i = 0; i < _this.snapGrid.length; i++) {
- if (-currentPosition >= _this.snapGrid[i] && -currentPosition < _this.snapGrid[i + 1]) {
- newPosition = -_this.snapGrid[i + 1]
- break;
- }
- }
- }
- else {
- var groupSize = slideSize * params.slidesPerGroup;
- newPosition = -(Math.floor(Math.abs(currentPosition) / Math.floor(groupSize)) * groupSize + groupSize);
- }
- if (newPosition < -maxWrapperPosition()) {
- newPosition = -maxWrapperPosition()
- }
- ;
- if (newPosition == currentPosition) {
- return false;
- }
- swipeToPosition(newPosition, 'next');
- return true
- }
- _this.swipePrev = function (internal) {
- if (!internal && params.loop) {
- _this.fixLoop();
- }
- if (!internal && params.autoplay) {
- _this.stopAutoplay();
- }
- _this.callPlugins('onSwipePrev');
- var currentPosition = Math.ceil(_this.getWrapperTranslate());
- var newPosition;
- if (params.slidesPerView == 'auto') {
- newPosition = 0;
- for (var i = 1; i < _this.snapGrid.length; i++) {
- if (-currentPosition == _this.snapGrid[i]) {
- newPosition = -_this.snapGrid[i - 1]
- break;
- }
- if (-currentPosition > _this.snapGrid[i] && -currentPosition < _this.snapGrid[i + 1]) {
- newPosition = -_this.snapGrid[i]
- break;
- }
- }
- }
- else {
- var groupSize = slideSize * params.slidesPerGroup;
- newPosition = -(Math.ceil(-currentPosition / groupSize) - 1) * groupSize;
- }
- if (newPosition > 0) {
- newPosition = 0;
- }
- if (newPosition == currentPosition) {
- return false;
- }
- swipeToPosition(newPosition, 'prev');
- return true;
- }
- _this.swipeReset = function () {
- _this.callPlugins('onSwipeReset');
- var currentPosition = _this.getWrapperTranslate();
- var groupSize = slideSize * params.slidesPerGroup;
- var newPosition;
- var maxPosition = -maxWrapperPosition();
- if (params.slidesPerView == 'auto') {
- newPosition = 0;
- for (var i = 0; i < _this.snapGrid.length; i++) {
- if (-currentPosition === _this.snapGrid[i]) {
- return;
- }
- if (-currentPosition >= _this.snapGrid[i] && -currentPosition < _this.snapGrid[i + 1]) {
- if (_this.positions.diff > 0) {
- newPosition = -_this.snapGrid[i + 1]
- }
- else {
- newPosition = -_this.snapGrid[i]
- }
- break;
- }
- }
- if (-currentPosition >= _this.snapGrid[_this.snapGrid.length - 1]) {
- newPosition = -_this.snapGrid[_this.snapGrid.length - 1];
- }
- if (currentPosition <= -maxWrapperPosition()) {
- newPosition = -maxWrapperPosition()
- }
- }
- else {
- newPosition = currentPosition < 0 ? Math.round(currentPosition / groupSize) * groupSize : 0
- }
- if (params.scrollContainer) {
- newPosition = currentPosition < 0 ? currentPosition : 0;
- }
- if (newPosition < -maxWrapperPosition()) {
- newPosition = -maxWrapperPosition()
- }
- if (params.scrollContainer && (containerSize > slideSize)) {
- newPosition = 0;
- }
- if (newPosition == currentPosition) {
- return false;
- }
- swipeToPosition(newPosition, 'reset');
- return true;
- }
- _this.swipeTo = function (index, speed, runCallbacks) {
- index = parseInt(index, 10);
- _this.callPlugins('onSwipeTo', {index: index, speed: speed});
- if (params.loop) {
- index = index + _this.loopedSlides;
- }
- var currentPosition = _this.getWrapperTranslate();
- if (index > (_this.slides.length - 1) || index < 0) {
- return;
- }
- var newPosition
- if (params.slidesPerView == 'auto') {
- newPosition = -_this.slidesGrid[index];
- }
- else {
- newPosition = -index * slideSize;
- }
- if (newPosition < -maxWrapperPosition()) {
- newPosition = -maxWrapperPosition();
- }
- ;
- if (newPosition == currentPosition) {
- return false;
- }
- runCallbacks = runCallbacks === false ? false : true;
- swipeToPosition(newPosition, 'to', {index: index, speed: speed, runCallbacks: runCallbacks});
- return true;
- }
- function swipeToPosition(newPosition, action, toOptions) {
- var speed = (action == 'to' && toOptions.speed >= 0) ? toOptions.speed : params.speed;
- if (_this.support.transitions || !params.DOMAnimation) {
- _this.setWrapperTranslate(newPosition);
- _this.setWrapperTransition(speed);
- }
- else {
- var currentPosition = _this.getWrapperTranslate();
- var animationStep = Math.ceil((newPosition - currentPosition) / speed * (1000 / 60));
- var direction = currentPosition > newPosition ? 'toNext' : 'toPrev';
- var condition = direction == 'toNext' ? currentPosition > newPosition : currentPosition < newPosition;
- if (_this._DOMAnimating) {
- return;
- }
- anim();
- }
- function anim() {
- currentPosition += animationStep;
- condition = direction == 'toNext' ? currentPosition > newPosition : currentPosition < newPosition;
- if (condition) {
- _this.setWrapperTranslate(Math.round(currentPosition));
- _this._DOMAnimating = true
- window.setTimeout(function () {
- anim()
- }, 1000 / 60)
- }
- else {
- if (params.onSlideChangeEnd) {
- params.onSlideChangeEnd(_this);
- }
- _this.setWrapperTranslate(newPosition);
- _this._DOMAnimating = false;
- }
- }
- _this.updateActiveSlide(newPosition);
- if (params.onSlideNext && action == 'next') {
- params.onSlideNext(_this, newPosition);
- }
- if (params.onSlidePrev && action == 'prev') {
- params.onSlidePrev(_this, newPosition);
- }
- if (params.onSlideReset && action == 'reset') {
- params.onSlideReset(_this, newPosition);
- }
- if (action == 'next' || action == 'prev' || (action == 'to' && toOptions.runCallbacks == true)) {
- slideChangeCallbacks();
- }
- }
- _this._queueStartCallbacks = false;
- _this._queueEndCallbacks = false;
- function slideChangeCallbacks() {
- _this.callPlugins('onSlideChangeStart');
- if (params.onSlideChangeStart) {
- if (params.queueStartCallbacks && _this.support.transitions) {
- if (_this._queueStartCallbacks) {
- return;
- }
- _this._queueStartCallbacks = true;
- params.onSlideChangeStart(_this)
- _this.wrapperTransitionEnd(function () {
- _this._queueStartCallbacks = false;
- })
- }
- else {
- params.onSlideChangeStart(_this)
- }
- }
- if (params.onSlideChangeEnd) {
- if (_this.support.transitions) {
- if (params.queueEndCallbacks) {
- if (_this._queueEndCallbacks) {
- return;
- }
- _this._queueEndCallbacks = true;
- _this.wrapperTransitionEnd(params.onSlideChangeEnd)
- }
- else {
- _this.wrapperTransitionEnd(params.onSlideChangeEnd)
- }
- }
- else {
- if (!params.DOMAnimation) {
- setTimeout(function () {
- params.onSlideChangeEnd(_this)
- }, 10)
- }
- }
- }
- }
- _this.updateActiveSlide = function (position) {
- if (!_this.initialized) {
- return;
- }
- if (_this.slides.length == 0) {
- return;
- }
- _this.previousIndex = _this.activeIndex;
- if (typeof position == 'undefined') {
- position = _this.getWrapperTranslate();
- }
- if (position > 0) {
- position = 0;
- }
- if (params.slidesPerView == 'auto') {
- var slidesOffset = 0;
- _this.activeIndex = _this.slidesGrid.indexOf(-position);
- if (_this.activeIndex < 0) {
- for (var i = 0; i < _this.slidesGrid.length - 1; i++) {
- if (-position > _this.slidesGrid[i] && -position < _this.slidesGrid[i + 1]) {
- break;
- }
- }
- var leftDistance = Math.abs(_this.slidesGrid[i] + position)
- var rightDistance = Math.abs(_this.slidesGrid[i + 1] + position)
- if (leftDistance <= rightDistance) {
- _this.activeIndex = i;
- }
- else {
- _this.activeIndex = i + 1;
- }
- }
- }
- else {
- _this.activeIndex = Math[params.visibilityFullFit ? 'ceil' : 'round'](-position / slideSize);
- }
- if (_this.activeIndex == _this.slides.length) {
- _this.activeIndex = _this.slides.length - 1;
- }
- if (_this.activeIndex < 0) {
- _this.activeIndex = 0;
- }
- if (!_this.slides[_this.activeIndex]) {
- return;
- }
- _this.calcVisibleSlides(position);
- var activeClassRegexp = new RegExp("\\s*" + params.slideActiveClass);
- var inViewClassRegexp = new RegExp("\\s*" + params.slideVisibleClass);
- for (var i = 0; i < _this.slides.length; i++) {
- _this.slides[i].className = _this.slides[i].className.replace(activeClassRegexp, '').replace(inViewClassRegexp, '');
- if (_this.visibleSlides.indexOf(_this.slides[i]) >= 0) {
- _this.slides[i].className += ' ' + params.slideVisibleClass;
- }
- }
- _this.slides[_this.activeIndex].className += ' ' + params.slideActiveClass;
- if (params.loop) {
- var ls = _this.loopedSlides;
- _this.activeLoopIndex = _this.activeIndex - ls;
- if (_this.activeLoopIndex >= _this.slides.length - ls * 2) {
- _this.activeLoopIndex = _this.slides.length - ls * 2 - _this.activeLoopIndex;
- }
- if (_this.activeLoopIndex < 0) {
- _this.activeLoopIndex = _this.slides.length - ls * 2 + _this.activeLoopIndex;
- }
- }
- else {
- _this.activeLoopIndex = _this.activeIndex;
- }
- if (params.pagination) {
- _this.updatePagination(position);
- }
- }
- _this.createPagination = function (firstInit) {
- if (params.paginationClickable && _this.paginationButtons) {
- removePaginationEvents();
- }
- var paginationHTML = "";
- var numOfSlides = _this.slides.length;
- var numOfButtons = numOfSlides;
- if (params.loop) {
- numOfButtons -= _this.loopedSlides * 2
- }
- for (var i = 0; i < numOfButtons; i++) {
- paginationHTML += '<' + params.paginationElement + ' class="' + params.paginationElementClass + '"></' + params.paginationElement + '>'
- }
- _this.paginationContainer = params.pagination.nodeType ? params.pagination : $$(params.pagination)[0];
- _this.paginationContainer.innerHTML = paginationHTML;
- _this.paginationButtons = $$('.' + params.paginationElementClass, _this.paginationContainer);
- if (!firstInit) {
- _this.updatePagination()
- }
- _this.callPlugins('onCreatePagination');
- if (params.paginationClickable) {
- addPaginationEvents();
- }
- }
- function removePaginationEvents() {
- var pagers = _this.paginationButtons;
- for (var i = 0; i < pagers.length; i++) {
- _this.h.removeEventListener(pagers[i], 'click', paginationClick);
- }
- }
- function addPaginationEvents() {
- var pagers = _this.paginationButtons;
- for (var i = 0; i < pagers.length; i++) {
- _this.h.addEventListener(pagers[i], 'click', paginationClick);
- }
- }
- function paginationClick(e) {
- var index;
- var target = e.target || e.srcElement;
- var pagers = _this.paginationButtons;
- for (var i = 0; i < pagers.length; i++) {
- if (target === pagers[i]) {
- index = i;
- }
- }
- _this.swipeTo(index)
- }
- _this.updatePagination = function (position) {
- if (!params.pagination) {
- return;
- }
- if (_this.slides.length < 1) {
- return;
- }
- var activePagers = $$('.' + params.paginationActiveClass, _this.paginationContainer);
- if (!activePagers) {
- return;
- }
- var pagers = _this.paginationButtons;
- if (pagers.length == 0) {
- return;
- }
- for (var i = 0; i < pagers.length; i++) {
- pagers[i].className = params.paginationElementClass
- }
- var indexOffset = params.loop ? _this.loopedSlides : 0;
- if (params.paginationAsRange) {
- if (!_this.visibleSlides) {
- _this.calcVisibleSlides(position)
- }
- var visibleIndexes = [];
- for (var i = 0; i < _this.visibleSlides.length; i++) {
- var visIndex = _this.slides.indexOf(_this.visibleSlides[i]) - indexOffset
- if (params.loop && visIndex < 0) {
- visIndex = _this.slides.length - _this.loopedSlides * 2 + visIndex;
- }
- if (params.loop && visIndex >= _this.slides.length - _this.loopedSlides * 2) {
- visIndex = _this.slides.length - _this.loopedSlides * 2 - visIndex;
- visIndex = Math.abs(visIndex)
- }
- visibleIndexes.push(visIndex)
- }
- for (i = 0; i < visibleIndexes.length; i++) {
- if (pagers[visibleIndexes[i]]) {
- pagers[visibleIndexes[i]].className += ' ' + params.paginationVisibleClass;
- }
- }
- if (params.loop) {
- pagers[_this.activeLoopIndex].className += ' ' + params.paginationActiveClass;
- }
- else {
- pagers[_this.activeIndex].className += ' ' + params.paginationActiveClass;
- }
- }
- else {
- if (params.loop) {
- pagers[_this.activeLoopIndex].className += ' ' + params.paginationActiveClass + ' ' + params.paginationVisibleClass;
- }
- else {
- pagers[_this.activeIndex].className += ' ' + params.paginationActiveClass + ' ' + params.paginationVisibleClass;
- }
- }
- }
- _this.calcVisibleSlides = function (position) {
- var visibleSlides = [];
- var _slideLeft = 0, _slideSize = 0, _slideRight = 0;
- if (isH && _this.wrapperLeft > 0) {
- position = position + _this.wrapperLeft;
- }
- if (!isH && _this.wrapperTop > 0) {
- position = position + _this.wrapperTop;
- }
- for (var i = 0; i < _this.slides.length; i++) {
- _slideLeft += _slideSize;
- if (params.slidesPerView == 'auto') {
- _slideSize = isH ? _this.h.getWidth(_this.slides[i], true) : _this.h.getHeight(_this.slides[i], true);
- }
- else {
- _slideSize = slideSize;
- }
- _slideRight = _slideLeft + _slideSize;
- var isVisibile = false;
- if (params.visibilityFullFit) {
- if (_slideLeft >= -position && _slideRight <= -position + containerSize) {
- isVisibile = true;
- }
- if (_slideLeft <= -position && _slideRight >= -position + containerSize) {
- isVisibile = true;
- }
- }
- else {
- if (_slideRight > -position && _slideRight <= ((-position + containerSize))) {
- isVisibile = true;
- }
- if (_slideLeft >= -position && _slideLeft < ((-position + containerSize))) {
- isVisibile = true;
- }
- if (_slideLeft < -position && _slideRight > ((-position + containerSize))) {
- isVisibile = true;
- }
- }
- if (isVisibile) {
- visibleSlides.push(_this.slides[i])
- }
- }
- if (visibleSlides.length == 0) {
- visibleSlides = [_this.slides[_this.activeIndex]]
- }
- _this.visibleSlides = visibleSlides;
- }
- _this.autoPlayIntervalId = undefined;
- _this.startAutoplay = function () {
- if (typeof _this.autoPlayIntervalId !== 'undefined') {
- return false;
- }
- if (params.autoplay && !params.loop) {
- _this.autoPlayIntervalId = setInterval(function () {
- if (!_this.swipeNext(true)) {
- _this.swipeTo(0);
- }
- }, params.autoplay)
- }
- if (params.autoplay && params.loop) {
- _this.autoPlayIntervalId = setInterval(function () {
- _this.swipeNext();
- }, params.autoplay)
- }
- _this.callPlugins('onAutoplayStart');
- }
- _this.stopAutoplay = function () {
- if (_this.autoPlayIntervalId) {
- clearInterval(_this.autoPlayIntervalId);
- }
- _this.autoPlayIntervalId = undefined;
- _this.callPlugins('onAutoplayStop');
- }
- _this.loopCreated = false;
- _this.removeLoopedSlides = function () {
- if (_this.loopCreated) {
- for (var i = 0; i < _this.slides.length; i++) {
- if (_this.slides[i].getData('looped') === true) {
- _this.wrapper.removeChild(_this.slides[i]);
- }
- }
- }
- }
- _this.createLoop = function () {
- if (_this.slides.length == 0) {
- return;
- }
- _this.loopedSlides = params.slidesPerView + params.loopAdditionalSlides;
- if (_this.loopedSlides > _this.slides.length) {
- _this.loopedSlides = _this.slides.length;
- }
- var slideFirstHTML = '', slideLastHTML = '', i;
- for (i = 0; i < _this.loopedSlides; i++) {
- slideFirstHTML += _this.slides[i].outerHTML;
- }
- for (i = _this.slides.length - _this.loopedSlides; i < _this.slides.length; i++) {
- slideLastHTML += _this.slides[i].outerHTML;
- }
- wrapper.innerHTML = slideLastHTML + wrapper.innerHTML + slideFirstHTML;
- _this.loopCreated = true;
- _this.calcSlides();
- for (i = 0; i < _this.slides.length; i++) {
- if (i < _this.loopedSlides || i >= _this.slides.length - _this.loopedSlides) {
- _this.slides[i].setData('looped', true);
- }
- }
- _this.callPlugins('onCreateLoop');
- }
- _this.fixLoop = function () {
- var newIndex;
- if (_this.activeIndex < _this.loopedSlides) {
- newIndex = _this.slides.length - _this.loopedSlides * 3 + _this.activeIndex;
- _this.swipeTo(newIndex, 0, false);
- }
- else if (_this.activeIndex > _this.slides.length - params.slidesPerView * 2) {
- newIndex = -_this.slides.length + _this.activeIndex + _this.loopedSlides
- _this.swipeTo(newIndex, 0, false);
- }
- }
- _this.loadSlides = function () {
- var slidesHTML = '';
- _this.activeLoaderIndex = 0;
- var slides = params.loader.slides;
- var slidesToLoad = params.loader.loadAllSlides ? slides.length : params.slidesPerView * (1 + params.loader.surroundGroups);
- for (var i = 0; i < slidesToLoad; i++) {
- if (params.loader.slidesHTMLType == 'outer') {
- slidesHTML += slides[i];
- }
- else {
- slidesHTML +=
- '<' + params.slideElement + ' class="' + params.slideClass + '" data-swiperindex="' + i + '">' + slides[i] + '</'
- + params.slideElement + '>';
- }
- }
- _this.wrapper.innerHTML = slidesHTML;
- _this.calcSlides(true);
- if (!params.loader.loadAllSlides) {
- _this.wrapperTransitionEnd(_this.reloadSlides, true);
- }
- }
- _this.reloadSlides = function () {
- var slides = params.loader.slides;
- var newActiveIndex = parseInt(_this.activeSlide().data('swiperindex'), 10)
- if (newActiveIndex < 0 || newActiveIndex > slides.length - 1) {
- return
- }
- _this.activeLoaderIndex = newActiveIndex;
- var firstIndex = Math.max(0, newActiveIndex - params.slidesPerView * params.loader.surroundGroups)
- var lastIndex = Math.min(newActiveIndex + params.slidesPerView * (1 + params.loader.surroundGroups) - 1, slides.length - 1)
- if (newActiveIndex > 0) {
- var newTransform = -slideSize * (newActiveIndex - firstIndex)
- _this.setWrapperTranslate(newTransform);
- _this.setWrapperTransition(0);
- }
- if (params.loader.logic === 'reload') {
- _this.wrapper.innerHTML = '';
- var slidesHTML = '';
- for (var i = firstIndex; i <= lastIndex; i++) {
- slidesHTML +=
- params.loader.slidesHTMLType == 'outer' ? slides[i] :
- '<' + params.slideElement + ' class="' + params.slideClass + '" data-swiperindex="' + i + '">' + slides[i] + '</'
- + params.slideElement + '>';
- }
- _this.wrapper.innerHTML = slidesHTML;
- }
- else {
- var minExistIndex = 1000;
- var maxExistIndex = 0;
- for (var i = 0; i < _this.slides.length; i++) {
- var index = _this.slides[i].data('swiperindex');
- if (index < firstIndex || index > lastIndex) {
- _this.wrapper.removeChild(_this.slides[i]);
- }
- else {
- minExistIndex = Math.min(index, minExistIndex)
- maxExistIndex = Math.max(index, maxExistIndex)
- }
- }
- for (var i = firstIndex; i <= lastIndex; i++) {
- if (i < minExistIndex) {
- var newSlide = document.createElement(params.slideElement);
- newSlide.className = params.slideClass;
- newSlide.setAttribute('data-swiperindex', i);
- newSlide.innerHTML = slides[i];
- _this.wrapper.insertBefore(newSlide, _this.wrapper.firstChild);
- }
- if (i > maxExistIndex) {
- var newSlide = document.createElement(params.slideElement);
- newSlide.className = params.slideClass;
- newSlide.setAttribute('data-swiperindex', i);
- newSlide.innerHTML = slides[i];
- _this.wrapper.appendChild(newSlide);
- }
- }
- }
- _this.reInit(true);
- }
- function makeSwiper() {
- _this.calcSlides();
- if (params.loader.slides.length > 0 && _this.slides.length == 0) {
- _this.loadSlides();
- }
- if (params.loop) {
- _this.createLoop();
- }
- _this.init();
- initEvents();
- if (params.pagination && params.createPagination) {
- _this.createPagination(true);
- }
- if (params.loop || params.initialSlide > 0) {
- _this.swipeTo(params.initialSlide, 0, false);
- }
- else {
- _this.updateActiveSlide(0);
- }
- if (params.autoplay) {
- _this.startAutoplay();
- }
- }
- makeSwiper();
- }
- Swiper.prototype = {plugins: {}, wrapperTransitionEnd: function (callback, permanent) {
- var a = this, el = a.wrapper, events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'], i;
- function fireCallBack() {
- callback(a);
- if (a.params.queueEndCallbacks) {
- a._queueEndCallbacks = false;
- }
- if (!permanent) {
- for (i = 0; i < events.length; i++) {
- a.h.removeEventListener(el, events[i], fireCallBack);
- }
- }
- }
- if (callback) {
- for (i = 0; i < events.length; i++) {
- a.h.addEventListener(el, events[i], fireCallBack);
- }
- }
- }, getWrapperTranslate: function (axis) {
- var el = this.wrapper, matrix, curTransform, curStyle, transformMatrix;
- if (typeof axis == 'undefined') {
- axis = this.params.mode == 'horizontal' ? 'x' : 'y';
- }
- curStyle = window.getComputedStyle(el, null);
- if (window.WebKitCSSMatrix) {
- transformMatrix = new WebKitCSSMatrix(curStyle.webkitTransform);
- }
- else {
- transformMatrix =
- curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform
- || curStyle.getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,");
- matrix = transformMatrix.toString().split(',');
- }
- if (this.support.transforms && this.params.useCSS3Transforms) {
- if (axis == 'x') {
- if (window.WebKitCSSMatrix) {
- curTransform = transformMatrix.m41;
- }
- else if (matrix.length == 16) {
- curTransform = parseFloat(matrix[12]);
- }
- else {
- curTransform = parseFloat(matrix[4]);
- }
- }
- if (axis == 'y') {
- if (window.WebKitCSSMatrix) {
- curTransform = transformMatrix.m42;
- }
- else if (matrix.length == 16) {
- curTransform = parseFloat(matrix[13]);
- }
- else {
- curTransform = parseFloat(matrix[5]);
- }
- }
- }
- else {
- if (axis == 'x') {
- curTransform = parseFloat(el.style.left, 10) || 0;
- }
- if (axis == 'y') {
- curTransform = parseFloat(el.style.top, 10) || 0;
- }
- }
- return curTransform || 0;
- }, setWrapperTranslate: function (x, y, z) {
- var es = this.wrapper.style, coords = {x: 0, y: 0, z: 0}, translate;
- if (arguments.length == 3) {
- coords.x = x;
- coords.y = y;
- coords.z = z;
- }
- else {
- if (typeof y == 'undefined') {
- y = this.params.mode == 'horizontal' ? 'x' : 'y';
- }
- coords[y] = x;
- }
- if (this.support.transforms && this.params.useCSS3Transforms) {
- translate =
- this.support.transforms3d ? 'translate3d(' + coords.x + 'px, ' + coords.y + 'px, ' + coords.z + 'px)' :
- 'translate(' + coords.x + 'px, ' + coords.y + 'px)';
- es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = translate;
- }
- else {
- es.left = coords.x + 'px';
- es.top = coords.y + 'px';
- }
- this.callPlugins('onSetWrapperTransform', coords);
- }, setWrapperTransition: function (duration) {
- var es = this.wrapper.style;
- es.webkitTransitionDuration =
- es.MsTransitionDuration =
- es.msTransitionDuration = es.MozTransitionDuration = es.OTransitionDuration = es.transitionDuration = (duration / 1000) + 's';
- this.callPlugins('onSetWrapperTransition', {duration: duration});
- }, h: {getWidth: function (el, outer) {
- var width = window.getComputedStyle(el, null).getPropertyValue('width')
- var returnWidth = parseFloat(width);
- if (isNaN(returnWidth) || width.indexOf('%') > 0) {
- returnWidth =
- el.offsetWidth - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-left'))
- - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-right'));
- }
- if (outer) {
- returnWidth +=
- parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + parseFloat(window.getComputedStyle(el,
- null).getPropertyValue('padding-right'))
- }
- return returnWidth;
- }, getHeight: function (el, outer) {
- if (outer) {
- return el.offsetHeight;
- }
- var height = window.getComputedStyle(el, null).getPropertyValue('height')
- var returnHeight = parseFloat(height);
- if (isNaN(returnHeight) || height.indexOf('%') > 0) {
- returnHeight =
- el.offsetHeight - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-top'))
- - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-bottom'));
- }
- if (outer) {
- returnHeight +=
- parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-top')) + parseFloat(window.getComputedStyle(el,
- null).getPropertyValue('padding-bottom'))
- }
- return returnHeight;
- }, getOffset: function (el) {
- var box = el.getBoundingClientRect();
- var body = document.body;
- var clientTop = el.clientTop || body.clientTop || 0;
- var clientLeft = el.clientLeft || body.clientLeft || 0;
- var scrollTop = window.pageYOffset || el.scrollTop;
- var scrollLeft = window.pageXOffset || el.scrollLeft;
- if (document.documentElement && !window.pageYOffset) {
- scrollTop = document.documentElement.scrollTop;
- scrollLeft = document.documentElement.scrollLeft;
- }
- return{top: box.top + scrollTop - clientTop, left: box.left + scrollLeft - clientLeft};
- }, windowWidth: function () {
- if (window.innerWidth) {
- return window.innerWidth
- }
- else if (document.documentElement && document.documentElement.clientWidth) {
- return document.documentElement.clientWidth;
- }
- }, windowHeight: function () {
- if (window.innerHeight) {
- return window.innerHeight
- }
- else if (document.documentElement && document.documentElement.clientHeight) {
- return document.documentElement.clientHeight;
- }
- }, windowScroll: function () {
- var left = 0, top = 0;
- if (typeof pageYOffset != 'undefined') {
- return{left: window.pageXOffset, top: window.pageYOffset}
- }
- else if (document.documentElement) {
- return{left: document.documentElement.scrollLeft, top: document.documentElement.scrollTop}
- }
- }, addEventListener: function (el, event, listener, useCapture) {
- if (typeof useCapture == 'undefined') {
- useCapture = false;
- }
- if (el.addEventListener) {
- el.addEventListener(event, listener, useCapture);
- }
- else if (el.attachEvent) {
- el.attachEvent('on' + event, listener);
- }
- }, removeEventListener: function (el, event, listener, useCapture) {
- if (typeof useCapture == 'undefined') {
- useCapture = false;
- }
- if (el.removeEventListener) {
- el.removeEventListener(event, listener, useCapture);
- }
- else if (el.detachEvent) {
- el.detachEvent('on' + event, listener);
- }
- }}, setTransform: function (el, transform) {
- var es = el.style
- es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = transform
- }, setTranslate: function (el, translate) {
- var es = el.style
- var pos = {x: translate.x || 0, y: translate.y || 0, z: translate.z || 0};
- var transformString = this.support.transforms3d ? 'translate3d(' + (pos.x) + 'px,' + (pos.y) + 'px,' + (pos.z) + 'px)' :
- 'translate(' + (pos.x) + 'px,' + (pos.y) + 'px)';
- es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = transformString;
- if (!this.support.transforms) {
- es.left = pos.x + 'px'
- es.top = pos.y + 'px'
- }
- }, setTransition: function (el, duration) {
- var es = el.style
- es.webkitTransitionDuration =
- es.MsTransitionDuration =
- es.msTransitionDuration = es.MozTransitionDuration = es.OTransitionDuration = es.transitionDuration = duration + 'ms';
- }, support: {touch: (window.Modernizr && Modernizr.touch === true) || (function () {
- return!!(("ontouchstart"in window) || window.DocumentTouch && document instanceof DocumentTouch);
- })(), transforms3d: (window.Modernizr && Modernizr.csstransforms3d === true) || (function () {
- var div = document.createElement('div').style;
- return("webkitPerspective"in div || "MozPerspective"in div || "OPerspective"in div || "MsPerspective"in div || "perspective"in div);
- })(), transforms: (window.Modernizr && Modernizr.csstransforms === true) || (function () {
- var div = document.createElement('div').style;
- return('transform'in div || 'WebkitTransform'in div || 'MozTransform'in div || 'msTransform'in div || 'MsTransform'in div || 'OTransform'in div);
- })(), transitions: (window.Modernizr && Modernizr.csstransitions === true) || (function () {
- var div = document.createElement('div').style;
- return('transition'in div || 'WebkitTransition'in div || 'MozTransition'in div || 'msTransition'in div || 'MsTransition'in div || 'OTransition'
- in div);
- })()}, browser: {ie8: (function () {
- var rv = -1;
- if (navigator.appName == 'Microsoft Internet Explorer') {
- var ua = navigator.userAgent;
- var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
- if (re.exec(ua) != null) {
- rv = parseFloat(RegExp.$1);
- }
- }
- return rv != -1 && rv < 9;
- })(), ie10: window.navigator.msPointerEnabled}}
- if (window.jQuery || window.Zepto) {
- (function ($) {
- $.fn.swiper = function (params) {
- var s = new Swiper($(this)[0], params)
- $(this).data('swiper', s);
- return s;
- }
- })(window.jQuery || window.Zepto)
- }
- if (typeof(module) !== 'undefined') {
- module.exports = Swiper;
- }
- ;
- (function ($) {
- $(document).on('focus', '.HIDEVALUE', function () {
- var $t = $(this);
- var classValue = $t.metadata().value || '';
- if (typeof($t.metadata().classDiv) != 'undefined') {
- var classDiv = '.' + $t.metadata().classDiv;
- }
- $.log(classValue);
- if ($t.val() == this.defaultValue && !classValue) {
- $t.val('');
- if (typeof(classDiv) != 'undefined') {
- $classDiv.addClass('active');
- }
- else {
- $t.addClass('active');
- }
- }
- else if ($t.val() == classValue) {
- $t.val('');
- if (typeof(classDiv) != 'undefined') {
- $(classDiv).addClass('active');
- }
- else {
- $t.addClass('active');
- }
- }
- });
- $(document).on('blur', '.HIDEVALUE', function () {
- var $t = $(this);
- if ($t.val() == "") {
- $t.val(this.defaultValue);
- if (typeof($t.metadata().classDiv) != 'undefined') {
- var classDiv = '.' + $t.metadata().classDiv;
- }
- if (typeof(classDiv) != 'undefined') {
- $(classDiv).removeClass('active');
- }
- else {
- $t.removeClass('active');
- }
- }
- });
- })(jQuery);
- ;
- var webtrekkConfig = {trackId: "797404159409395", trackDomain: "brille2401.webtrekk.net", domain: "www.brille24.de", cookie: "1", contentId: ""};
- var webtrekkUnloadObjects = [];
- var webtrekkLinktrackObjects = [];
- var webtrekkHeatmapObjects = [];
- function webtrekkV3($a) {
- var webtrekkUnload = function ($b, $c) {
- if ($d.cookie == "1" && !$d.optOut && !$d.deactivatePixel) {
- $d.firstParty();
- }
- ;
- var $e = ($c) ? $c : ($d.formObject && $b != "noForm") ? "form" : "link";
- if ($d.beforeUnloadPixel != false) {
- $d.beforeUnloadPixel();
- }
- else if ($e == "form") {
- $d.executePlugin($d.getPluginConfig("form", "before"));
- }
- ;
- var p = "";
- if ($d.config.linkId) {
- p += "&ct=" + $d.wtEscape($d.maxlen($d.config.linkId, 255));
- if (p) {
- if ($d.linktrackOut) {
- p += "&ctx=1";
- }
- ;
- var $f = $d.ccParams;
- if (typeof($f) == 'string' && $f != '') {
- p += $f;
- }
- }
- }
- ;
- if ($d.wtEp) {
- if ($d.wtEpEncoded) {
- p += $d.wtEp;
- }
- else {
- var $g = $d.wtEp;
- if (typeof($g) == 'string' && $g != '') {
- $g = $g.split(/;/);
- for (var z = 0; z < $g.length; z++) {
- if ($d.wtTypeof($g[z])) {
- var $h = $g[z].split(/=/);
- if ($d.checkSC('custom')) {
- $h[1] = $d.decrypt($h[1]);
- }
- ;
- $h[1] = $d.wtEscape($h[1]);
- p += '&' + $h[0] + '=' + $h[1];
- }
- }
- }
- }
- }
- ;
- if ($d.formObject && $b != "noForm") {
- var gatherFormsP = $d.gatherForm();
- if (gatherFormsP) {
- p += "&fn=" + ($d.formName ? $d.formName : $d.contentId.split(";")[0]) + '|' + ($d.formSubmit ? "1" : "0");
- p += "&ft=" + $d.wtEscape(gatherFormsP);
- }
- }
- ;
- if (p != "") {
- if ($d.isChrome && $e != "click") {
- $d.quicksend($d.wtEscape($d.contentId.split(";")[0]) + ",1," + $d.baseparams(), p, false, "saveRequest");
- }
- else {
- $d.quicksend($d.wtEscape($d.contentId.split(";")[0]) + ",1," + $d.baseparams(), p, false, "sendRequest");
- }
- ;
- $d.config.linkId = "";
- $d.ccParams = "";
- $d.wtEp = "";
- }
- ;
- if ($d.afterUnloadPixel != false) {
- $d.afterUnloadPixel();
- }
- else if ($e == "form") {
- $d.executePlugin($d.getPluginConfig("form", "after"));
- }
- };
- var webtrekkLinktrack = function (e) {
- if ((e.which && e.which == 1) || (e.button && e.button == 1)) {
- var a = ((document.all && window.event !== null) ? window.event.srcElement : this);
- for (var i = 0; i < 4; i++) {
- if (a.tagName && a.tagName.toLowerCase() != "a" && a.tagName.toLowerCase() != "area") {
- a = a.parentElement;
- }
- }
- ;
- $d.config = $d.getConfig(true);
- $d.config.customClickParameter = $d.customClickParameter;
- a.lname = $d.getAttribute(a, $d.linkTrackAttribute);
- a.lpos = 0;
- $d.getCCParams(a);
- if (!$d.wtLength(a.lpos) && a.tagName) {
- var c = document.links;
- for (var d = 0; d < $d.wtLength(c); d++) {
- if (a == c[d]) {
- a.lpos = d + 1;
- break;
- }
- }
- }
- ;
- if (a.lpos) {
- if ($d.getJSON(a.lname) != null) {
- $d.parseJSON($d.getJSON(a.lname));
- a.lname = $d.config.linkId;
- }
- ;
- if ($d.linkTrack == "link") {
- var y = a.href.indexOf("//");
- y = (y >= 0 ? a.href.substr(y + 2) : a.href);
- if ($d.linkTrackPattern) {
- if (!$d.linkTrackReplace) {
- $d.linkTrackReplace = "";
- }
- ;
- y = y.replace($d.linkTrackPattern, $d.linkTrackReplace);
- }
- ;
- $d.config.linkId = (a.lname ? (a.lname + ".") : "") + y.split("?")[0].replace(/\//g, ".");
- var p = "";
- if ($d.linkTrackParams) {
- p = $d.linkTrackParams.replace(/;/g, ",").split(",");
- }
- ;
- for (var i = 0; i < p.length; i++) {
- var v = $d.urlParam(y, p[i], "");
- if (v) {
- $d.config.linkId += "." + p[i] + "." + v;
- }
- }
- }
- else if ($d.linkTrack == "standard" && a.lname) {
- $d.config.linkId = a.lname;
- }
- ;
- var $i = false;
- if ($d.linkTrackDownloads) {
- var $j = a.href.split(".");
- $j = $j.pop();
- var $k = $d.linkTrackDownloads.split(";");
- for (i = 0; i < $k.length; i++) {
- if ($k[i] == $j) {
- $i = true;
- break;
- }
- }
- }
- ;
- if ($d.config.linkId) {
- if ($d.domain && !$d.isOwnDomain(a.href)) {
- $d.linktrackOut = true;
- }
- }
- ;
- if ($i || ($d.config.linkId && a.target != "" && a.target != "_self")) {
- $d.sendinfo($d.config, $d.config.linkId, "click");
- }
- else {
- $d.sendinfo($d.config, $d.config.linkId, "link");
- }
- }
- }
- };
- var webtrekkHeatmapClick = function (e) {
- var $l = document.getElementById($d.heatmapRefpoint), $m;
- if ($l && $l !== null) {
- $m = {left: 0, top: 0};
- }
- else {
- $m = {left: -1, top: -1};
- }
- ;
- if ($l && $l !== null) {
- if ($d.wtTypeof($l.offsetLeft)) {
- while ($l) {
- $m.left += (($l.offsetLeft >= 0) ? $l.offsetLeft : 0);
- $m.top += (($l.offsetTop >= 0) ? $l.offsetTop : 0);
- $l = $l.offsetParent;
- }
- }
- }
- ;
- var $n = 0;
- var $o = 0;
- if (!e) {
- var e = window.event;
- }
- ;
- if (e.pageX || e.pageY) {
- $n = e.pageX;
- $o = e.pageY;
- }
- else {
- if (e.clientX || e.clientY) {
- $n = e.clientX;
- $o = e.clientY;
- if ($d.isIE) {
- if (document.body.scrollLeft > 0 || document.body.scrollTop > 0) {
- $n += document.body.scrollLeft;
- $o += document.body.scrollTop;
- }
- else {
- if (document.documentElement.scrollLeft > 0 || document.documentElement.scrollTop > 0) {
- $n += document.documentElement.scrollLeft;
- $o += document.documentElement.scrollTop;
- }
- }
- }
- }
- }
- ;
- var $p = 0;
- if ($d.isIE) {
- $p = document.body.clientWidth;
- }
- else {
- $p = self.innerWidth - 16;
- }
- ;
- var $q = true;
- if ($n >= $p || !$d.sentFullPixel) {
- $q = false;
- }
- ;
- if (($m.top >= 0 || $m.left >= 0) && $n > $m.left && $o > $m.top) {
- $n = '-' + ($n - $m.left);
- $o = '-' + ($o - $m.top);
- }
- ;
- if ($q && $d.heatmap == "1") {
- $d.executePlugin($d.getPluginConfig("heatmap", "before"));
- $d.quicksend($d.wtEscape($d.contentId.split(";")[0]) + "," + $n + "," + $o, '', "hm", "sendRequest");
- $d.executePlugin($d.getPluginConfig("heatmap", "after"));
- }
- };
- var webtrekkStartHeatmap = function () {
- if (typeof(wt_heatmap) != "undefined") {
- window.setTimeout("wt_heatmap()", 1000);
- }
- else {
- if (typeof($r) == "undefined") {
- $r = 0;
- }
- ;
- $r++;
- if ($r < 60) {
- window.setTimeout(function () {
- webtrekkStartHeatmap();
- }, 1000);
- }
- }
- };
- var webtrekkStartOverlay = function () {
- if (typeof(wt_overlay) != "undefined") {
- wt_overlay();
- }
- else {
- if (typeof($s) == "undefined") {
- $s = 0;
- }
- ;
- $s++;
- if ($s < 60) {
- window.setTimeout(function () {
- webtrekkStartOverlay();
- }, 1000);
- }
- }
- };
- var webtrekkFormTrackInstall = function () {
- $d.findForm();
- if (!$d.formObject) {
- return;
- }
- ;
- for (var j = 0; j < $d.formObject.elements.length; j++) {
- var e = $d.formObject.elements[j];
- $d.registerEvent(e, "focus", webtrekkFormFocus);
- }
- ;
- $d.registerEvent($d.formObject, "submit", webtrekkFormSubmit);
- $d.registerEvent(window, (($d.wtTypeof(window.onbeforeunload)) ? "beforeunload" : "unload"), webtrekkUnload);
- };
- var webtrekkFormSubmit = function (e) {
- if (!$d.form) {
- return;
- }
- ;
- if (e.target == $d.formObject || e.srcElement == $d.formObject) {
- $d.formSubmit = true;
- }
- };
- var webtrekkFormFocus = function (e) {
- var a = ((document.all && window.event !== null) ? window.event.srcElement : e.target);
- if (!a.name || a.type == "submit" || a.type == "image") {
- return;
- }
- ;
- if ($d.formObject) {
- $d.formFocus = a.name;
- }
- };
- var c = webtrekkConfig, $d = this;
- if (!$a) {
- var $a = c;
- }
- ;
- this.defaultAttribute =
- ["contentId",
- "linkId",
- "trackId",
- "trackDomain",
- "domain",
- "linkTrack",
- "linkTrackParams",
- "linkTrackPattern",
- "linkTrackReplace",
- "linkTrackDownloads",
- "linkTrackIgnorePattern",
- "customParameter",
- "crmCategory",
- "customClickParameter",
- "customSessionParameter",
- "customTimeParameter",
- "customCampaignParameter",
- "customEcommerceParameter",
- "orderValue",
- "currency",
- "orderId",
- "product",
- "productCost",
- "productQuantity",
- "productCategory",
- "productStatus",
- "customerId",
- "crmCategory",
- "contentGroup",
- "mediaCode",
- "mediaCodeValue",
- "mediaCodeCookie",
- "campaignId",
- "campaignAction",
- "internalSearch",
- "customSid",
- "customEid",
- "cookieDomain",
- "cookieEidTimeout",
- "cookieSidTimeout",
- "forceNewSession",
- "xwtip",
- "xwtua",
- "xwtrq",
- "mediaCodeFrames",
- "framesetReferrer",
- "forceHTTPS",
- "secureConfig",
- "heatmap",
- "pixelSampling",
- "form",
- "formFullContent",
- "formAnonymous",
- "disableOverlayView",
- "beforeSendinfoPixel",
- "afterSendinfoPixel",
- "beforeUnloadPixel",
- "afterUnloadPixel",
- "executePluginFunction",
- "sendOnUnload",
- "xlc",
- "xlct",
- "xlcv",
- "ignorePrerendering"];
- this.cookie = ($a.cookie) ? $a.cookie : (c.cookie) ? c.cookie : "3";
- this.optoutName = ($a.optoutName) ? $a.optoutName : (c.optoutName) ? c.optoutName : "webtrekkOptOut";
- this.paramFirst = ($a.paramFirst) ? $a.paramFirst : (c.paramFirst) ? c.paramFirst : "";
- this.plugins =
- ($a.plugins && $a.plugins != '') ? $a.plugins : (c.plugins && c.plugins != '') ? c.plugins :
- ['Adobe Acrobat', 'Windows Media Player', 'Shockwave Flash', 'RealPlayer', 'QuickTime', 'Java', 'Silverlight'];
- if (typeof(this.plugins) == "string") {
- this.plugins = this.plugins.split(";");
- }
- ;
- this.heatmapRefpoint = ($a.heatmapRefpoint) ? $a.heatmapRefpoint : (c.heatmapRefpoint) ? c.heatmapRefpoint : "wt_refpoint";
- this.linkTrackAttribute = ($a.linkTrackAttribute) ? $a.linkTrackAttribute : (c.linkTrackAttribute) ? c.linkTrackAttribute : "name";
- this.formAttribute = ($a.formAttribute) ? $a.formAttribute : (c.formAttribute) ? c.formAttribute : "name";
- this.formFieldAttribute = ($a.formFieldAttribute) ? $a.formFieldAttribute : (c.formFieldAttribute) ? c.formFieldAttribute : "name";
- this.formValueAttribute = ($a.formValueAttribute) ? $a.formValueAttribute : (c.formValueAttribute) ? c.formValueAttribute : "value";
- this.reporturl = ($a.reporturl) ? $a.reporturl : (c.reporturl) ? c.reporturl : 'report2.webtrekk.de/cgi-bin/wt';
- this.updateCookie = ($a.updateCookie) ? $a.updateCookie : (c.updateCookie) ? c.updateCookie : true;
- this.version = 323;
- this.deactivatePixel = false;
- this.deactivateRequest = false;
- this.optOut = false;
- this.eid = false;
- this.firstVisitContact = false;
- this.lastVisitContact = false;
- this.sampleCookieString = false;
- this.cookieOne = false;
- this.linktrackOut = false;
- this.linktrackNamedlinksOnly = true;
- this.ccParams = false;
- this.sentFullPixel = false;
- this.sentCampaignIds = {};
- this.wtEp = false;
- this.wtEpEncoded = false;
- this.trackingSwitchMediaCode = false;
- this.trackingSwitchMediaCodeValue = false;
- this.trackingSwitchMediaCodeTimestamp = false;
- this.heatmapOn = false;
- this.overlayOn = false;
- this.gatherFormsP = false;
- this.formObject = false;
- this.formName = false;
- this.formFocus = false;
- this.formSubmit = false;
- this.browserLang = false;
- this.config = false;
- this.unloadInstance = webtrekkUnloadObjects.length;
- this.plugin = {};
- this.pageCounter = 0;
- this.clickCounter = 0;
- this.linkCounter = 0;
- this.formCounter = 0;
- this.heatmapCounter = 0;
- this.browserLang = false;
- if (typeof(navigator.language) == "string") {
- this.browserLang = navigator.language.substring(0, 2);
- }
- else if (typeof(navigator.userLanguage) == "string") {
- this.browserLang = navigator.userLanguage.substring(0, 2);
- }
- ;
- this.jsonPara =
- {"ck": ["customClickParameter", {}], "cp": ["customParameter", {}], "cs": ["customSessionParameter", {}], "ce": ["customTimeParameter",
- {}], "cb": ["customEcommerceParameter", {}], "vc": ["crmCategory", {}], "ca": ["productCategory", {}], "cc": ["customCampaignParameter",
- {}], "cg": ["contentGroup", {}], "ct": ["linkId", ""], "ov": ["orderValue", ""], "cr": ["currency", ""], "oi": ["orderId",
- ""], "ba": ["product", ""], "co": ["productCost", ""], "qn": ["productQuantity", ""], "st": ["productStatus", ""], "cd": ["customerId",
- ""], "is": ["internalSearch", ""], "mc": ["campaignId", ""], "mca": ["campaignAction", ""], "sou": ["sendOnUnload", false]};
- this.generateDefaultConfig = function ($t, $u) {
- for (var i = 0; i < this.defaultAttribute.length; i++) {
- var a = this.defaultAttribute[i];
- this[a] = ($t[a]) ? $t[a] : ($u[a]) ? $u[a] : false;
- }
- };
- this.generateDefaultConfig($a, c);
- this.campaignAction = ($a.campaignAction) ? $a.campaignAction : (c.campaignAction) ? c.campaignAction : "click";
- this.getJSON = function (s) {
- if (s && s.charAt(0) == "{" && s.charAt(s.length - 1) == "}") {
- try {
- return eval("(" + s + ")");
- }
- catch (e) {
- return null;
- }
- }
- ;
- return null;
- };
- this.parseJSON = function (o, n) {
- for (var $v in o) {
- if (typeof(o[$v]) == "object") {
- if (typeof(this.jsonPara[$v]) != "undefined" && typeof(this.config[this.jsonPara[$v][0]]) != "object") {
- this.config[this.jsonPara[$v][0]] = this.jsonPara[$v][1];
- }
- ;
- this.parseJSON(o[$v], $v);
- continue;
- }
- ;
- if (n) {
- if (isNaN(parseInt($v)) || parseInt($v) < 500) {
- this.config[this.jsonPara[n][0]][$v] = o[$v];
- }
- }
- else {
- if (typeof(this.jsonPara[$v]) != "undefined") {
- this.config[this.jsonPara[$v][0]] = o[$v];
- }
- }
- }
- };
- this.getMappingParam = function (np) {
- var p = np.split(""), i, $w, $x, $y;
- for (i = 0; i < p.length; i++) {
- if (!isNaN(parseInt(p[i]))) {
- $w = i;
- break;
- }
- }
- ;
- if ($w) {
- $x = np.substr(0, $w);
- $y = np.substr($w, np.length - 1);
- }
- else {
- $x = np;
- }
- ;
- return{"mapping": ((typeof(this.jsonPara[$x]) != "undefined") ? this.jsonPara[$x][0] : false), "index": (($y) ? $y : false)};
- };
- this.getConfig = function (d) {
- var c = {};
- for (var i = 0; i < this.defaultAttribute.length; i++) {
- var a = this.defaultAttribute[i];
- c[a] = ((d) ? false : this[a]);
- }
- ;
- return c;
- };
- this.getRequestCounter = function ($c, $z) {
- var c = 0;
- if ($z == "before") {
- c++;
- }
- ;
- if ($c == "link") {
- this.linkCounter += c;
- return this.linkCounter;
- }
- else if ($c == "click") {
- this.clickCounter += c;
- return this.clickCounter;
- }
- else if ($c == "page") {
- this.pageCounter += c;
- return this.pageCounter;
- }
- else if ($c == "heatmap") {
- this.heatmapCounter += c;
- return this.heatmapCounter;
- }
- else if ($c == "form") {
- this.formCounter += c;
- return this.formCounter;
- }
- };
- this.getPluginConfig = function ($c, $z) {
- return{"instance": this, "mode": $c, "type": $z, "requestCounter": this.getRequestCounter($c, $z)};
- };
- this.checkAsynchron = function ($A, $B, $C, $D) {
- if (typeof(window[$A]) != "undefined") {
- if ($B) {
- $B(true, $C);
- }
- ;
- return;
- }
- else if ($D <= 0) {
- if ($B) {
- $B(false, $C);
- }
- ;
- return;
- }
- ;
- window.setTimeout(function () {
- $C.checkAsynchron($A, $B, $C, ($D - 100));
- }, 100);
- };
- this.loadAsynchron = function ($E, $A, $B, $D) {
- if (this.include($E)) {
- $B = ($B) ? $B : false;
- $D = ($D) ? $D : 2000;
- this.checkAsynchron($A, $B, this, $D);
- }
- };
- this.include = function (s) {
- if (!document.createElement) {
- return false;
- }
- ;
- var $F = document.getElementsByTagName('head').item(0);
- var js = document.createElement('script');
- js.setAttribute('language', 'javascript');
- js.setAttribute('type', 'text/javascript');
- js.setAttribute('src', s);
- $F.appendChild(js);
- return true;
- };
- this.executePlugin = function ($G) {
- if (!this.executePluginFunction || typeof(this.executePluginFunction) != "string") {
- return;
- }
- ;
- this.epf = false;
- var $H = this.executePluginFunction.split(";");
- for (var z = 0; z < $H.length; z++) {
- if (typeof(window[$H[z]]) == "function") {
- this.epf = window[$H[z]];
- this.epf($G);
- }
- }
- };
- this.indexOf = function (a, b, c) {
- return a.indexOf(b, c ? c : 0);
- };
- this.wtTypeof = function (v) {
- return((typeof(v) != "undefined") ? 1 : 0);
- };
- this.wtLength = function (a) {
- return((a != "undefined") ? a.length : 0);
- };
- this.getAttribute = function (o, a) {
- if (typeof(o.getAttribute(a)) == "string") {
- return o.getAttribute(a);
- }
- ;
- if (typeof(o.getAttribute(a)) == "object" && typeof(o.attributes[a]) == "object") {
- if (o.attributes[a] != null) {
- return o.attributes[a].nodeValue;
- }
- }
- ;
- return"";
- };
- this.getTimezone = function () {
- return Math.round((new Date().getTimezoneOffset() / 60) * (-1));
- };
- this.wtHref = function () {
- return this.wtLocation().href;
- };
- this.wtLocation = function () {
- var $I = document.location;
- if (!document.layers && document.getElementById) {
- try {
- $I = top.document.location;
- }
- catch (e) {
- $I = document.location;
- }
- }
- else {
- $I = top.document.location;
- }
- ;
- return $I;
- };
- this.getWebtrekkPath = function () {
- if (!document.layers && document.getElementById) {
- var $J = document.getElementsByTagName('script');
- for (var i = 0; i < $J.length; i++) {
- if ($J[i].src.match(/webtrekk[a-z|A-Z|0-9|_]*\.js/g)) {
- return $J[i].src.replace(/webtrekk[a-z|A-Z|0-9|_]*\.js/g, '');
- }
- }
- }
- ;
- return'';
- };
- this.isIE = this.indexOf(navigator.appName, "Microsoft") ? false : true;
- if (!this.isIE) {
- this.isOpera = this.indexOf(navigator.appName, "Opera") ? false : true;
- if (!this.isOpera) {
- this.isSafari = (navigator.vendor.toLowerCase().indexOf("apple") != -1) ? true : false;
- this.isChrome = (navigator.vendor.toLowerCase().indexOf("google") != -1) ? true : false;
- }
- }
- ;
- this.url2contentId = function ($I) {
- if (!$I) {
- return"no_content";
- }
- ;
- var tmp = new RegExp("//(.*)").exec($I);
- if (tmp.length < 1) {
- return"no_content";
- }
- ;
- var $K = tmp[1].split("?")[0].replace(/\./g, "_").replace(/\//g, ".").replace(/\.{2,}/g, ".").toLowerCase();
- return $K.split(";")[0];
- };
- this.contentId = ($a.contentId) ? $a.contentId : this.url2contentId(document.location.href);
- this.registerEvent = function ($L, e, f) {
- if ($L.addEventListener) {
- if (e == "webkitvisibilitychange") {
- this.unregisterEvent($L, e, f);
- }
- ;
- $L.addEventListener(e, f, false);
- }
- else {
- if ($L.attachEvent) {
- if (e == "beforeunload" || e == "webkitvisibilitychange") {
- this.unregisterEvent($L, e, f);
- }
- ;
- $L.attachEvent("on" + e, f);
- }
- }
- };
- this.unregisterEvent = function ($L, e, f) {
- if ($L.removeEventListener) {
- $L.removeEventListener(e, f, false);
- }
- else {
- if ($L.detachEvent) {
- $L.detachEvent("on" + e, f);
- }
- }
- };
- this.maxlen = function (v, l) {
- if (v && v.length > l) {
- return v.substring(0, l - 1);
- }
- ;
- return v;
- };
- this.wtEscape = function (u) {
- try {
- return encodeURIComponent(u);
- }
- catch (e) {
- return escape(u);
- }
- };
- this.wtUnescape = function (u) {
- try {
- return decodeURIComponent(u);
- }
- catch (e) {
- return unescape(u);
- }
- };
- this.decrypt = function (x) {
- var $M = "";
- if (x) {
- try {
- $M = this.wtUnescape(x.replace(/([0-9a-fA-F][0-9a-fA-F])/g, '%$1'));
- }
- catch (e) {
- }
- ;
- }
- ;
- return $M;
- };
- this.checkSC = function (x) {
- if (typeof(this.secureConfig) != 'string') {
- return false;
- }
- ;
- var sc = this.secureConfig.split(';');
- for (var i = 0; i < sc.length; i++) {
- if (sc[i] == x) {
- return true;
- }
- }
- ;
- return false;
- };
- this.zeroPad = function (n, $N) {
- var $O = "000000000000" + n;
- return $O.substring(($O.length - $N), $O.length);
- };
- this.generateEid = function () {
- return'2' + this.zeroPad(Math.floor(new Date().getTime() / 1000), 10) + this.zeroPad(Math.floor(Math.random() * 1000000), 8);
- };
- this.getexpirydate = function ($P) {
- var $Q;
- var $R = new Date();
- var $S = Date.parse($R);
- $R.setTime($S + $P * 60 * 1000);
- $Q = $R.toUTCString();
- return $Q;
- };
- this.setCookie = function (name, $T, $U) {
- var d = location.hostname;
- var $V = "^[0-9]{1,3" + String.fromCharCode(125) + "\.[0-9]{1,3" + String.fromCharCode(125) + "\.[0-9]{1,3" + String.fromCharCode(125)
- + "\.[0-9]{1,3" + String.fromCharCode(125) + "$";
- if (d.search($V) == -1) {
- d = location.hostname.split(".");
- d = d[d.length - 2] + "." + d[d.length - 1];
- }
- ;
- var c, f = false;
- if (this.cookieDomain) {
- var cd = this.cookieDomain.split(";");
- for (var i = 0; i < cd.length; i++) {
- if (location.hostname.indexOf(cd[i]) != -1) {
- d = cd[i];
- f = true;
- break;
- }
- }
- }
- ;
- if (f && typeof($U) != "undefined" && $U) {
- c = name + "=" + escape($T) + ";domain=" + d + ";path=/;expires=" + this.getexpirydate($U);
- }
- else if (f) {
- c = name + "=" + escape($T) + ";path=/;domain=" + d;
- }
- else if (d.split('.')[0].length < 3 && typeof($U) != "undefined" && $U) {
- c = name + "=" + escape($T) + ";path=/;expires=" + this.getexpirydate($U);
- }
- else if (d.split('.')[0].length < 3) {
- c = name + "=" + escape($T) + ";path=/";
- }
- else if (typeof($U) != "undefined" && $U) {
- c = name + "=" + escape($T) + ";domain=" + d + ";path=/;expires=" + this.getexpirydate($U);
- }
- else {
- c = name + "=" + escape($T) + ";path=/;domain=" + d;
- }
- ;
- document.cookie = c;
- };
- this.getCookie = function ($W) {
- var $X = document.cookie.split(";");
- for (var i = 0; i < $X.length; i++) {
- var $Y = $X[i].substr(0, $X[i].indexOf("="));
- var $Z = $X[i].substr($X[i].indexOf("=") + 1);
- $Y = $Y.replace(/^\s+|\s+$/g, "");
- if ($Y == $W) {
- return unescape($Z);
- }
- }
- ;
- return"";
- };
- this.optOut = (this.getCookie(this.optoutName)) ? true : false;
- if (this.optOut) {
- this.deactivatePixel = true;
- }
- ;
- this.urlParam = function ($I, $00, $01) {
- if (!$I || $I == null) {
- return $01;
- }
- ;
- var p = new Array();
- if ($I.indexOf("?") > 0) {
- p = $I.split("?")[1].replace(/&/g, "&").split("#")[0].split("&");
- }
- ;
- for (var i = 0; i < p.length; i++) {
- if (p[i].indexOf($00 + "=") == 0) {
- return this.wtUnescape(p[i].substring($00.length + 1).replace(/\+/g, "%20"));
- }
- }
- ;
- return $01;
- };
- this.allUrlParam = function ($00, $01) {
- if (this.mediaCodeFrames && this.mediaCodeFrames != '') {
- var lf = this.mediaCodeFrames.split(";");
- for (var i = 0; i < lf.length; i++) {
- var $02 = false;
- eval("try { lFrame = eval(lf[i]) }catch(e){};");
- if ($02 && $02 != top && $02.location) {
- var $03 = this.urlParam($02.location.href, $00, $01);
- if ($03 != $01) {
- return $03;
- }
- }
- }
- ;
- return $01;
- }
- else {
- var topLocation = "";
- try {
- topLocation = top.location.href;
- }
- catch (e) {
- topLocation = document.location.href;
- }
- ;
- return this.urlParam(topLocation, $00, $01);
- }
- };
- this.linkTrackInit = function () {
- var $04 = false;
- for (var i = 0; i < webtrekkLinktrackObjects.length; i++) {
- if (this == webtrekkLinktrackObjects[i]) {
- $04 = true;
- }
- }
- ;
- if (!$04) {
- webtrekkLinktrackObjects.push(this);
- }
- ;
- if (this.linkTrack && this.linkTrack == "link") {
- this.linktrackNamedlinksOnly = false;
- }
- ;
- for (var c = 0; c < document.links.length; c++) {
- var name = this.getAttribute(document.links[c], this.linkTrackAttribute);
- var $05 = this.getAttribute(document.links[c], "href");
- if ((this.linkTrackIgnorePattern && $05.search(this.linkTrackIgnorePattern) == -1) || !this.linkTrackIgnorePattern) {
- if ((name || !this.linktrackNamedlinksOnly) && typeof(document.links[c].wt_marked) == "undefined") {
- document.links[c].wt_marked = true;
- this.registerEvent(document.links[c], 'mousedown', webtrekkLinktrack);
- }
- }
- }
- };
- if (this.linkTrack) {
- this.linkTrackInit();
- }
- ;
- this.getCCParams = function (a) {
- var p = '';
- if (this.config.customClickParameter) {
- var $06 = (this.config.customClickParameter[this.getAttribute(a, "name")]) ?
- this.config.customClickParameter[this.getAttribute(a, "name")] : this.config.customClickParameter[a.id];
- if (!$06) {
- $06 = this.config.customClickParameter;
- }
- ;
- for (var z in $06) {
- if (!isNaN(z) && this.wtTypeof($06[z]) && typeof($06[z]) == 'string' && $06[z] != '') {
- if (this.checkSC('custom')) {
- $06[z] = this.decrypt($06[z]);
- }
- ;
- p += '&ck' + z + '=' + this.wtEscape($06[z]);
- }
- }
- }
- ;
- this.ccParams = p;
- return;
- };
- this.plugInArray = function ($07, $08) {
- if (typeof($07) != 'object') {
- return false;
- }
- ;
- for (var i = 0; i < $07.length; i++) {
- var $09 = new RegExp($07[i].toLowerCase(), 'g');
- if ($08.toLowerCase().search($09) != -1) {
- return $07[i];
- }
- }
- ;
- return false;
- };
- this.quicksend = function ($0a, $0b, $0c, $0d) {
- if (!this.trackDomain || !this.trackId || this.deactivatePixel || this.deactivateRequest) {
- this.deactivateRequest = false;
- return;
- }
- ;
- if (!$0c) {
- $0c = "wt";
- }
- ;
- if (typeof(this.requestTimeout) == "undefined") {
- this.requestTimeout = 5;
- }
- ;
- if (this.cookie == "1") {
- $0b = "&eid=" + this.eid + "&one=" + (this.cookieOne ? "1" : "0") + "&fns=" + (this.forceNewSession ? "1" : "0") + $0b;
- }
- ;
- if (this.cookie != "1" && (this.wtTypeof(this.cookieEidTimeout) || this.wtTypeof(this.cookieSidTimeout))) {
- if (this.wtTypeof(this.cookieEidTimeout) && this.cookieEidTimeout != '') {
- $0b = "&cet=" + this.cookieEidTimeout + $0b;
- }
- ;
- if (this.wtTypeof(this.cookieSidTimeout) && this.cookieSidTimeout != '') {
- $0b = "&cst=" + this.cookieSidTimeout + $0b;
- }
- }
- ;
- if (this.pixelSampling > 0) {
- $0b += "&ps=" + this.pixelSampling;
- }
- ;
- $0b = "&tz=" + this.getTimezone() + $0b;
- var $0e = "//" + this.trackDomain + "/" + this.trackId + "/" + $0c + "?p=" + this.version + "," + $0a + $0b + "&eor=1";
- if (!this.ignorePrerendering && this.isChrome && typeof(document.webkitHidden) != "undefined") {
- if (typeof(this.prerendering) != "object") {
- this.prerendering = new Array();
- }
- ;
- if (document.webkitHidden) {
- this.prerendering.push($0e);
- var pi = this;
- this.registerEvent(document, "webkitvisibilitychange", function () {
- pi.sendPrerendering();
- });
- return;
- }
- }
- ;
- if ($0d == "saveRequest" && this.cookie == "3") {
- if (this.getCookie("saveRequestV3")) {
- this.setCookie("saveRequestV3", this.getCookie("saveRequestV3") + "<<>>" + $0e, this.requestTimeout);
- }
- else {
- this.setCookie("saveRequestV3", $0e, this.requestTimeout);
- }
- }
- else {
- this.sendPixel($0e, $0c);
- }
- ;
- if ($0c != 'hm') {
- this.cookieOne = false;
- this.forceNewSession = false;
- this.sentFullPixel = 1;
- }
- };
- this.sendPrerendering = function () {
- if (!document.webkitHidden) {
- for (var i = 0; i < this.prerendering.length; i++) {
- this.sendPixel(this.prerendering[i]);
- }
- ;
- this.prerendering = new Array();
- }
- };
- this.sendPixel = function ($I, $0c) {
- var $0f = (document.location.protocol == "https:" ? "https:" : "http:");
- if (this.forceHTTPS) {
- $0f = "https:";
- }
- ;
- $I = $0f + $I;
- if ($0c == "hm") {
- $I += "&hm_ts=" + new Date().getTime();
- }
- ;
- if (!this.wtTypeof($0g)) {
- var $0g = new Array();
- }
- ;
- var ii = $0g.length;
- $0g[ii] = new Image();
- $0g[ii].onload = function () {
- return;
- };
- $0g[ii].src = $I;
- };
- this.checkCustomParameter = function (cp, np) {
- var p = "";
- if (typeof(cp) == 'object') {
- for (var z in cp) {
- if (!isNaN(z) && this.wtTypeof(cp[z]) && typeof(cp[z]) == 'string' && cp[z] != '') {
- if (this.checkSC('custom')) {
- cp[z] = this.decrypt(cp[z]);
- }
- ;
- if (this.paramFirst.indexOf(np + z + ';') == -1) {
- p += '&' + np + z + '=' + this.wtEscape(cp[z]);
- }
- }
- }
- }
- ;
- return p;
- };
- this.send = function (p, $c, ep) {
- if ($c == "link" || $c == "click") {
- this.config.linkId = p;
- }
- ;
- this.config.contentId = (this.config.contentId) ? this.config.contentId : this.contentId;
- var $0h = ($c && ($c == "link" || $c == "click")) ? this.config.contentId : (p) ? p : this.config.contentId;
- if (!$0h) {
- $0h = "no_content";
- }
- ;
- var $0i = "";
- var $0j = this.wtEscape($0h) + ",1,";
- $0j += this.baseparams();
- var $0k = navigator.plugins.length;
- var $0l = "";
- if ($0k > 0) {
- var $0m = Array();
- for (var i = 0; i < $0k; i++) {
- if (navigator.plugins && navigator.appName != 'Microsoft Internet Explorer') {
- if (navigator.plugins[i].name == "Shockwave Flash") {
- $0l = navigator.plugins[i].description;
- }
- else {
- $0l = navigator.plugins[i].name;
- }
- ;
- var $0n = this.plugInArray(this.plugins, $0l);
- if ($0n && !this.plugInArray($0m, $0n)) {
- $0m.push($0n);
- }
- }
- }
- ;
- $0l = $0m.join("|");
- }
- ;
- if (this.paramFirst) {
- var $0o = this.paramFirst.split(";");
- for (var i = 0; i < $0o.length; i++) {
- var $00 = this.getMappingParam($0o[i]);
- var $0p = $00.mapping;
- var $y = $00.index;
- if ($0p) {
- if ($y) {
- if (this.config[$0p] && typeof(this.config[$0p][$y]) != "undefined" && this.config[$0p][$y]) {
- $0i += "&" + $0o[i] + "=" + this.wtEscape(this.config[$0p][$y]);
- }
- }
- else if (this.config[$0p]) {
- $0i += "&" + $0o[i] + "=" + this.wtEscape(this.config[$0p]);
- }
- }
- }
- }
- ;
- if (typeof(ep) == "string" && ep != "") {
- ep = ep.split(/;/);
- for (var z = 0; z < ep.length; z++) {
- if (this.wtTypeof(ep[z])) {
- $h = ep[z].split(/=/);
- if (this.checkSC('custom')) {
- $h[1] = this.decrypt($h[1]);
- }
- ;
- $h[1] = this.wtEscape($h[1]);
- $0i += '&' + $h[0] + '=' + $h[1];
- }
- }
- }
- else {
- this.wtEpEncoded = false;
- var $0q = this.checkCustomParameter(this.config.customParameter, "cp");
- var $0r = this.checkCustomParameter(this.config.customSessionParameter, "cs");
- var $0s = this.checkCustomParameter(this.config.customTimeParameter, "ce");
- var $0t = this.checkCustomParameter(this.config.customEcommerceParameter, "cb");
- if (this.config.orderValue) {
- if (this.paramFirst.indexOf("ov;") == -1) {
- if (this.checkSC('order')) {
- $0i += "&ov=" + this.wtEscape(this.decrypt(this.config.orderValue));
- }
- else {
- $0i += "&ov=" + this.wtEscape(this.config.orderValue);
- }
- }
- }
- ;
- if (this.config.currency) {
- if (this.paramFirst.indexOf("cr;") == -1) {
- if (this.checkSC('order')) {
- $0i += "&cr=" + this.wtEscape(this.decrypt(this.config.currency));
- }
- else {
- $0i += "&cr=" + this.wtEscape(this.config.currency);
- }
- }
- }
- ;
- if (this.config.orderId) {
- if (this.paramFirst.indexOf("oi;") == -1) {
- $0i += "&oi=" + this.wtEscape(this.config.orderId);
- }
- }
- ;
- if (this.config.product) {
- if (this.paramFirst.indexOf("ba;") == -1) {
- $0i += "&ba=" + this.wtEscape(this.config.product);
- }
- ;
- if (this.config.productCost) {
- if (this.paramFirst.indexOf("co;") == -1) {
- $0i += "&co=" + this.wtEscape(this.config.productCost);
- }
- }
- ;
- if (this.config.productQuantity) {
- if (this.paramFirst.indexOf("qn;") == -1) {
- $0i += "&qn=" + this.wtEscape(this.config.productQuantity);
- }
- }
- ;
- $0i += this.checkCustomParameter(this.config.productCategory, "ca");
- if (this.config.productStatus) {
- if (this.paramFirst.indexOf("st;") == -1) {
- $0i += "&st=" + this.wtEscape(this.config.productStatus);
- }
- }
- }
- ;
- var customerId = $0u("wt_cd", "(.*)");
- if (!this.config.customerId) {
- this.config.customerId = customerId;
- }
- ;
- if (this.config.customerId) {
- if (this.paramFirst.indexOf("cd;") == -1) {
- $0i += "&cd=" + this.wtEscape(this.config.customerId);
- }
- }
- ;
- $0i += this.checkCustomParameter(this.config.crmCategory, "vc");
- if (this.browserLang) {
- $0i += "&la=" + this.wtEscape(this.browserLang);
- }
- ;
- $0i += this.checkCustomParameter(this.config.contentGroup, "cg");
- var $0v = '';
- if (this.config.campaignId) {
- if (!(this.config.campaignId in this.sentCampaignIds)) {
- if (this.paramFirst.indexOf("mc;") == -1) {
- $0i += "&mc=" + this.wtEscape(this.config.campaignId);
- }
- }
- else {
- if (this.paramFirst.indexOf("mc;") == -1) {
- $0i += "&mc=" + this.wtEscape("ignore%3Dignore");
- }
- }
- ;
- if (this.paramFirst.indexOf("mca;") == -1) {
- $0i += "&mca=" + ((this.config.campaignAction) ? this.config.campaignAction.substring(0, 1) : "c");
- }
- ;
- this.sentCampaignIds[this.config.campaignId] = true;
- $0v += this.checkCustomParameter(this.config.customCampaignParameter, "cc");
- }
- ;
- if (this.trackingSwitchMediaCode) {
- $0i += "&tmc=" + this.wtEscape(this.trackingSwitchMediaCode);
- }
- ;
- if (this.trackingSwitchMediaCodeValue) {
- $0i += "&tmcv=" + this.wtEscape(this.trackingSwitchMediaCodeValue);
- }
- ;
- if (this.trackingSwitchMediaCodeTimestamp) {
- $0i += "&tmct=" + this.wtEscape(this.trackingSwitchMediaCodeTimestamp);
- }
- ;
- if (typeof($0w) == "object" && typeof($0w.trackingSwitchMediaCode) != "undefined") {
- $0i += "&tmc=" + this.wtEscape($0w.trackingSwitchMediaCode);
- }
- ;
- if (typeof($0w) == "object" && typeof($0w.trackingSwitchMediaCodeValue) != "undefined") {
- $0i += "&tmcv=" + this.wtEscape($0w.trackingSwitchMediaCodeValue);
- }
- ;
- if (typeof($0w) == "object" && typeof($0w.trackingSwitchMediaCodeTimestamp) != "undefined") {
- $0i += "&tmct=" + this.wtEscape($0w.trackingSwitchMediaCodeTimestamp);
- }
- ;
- var $0x = "";
- var $0y;
- if (typeof(wt_vt) != "undefined") {
- $0y = wt_vt;
- }
- ;
- if (!this.wtTypeof($0y)) {
- $0y = this.urlParam(location.href, 'wt_vt', false);
- }
- ;
- if ($0y) {
- var $0z = this.getCookie('wt_vt').split(";");
- for (var i = 0; i < $0z.length; i++) {
- if ($0z[i].indexOf($0y + 'v') != -1) {
- $0x = '&wt_vt=' + $0z[i].split('t')[0].split('v')[1];
- }
- }
- }
- ;
- if ($0x) {
- $0i += $0x;
- }
- ;
- if (this.config.internalSearch) {
- if (this.paramFirst.indexOf("is;") == -1) {
- $0i += "&is=" + this.wtEscape(this.maxlen(this.config.internalSearch, 255));
- }
- }
- ;
- if ($0q) {
- $0i += $0q;
- }
- ;
- if ($0v) {
- $0i += $0v;
- }
- ;
- if ($0s) {
- $0i += $0s;
- }
- ;
- if ($0t) {
- $0i += $0t;
- }
- ;
- if ($0r) {
- $0i += $0r;
- }
- ;
- if (this.wtTypeof(this.config.customSid) && this.config.customSid != '') {
- $0i += "&csid=" + this.config.customSid;
- }
- ;
- if (this.wtTypeof(this.config.customEid) && this.config.customEid != '') {
- $0i += "&ceid=" + this.config.customEid;
- }
- ;
- if (this.wtTypeof(this.config.xwtip) && this.config.xwtip != '') {
- $0i += "&X-WT-IP=" + this.wtEscape(this.config.xwtip);
- }
- ;
- if (this.wtTypeof(this.config.xwtua) && this.config.xwtua != '') {
- $0i += "&X-WT-UA=" + this.wtEscape(this.config.xwtua);
- }
- ;
- if (this.wtTypeof(this.config.xwtrq) && this.config.xwtrq != '') {
- $0i += "&X-WT-RQ=" + this.wtEscape(this.config.xwtrq);
- }
- ;
- if (!this.sentFullPixel && this.firstVisitContact) {
- $0i += "&fvc=" + this.firstVisitContact;
- }
- ;
- if (!this.sentFullPixel && this.lastVisitContact) {
- $0i += "&lvc=" + this.lastVisitContact;
- }
- }
- ;
- if (this.config.linkId && this.config.customClickParameter) {
- var $06 = (this.config.customClickParameter[this.config.linkId]) ? this.config.customClickParameter[this.config.linkId] :
- this.config.customClickParameter;
- $0i += this.checkCustomParameter($06, "ck");
- this.ccParams = false;
- }
- ;
- if (this.config.xlc && this.config.xlct) {
- if (this.config.xlc != "" || this.config.xlct != "") {
- if (this.config.xlcv) {
- var $0A = this.getExtLifeCycles(this.config.xlc, this.config.xlct, this.config.xlcv);
- }
- else {
- var $0A = this.getExtLifeCycles(this.config.xlc, this.config.xlct);
- }
- ;
- $0i += $0A;
- }
- }
- ;
- if (this.config.linkId && this.config.sendOnUnload) {
- this.wtEp = $0i;
- this.wtEpEncoded = true;
- if (this.isChrome || this.isOpera || this.isSafari) {
- webtrekkUnload('noForm', "link");
- }
- else {
- this.registerEvent(window, (this.isIE && this.wtTypeof(window.onbeforeunload)) ? "beforeunload" : "unload", webtrekkUnload);
- }
- ;
- return;
- }
- else if (this.config.linkId) {
- this.wtEp = $0i;
- this.wtEpEncoded = true;
- webtrekkUnload('noForm', "click");
- return;
- }
- else if (!this.config.contentId && !this.config.linkId) {
- this.config.contentId = this.contentId;
- this.config.linkId = "wt_ignore";
- this.wtEp = $0i;
- this.wtEpEncoded = true;
- webtrekkUnload('noForm', "click");
- return;
- }
- else if (this.config.sendOnUnload) {
- this.wtEp = $0i;
- this.wtEpEncoded = true;
- if (this.isChrome || this.isOpera || this.isSafari) {
- webtrekkUnload('noForm', "link");
- }
- else {
- this.registerEvent(window, (this.isIE && this.wtTypeof(window.onbeforeunload)) ? "beforeunload" : "unload", webtrekkUnload);
- }
- ;
- return;
- }
- ;
- if (this.cookie == "1") {
- if (this.cookieOne) {
- $0i += "&np=" + this.wtEscape($0l);
- }
- }
- else {
- $0i += "&np=" + this.wtEscape($0l);
- }
- ;
- this.quicksend($0j, $0i, false, "sendRequest");
- };
- this.sendinfo = function (c, p, $c, ep) {
- if (this.cookie == "1" && !this.optOut && !this.deactivatePixel) {
- this.firstParty();
- }
- ;
- if (location.href.indexOf('fb_xd_fragment') != -1) {
- return;
- }
- ;
- if (typeof(c) == 'object') {
- this.config = c;
- }
- else {
- this.config = this.getConfig();
- }
- ;
- if (!this.config.campaignId && this.mediaCode) {
- this.getMediaCode();
- }
- ;
- if (this.getCookie("saveRequestV3")) {
- var $0B = this.getCookie("saveRequestV3").split("<<>>");
- for (var i = 0; i < $0B.length; i++) {
- this.sendPixel($0B[i], "wt");
- }
- ;
- this.setCookie("saveRequestV3", "", -3600);
- }
- ;
- if (this.beforeSendinfoPixel != false) {
- this.beforeSendinfoPixel();
- }
- else {
- this.executePlugin(this.getPluginConfig(($c) ? $c : "page", "before"));
- }
- ;
- if (this.contentId != "" || p != "" || document.layers) {
- this.send(p, $c, ep);
- }
- ;
- if (this.afterSendinfoPixel != false) {
- this.afterSendinfoPixel();
- }
- else {
- this.executePlugin(this.getPluginConfig(($c) ? $c : "page", "after"));
- }
- };
- this.sendinfo_media = function ($0C, mk, $0D, $0E, mg, bw, $0F, $0G) {
- if (this.wtTypeof($0H)) {
- $0H($0C, mk, $0D, $0E, mg, bw, $0F, $0G, this.unloadInstance);
- }
- };
- this.getExtLifeCycles = function (xlc, xlct, xlcv) {
- var $0I = "";
- var $0J = new Object();
- var $0K = xlc.split("|");
- for (var i = 0; i < $0K.length; i++) {
- var $0L = $0K[i].split(";");
- for (var j = 0; j < $0L.length; j++) {
- if (j == 0) {
- $0I += this.wtEscape($0L[j]);
- }
- else {
- $0I += $0L[j];
- }
- ;
- $0I += ";";
- }
- ;
- $0I = $0I.substr(0, $0I.length - 1);
- $0I += "|";
- }
- ;
- $0I = $0I.substr(0, $0I.length - 1);
- $0J.xlcl = this.wtEscape(xlc.split("|").length);
- $0J.xlct = this.wtEscape(xlct);
- if (typeof(xlcv) != "undefined") {
- $0J.xlcv = this.wtEscape(xlcv);
- }
- ;
- $0J.xlc = this.wtEscape($0I);
- var $0b = "";
- for (i in $0J) {
- $0b += "&" + i + "=" + $0J[i];
- }
- ;
- return $0b;
- };
- this.isOwnDomain = function (l) {
- var pt = '';
- if (this.domain) {
- if (this.domain.toUpperCase().indexOf("REGEXP:") == 0) {
- pt = new RegExp(this.domain.substring(7), "i");
- if (pt.test(this.getDomain(l))) {
- return true;
- }
- }
- else {
- var $0M = this.domain.split(';');
- var $0N = this.getDomain(l);
- for (var i = 0; i < $0M.length; i++) {
- if ($0N == $0M[i]) {
- return true;
- }
- }
- }
- }
- else {
- return false;
- }
- ;
- return false;
- };
- this.getDomain = function (l) {
- if (typeof(l) != 'string') {
- return'';
- }
- ;
- l = this.wtUnescape(l);
- l = l.split('://')[1];
- var rx = new RegExp('^(?:[^\/]+:\/\/)?([^\/:]+)', 'g');
- if (typeof(l) != "undefined") {
- l = l.match(rx);
- if (l[0]) {
- return l[0].toLowerCase();
- }
- }
- ;
- return'';
- };
- var $0O = function () {
- var $0P = 0, $0Q = $0u("wt_ref", "(.*)");
- if ($d.framesetReferrer) {
- $0P = $d.wtEscape($d.framesetReferrer);
- }
- else if ($d.getCookie("wt_ref") != "") {
- $0P = $d.wtEscape($d.getCookie("wt_ref"));
- $d.setCookie("wt_ref", "", -3600);
- }
- else if ($0Q) {
- $0P = $d.wtEscape($0Q);
- }
- else {
- if (document.referrer.length > 0) {
- $0P = $d.wtEscape(document.referrer);
- }
- }
- ;
- if ($d.sentFullPixel) {
- $0P = "2";
- }
- else if ($d.isOwnDomain($0P)) {
- $0P = "1";
- }
- ;
- return $0P;
- };
- var $0R = function () {
- var $0S = 0;
- if (!document.layers && document.getElementById) {
- try {
- $0S = top.window.innerHeight;
- }
- catch (e) {
- }
- ;
- }
- else {
- $0S = top.window.innerHeight;
- }
- ;
- if (!$0S) {
- try {
- $0S = top.document.documentElement.clientHeight;
- }
- catch (e) {
- }
- ;
- }
- ;
- if (!$0S) {
- try {
- $0S = top.document.body.clientHeight;
- }
- catch (e) {
- }
- ;
- }
- ;
- if (typeof($0S) == 'undefined') {
- $0S = -1;
- }
- ;
- return $0S;
- };
- var $0T = function () {
- var $0U = 0;
- if (!document.layers && document.getElementById) {
- try {
- $0U = top.window.innerWidth;
- }
- catch (e) {
- }
- ;
- }
- else {
- $0U = top.window.innerWidth;
- }
- ;
- if (!$0U) {
- try {
- $0U = top.document.documentElement.clientWidth;
- }
- catch (e) {
- }
- ;
- }
- ;
- if (!$0U) {
- try {
- $0U = top.document.body.clientWidth;
- }
- catch (e) {
- }
- ;
- }
- ;
- if (typeof($0U) == 'undefined') {
- $0U = -1;
- }
- ;
- return $0U;
- };
- this.baseparams = function () {
- var $0V = screen.width + "x" + screen.height + "," + (navigator.appName != 'Netscape' ? screen.colorDepth : screen.pixelDepth) + ",";
- $0V +=
- ((navigator.cookieEnabled == true) ? "1," :
- ((navigator.cookieEnabled == false) ? "0," : ((document.cookie.indexOf("=") != -1) ? "1," : "0,")));
- $0V += new Date().getTime() + ",";
- $0V += $0O();
- var $0S = $0R();
- var $0U = $0T();
- if ($0S && $0S > screen.height) {
- $0S = screen.height;
- }
- ;
- if ($0U && $0U > screen.width) {
- $0U = screen.width;
- }
- ;
- $0V += "," + $0U + "x" + $0S;
- $0V += "," + (navigator.javaEnabled() ? "1" : "0");
- return $0V;
- };
- this.getMediaCode = function (mc) {
- if (!mc) {
- if (!this.mediaCode) {
- return false;
- }
- ;
- mc = this.mediaCode;
- }
- ;
- var v;
- if (this.mediaCodeValue) {
- v = this.mediaCodeValue.split(";");
- }
- ;
- var m = mc.split(";");
- this.config.campaignId = "";
- for (var i = 0; i < m.length; i++) {
- if (this.config.campaignId != "") {
- this.config.campaignId += ";";
- }
- ;
- if (this.mediaCodeCookie) {
- if (this.getCookie('wt_' + m[i].toLowerCase() + this.allUrlParam(m[i], "").toLowerCase()) == '') {
- this.config.campaignId += m[i] + this.wtEscape("=" + this.allUrlParam(m[i], ""));
- }
- else {
- this.config.campaignId += "ignore%3Dignore";
- }
- ;
- var $0W = '';
- if (this.mediaCodeCookie == 'eid') {
- $0W = 60 * 30 * 24 * 60;
- }
- ;
- this.setCookie('wt_' + m[i].toLowerCase() + this.allUrlParam(m[i], "").toLowerCase(), 1, $0W);
- }
- else {
- if (typeof(v) != "undefined" && typeof(v[i]) != "undefined" && v[i] != "") {
- this.config.campaignId += m[i] + this.wtEscape("=" + v[i]);
- }
- else if (this.allUrlParam(m[i], "") != "") {
- this.config.campaignId += m[i] + this.wtEscape("=" + this.allUrlParam(m[i], ""));
- }
- }
- }
- };
- this.searchContentIds = function () {
- var $0X = 0;
- var $04 = 0;
- this.contentIds = this.wtEscape(this.contentId.split(";")[0]);
- do {
- $0X++;
- var $0Y = this.urlParam(location.href, "wt_contentId" + $0X, false);
- if ($0Y) {
- this.contentIds += "&wt_contentId" + $0X + "=" + this.wtEscape($0Y);
- $04++;
- }
- } while ($04 >= $0X);
- };
- this.startHeatmapOrOverlay = function ($0f, $B) {
- this.searchContentIds();
- if (this.contentIds) {
- if (this.include(location.protocol + "//" + this.reporturl + "/" + $0f + ".pl?wt_contentId=" + this.contentIds + "&x="
- + new Date().getTime())) {
- if ($0f == "heatmap" && navigator.userAgent.indexOf('MSIE 6') != -1 && navigator.userAgent.indexOf('Windows NT 5.0') != -1) {
- alert("Click OK to start heatmap.");
- }
- ;
- if (document.readyState != "interactive" && document.readyState != "complete") {
- this.registerEvent(window, "load", $B);
- }
- else {
- $B();
- }
- }
- }
- };
- this.heatmapOn = (this.wtHref().indexOf("wt_heatmap=1") >= 0);
- this.overlayOn = (this.wtHref().indexOf("wt_overlay=1") >= 0 || document.cookie.indexOf("wt_overlay=1") >= 0);
- if (this.wtHref().indexOf("wt_overlay=0") >= 0) {
- this.overlayOn = false;
- this.setCookie("wt_overlay", "", -1);
- }
- ;
- var $0Z = false;
- for (i = 0; i < webtrekkHeatmapObjects.length; i++) {
- if (this == webtrekkHeatmapObjects[i]) {
- $0Z = true;
- }
- }
- ;
- if (!$0Z && this.heatmap && this.heatmap == "1") {
- webtrekkHeatmapObjects.push(this);
- this.registerEvent(document, "mousedown", webtrekkHeatmapClick);
- }
- ;
- if (this.heatmapOn && !this.disableOverlayView) {
- this.searchContentIds();
- this.startHeatmapOrOverlay("heatmap", webtrekkStartHeatmap);
- }
- ;
- if (this.overlayOn && !this.disableOverlayView) {
- this.searchContentIds();
- this.setCookie("wt_overlay", "1");
- this.startHeatmapOrOverlay("overlay", webtrekkStartOverlay);
- }
- ;
- this.setPixelSampling = function ($10) {
- if (!$10) {
- var $10 = this.pixelSampling;
- }
- ;
- var trackId = this.trackId.split(",")[0];
- var $11 = this.getCookie("wt3_sample").split(";");
- var $12 = false;
- for (var i = 0; i < $11.length; i++) {
- if (this.indexOf($11[i], trackId + "|" + $10) != -1) {
- $12 = true;
- }
- else {
- if (this.indexOf($11[i], trackId + "|") != -1) {
- $11[i] = "";
- }
- }
- }
- ;
- var $13 = 6;
- if (this.cookieEidTimeout) {
- $13 = this.cookieEidTimeout;
- }
- ;
- if (!$12) {
- if (Math && Math.random && parseInt(Math.random() * $10) == 0) {
- $11.push(trackId + "|" + $10 + "|1");
- }
- else {
- $11.push(trackId + "|" + $10 + "|0");
- }
- ;
- this.setCookie("wt3_sample", $11.join(";"), $13 * 30 * 24 * 60);
- $11 = this.getCookie("wt3_sample");
- }
- else {
- $11 = $11.join(";");
- this.setCookie("wt3_sample", $11, $13 * 30 * 24 * 60);
- }
- ;
- if (this.indexOf($11, trackId + "|" + $10 + "|1") == -1) {
- this.deactivatePixel = true;
- }
- };
- if (this.pixelSampling && !this.optOut) {
- this.setPixelSampling();
- }
- ;
- var $0u = function ($00, $14) {
- var $15 = $d.urlParam(location.href, $00, false);
- var $16 = $d.urlParam(location.href, "wt_t", false);
- var $17 = new Date().getTime();
- var $18 = new RegExp($14);
- if ($16) {
- $16 = parseInt($16) + (15 * 60 * 1000);
- }
- else {
- $16 = $17 - (15 * 60 * 1000);
- }
- ;
- if ($15 && $18.test($15) && $16 > $17) {
- return $15;
- }
- ;
- return false;
- };
- var $19 = function ($1a) {
- if ($1a && $1a.substring(0, 1) == "2") {
- var $1b = parseInt($1a.substring(1, 11) + "000");
- var $1c = new Date($1b);
- var $1d = $1c.getFullYear();
- $1d += (($1c.getMonth() < 9) ? "0" : "");
- $1d += ($1c.getMonth() + 1);
- $1d += (($1c.getDate() < 9) ? "0" : "");
- $1d += $1c.getDate();
- $1d += (($1c.getHours() < 9) ? "0" : "");
- $1d += $1c.getHours();
- $1d += (($1c.getMinutes() < 9) ? "0" : "");
- $1d += $1c.getMinutes();
- return $1d;
- }
- ;
- return"";
- };
- this.firstParty = function () {
- var $1e = this.getCookie("wt3_sid").split(";");
- var $1f = this.getCookie("wt3_eid").split(";");
- var $13 = (this.cookieEidTimeout) ? this.cookieEidTimeout : 6;
- var trackId = this.trackId.split(",")[0];
- var $1g = false;
- var $1h = false;
- var $1i = false;
- var $1c = this.generateEid();
- for (var i = 0; i < $1e.length; i++) {
- if ($1e[i].indexOf(trackId) != -1) {
- $1g = i;
- break;
- }
- }
- ;
- for (var i = 0; i < $1f.length; i++) {
- if ($1f[i].indexOf(trackId + "|") != -1) {
- $1h = i;
- break;
- }
- }
- ;
- if (!$1g) {
- $1e.push(trackId);
- if ($1h) {
- this.forceNewSession = true;
- }
- }
- ;
- this.eid = $0u("wt_eid", "^[0-9]{19}$");
- if (!$1h) {
- if (!this.eid) {
- this.eid = this.generateEid();
- }
- ;
- this.cookieOne = true;
- $1f.push(trackId + "|" + this.eid + "#" + $1c);
- this.setCookie("wt3_eid", $1f.join(";"), $13 * 30 * 24 * 60);
- }
- else {
- if (this.eid) {
- $1f[$1h] = trackId + "|" + this.eid;
- this.updateCookie = true;
- }
- ;
- if ($1f[$1h].indexOf("#") == -1) {
- $1f[$1h] += "#" + $1c;
- }
- ;
- $1i = $1f[$1h].replace(trackId + "|", "").split("#")[1];
- this.eid = $1f[$1h].replace(trackId + "|", "").split("#")[0];
- $1f[$1h] = $1f[$1h].replace(/\#[0-9]{19}/g, "#" + $1c);
- if (this.updateCookie) {
- this.setCookie("wt3_eid", $1f.join(";"), $13 * 30 * 24 * 60);
- }
- }
- ;
- this.setCookie("wt3_sid", $1e.join(";"));
- if (!$1g) {
- this.firstVisitContact = $19(this.eid);
- if (this.updateCookie) {
- $1i = (($1i) ? $1i : $1c);
- this.lastVisitContact = $19($1i);
- }
- }
- };
- var $1k = false;
- for (i = 0; i < webtrekkUnloadObjects.length; i++) {
- if (this == webtrekkUnloadObjects[i]) {
- $1k = true;
- }
- }
- ;
- if (!$1k) {
- webtrekkUnloadObjects.push(this);
- }
- ;
- this.findForm = function () {
- if (!this.form || this.formObject) {
- return;
- }
- ;
- var f = document.forms;
- for (var i = 0; i < f.length; i++) {
- var cf = f[i];
- if (this.wtTypeof(cf.elements["wt_form"])) {
- this.formObject = cf;
- return;
- }
- }
- };
- this.checkFormFocus = function ($1l) {
- if ($1l == this.formFocus) {
- return 1;
- }
- ;
- return 0;
- };
- this.getFormFieldValue = function (ff) {
- var p = ff.name;
- if (this.formFieldAttribute) {
- p = '';
- var tmp = this.getAttribute(ff, this.formFieldAttribute);
- if (tmp || tmp !== null) {
- p = tmp;
- }
- }
- ;
- return p;
- };
- this.isFormFieldAnonym = function (ff) {
- var $1m = [];
- if (this.formFullContent) {
- $1m = this.formFullContent.split(";");
- }
- ;
- if (this.formAnonymous || (ff.type != "select-multiple" && ff.type != "select-one" && ff.type != "checkbox" && ff.type != "radio")) {
- for (var k = 0; k < $1m.length; k++) {
- if ($1m[k] == this.getFormFieldValue(ff)) {
- return false;
- }
- }
- ;
- return true;
- }
- ;
- return false;
- };
- this.getFieldValue = function (ff, e) {
- var $T = this.getAttribute(e, this.formValueAttribute).replace(/[\.|\;|\|]/g, "_");
- if (ff.type != "select-multiple" && ff.type != "select-one" && ff.type != "checkbox" && ff.type != "radio") {
- return this.maxlen(e.value, 30);
- }
- ;
- if (!this.isFormFieldAnonym(ff)) {
- return this.maxlen($T, 30);
- }
- ;
- return"anon";
- };
- this.gatherForm = function () {
- var $1n = ";";
- if (!this.formObject) {
- return;
- }
- ;
- var f = this.formObject;
- this.formName = this.getAttribute(f, this.formAttribute) ? this.getAttribute(f, this.formAttribute) : this.contentId.split(";")[0];
- var fl = "";
- if (this.wtTypeof(f.elements["wt_fields"])) {
- fl = f.elements["wt_fields"].value;
- }
- ;
- if (!fl) {
- for (var i = 0; i < f.elements.length; i++) {
- var e = f.elements[i];
- if (this.getFormFieldValue(e)) {
- fl += this.getFormFieldValue(e) + $1n;
- }
- }
- ;
- fl = fl.substring(0, fl.lastIndexOf($1n));
- }
- ;
- var $1o = fl.split($1n);
- var $1p = $1o.length;
- var pa = "";
- var $1q = {}, $1r = false;
- for (var i = 0; i < f.elements.length; i++) {
- var e = f.elements[i], $T, $1s, $1t, $1u = false;
- if (fl) {
- for (var j = 0; j < $1p; j++) {
- if (this.getFormFieldValue(e) == $1o[j]) {
- $1u = true;
- }
- }
- }
- else {
- if (this.getFormFieldValue(e)) {
- $1u = true;
- }
- }
- ;
- if ($1u) {
- $T = null;
- if (e.type == 'select-multiple') {
- for (var j = 0; j < e.options.length; j++) {
- var $04 = false;
- if (e.options[j].selected) {
- $04 = true;
- pa +=
- ";" + this.getFormFieldValue(e).replace(/[\.|\;|\|]/g, "_") + "." + e.type + "|" + this.getFieldValue(e,
- e.options[j]) + "|" + this.checkFormFocus(e.name);
- }
- ;
- if (!$04) {
- $T = "empty";
- }
- }
- }
- else if (e.type == 'select-one') {
- if (e.selectedIndex != -1) {
- $T = this.getFieldValue(e, e.options[e.selectedIndex]);
- if (!$T) {
- $T = "empty";
- }
- }
- }
- else if (e.type == 'checkbox' || e.type == 'radio') {
- if (!e.checked) {
- $T = "empty";
- }
- else {
- $T = this.getFieldValue(e, e);
- }
- }
- else {
- if (e.type != "hidden" && e.type != "button" && e.type != "image" && e.type != "reset" && e.type != "submit") {
- $T = (this.getFieldValue(e, e) ? "filled_out" : "empty");
- if (!this.isFormFieldAnonym(e)) {
- $T = this.getFieldValue(e, e);
- }
- ;
- if (!$T) {
- $T = "empty";
- }
- }
- }
- ;
- if ($T) {
- name = this.getFormFieldValue(e).replace(/[\.|\;|\|]/g, "_");
- $1s = ";" + name + "." + e.type + "|";
- $1t = ((this.isFormFieldAnonym(e) && $T != "empty" && $T != "filled_out") ? "anon" : $T) + "|" + this.checkFormFocus(e.name);
- if (e.type == 'radio') {
- $1r = true;
- if (($1s in $1q)) {
- if ($1q[$1s].indexOf("empty") == 0) {
- $1q[$1s] = $1t;
- }
- ;
- continue;
- }
- ;
- $1q[$1s] = $1t;
- }
- else if (pa.indexOf($1s) == -1) {
- pa += $1s + $1t;
- }
- }
- }
- }
- ;
- if ($1r) {
- for (var $1v in $1q) {
- pa += $1v + $1q[$1v];
- }
- }
- ;
- if (pa) {
- pa = pa.substring(1);
- }
- ;
- return pa;
- };
- this.formTrackInstall = function (f) {
- if (f) {
- this.formObject = f;
- }
- else {
- this.formObject = (document.forms[0]) ? document.forms[0] : false;
- }
- ;
- if (this.formObject) {
- this.form = "1";
- webtrekkFormTrackInstall();
- }
- };
- if (this.form) {
- webtrekkFormTrackInstall();
- }
- ;
- this.cookieManager = function (name, $1w, $1x) {
- var i, j;
- this.name = name;
- this.keySeperator = "~";
- this.fieldSeparator = "#";
- this.durationSeperator = "|";
- this.found = false;
- this.expires = $1w;
- this.accessPath = $1x;
- this.rawValue = "";
- this.fields = [];
- this.fieldsDuration = [];
- this.fieldnames = [];
- this.read = function () {
- var $A = this.name + "=";
- var $1y = document.cookie;
- this.rawValue = null;
- this.found = false;
- if ($1y.length > 0) {
- $1z = $1y.indexOf($A);
- if ($1z != -1) {
- $1z += $A.length;
- end = $1y.indexOf(";", $1z);
- if (end == -1) {
- end = $1y.length;
- }
- ;
- this.rawValue = $1y.substring($1z, end);
- this.found = true;
- }
- }
- ;
- if (this.rawValue != null) {
- var sl = this.rawValue.length;
- var $1A = 0;
- var $1B = 0;
- var i = 0;
- do {
- $1B = this.rawValue.indexOf(this.fieldSeparator, $1A);
- if ($1B != -1) {
- var $1C = this.rawValue.substring($1A, $1B).split(this.durationSeperator);
- var rV = $1C[0].split(this.keySeperator);
- this.fields[rV[0]] = unescape(rV[1]);
- this.fieldsDuration[rV[0]] = parseInt(unescape($1C[1]));
- i++;
- $1A = $1B + 1;
- }
- } while ($1B != -1 & $1B != (this.rawValue.length - 1));
- }
- ;
- return this.found;
- };
- this.getSize = function () {
- var $1D = new Date().getTime();
- var $1E = "";
- for (i in this.fields) {
- if (this.fieldsDuration[i] >= $1D) {
- $1E +=
- escape(i) + this.keySeperator + escape(this.fields[i]) + this.durationSeperator + escape(this.fieldsDuration[i])
- + this.fieldSeparator;
- }
- }
- ;
- return $1E.length;
- };
- this.write = function () {
- var $1D = new Date().getTime();
- var $1F = true;
- var $1E = this.name + "=";
- for (i in this.fields) {
- if (this.fieldsDuration[i] >= $1D) {
- $1E +=
- escape(i) + this.keySeperator + escape(this.fields[i]) + this.durationSeperator + escape(this.fieldsDuration[i])
- + this.fieldSeparator;
- $1F = false;
- }
- }
- ;
- var $1G = ($1F) ? -99999 : this.expires;
- if ($1G != "") {
- if (typeof($1G) == "number") {
- var $1H = new Date();
- var $1I = new Date();
- $1I.setTime($1H.getTime() + 1000 * 60 * 60 * 24 * $1G);
- $1E += "; expires=" + $1I.toGMTString();
- }
- else {
- $1E += "; expires=" + $1G.toGMTString();
- }
- }
- ;
- if (this.accessPath != null) {
- $1E += "; PATH=" + this.accessPath;
- }
- ;
- var d = location.hostname;
- var $V = "^[0-9]{1,3" + String.fromCharCode(125) + "\.[0-9]{1,3" + String.fromCharCode(125) + "\.[0-9]{1,3" + String.fromCharCode(125)
- + "\.[0-9]{1,3" + String.fromCharCode(125) + "$";
- if (d.search($V) == -1) {
- d = location.hostname.split(".");
- d = d[d.length - 2] + "." + d[d.length - 1];
- }
- ;
- $1E += "; DOMAIN=" + d;
- document.cookie = $1E;
- return null;
- };
- this.remove = function () {
- this.expires = -10;
- this.write();
- return this.read();
- };
- this.get = function ($1J) {
- var $1D = new Date().getTime();
- if (this.fieldsDuration[$1J] >= $1D) {
- return this.fields[$1J];
- }
- ;
- return"";
- };
- this.set = function ($1J, $1K, $U, $c, $1L) {
- if (!$U) {
- $U = 31536000;
- }
- ;
- if (!$c) {
- $c = "";
- }
- ;
- var $1D = new Date().getTime();
- if ($c == "first" && this.fields[$1J] != "" && this.fields[$1J] != null && this.fieldsDuration[$1J] >= $1D) {
- return this.fields[$1J];
- }
- ;
- this.fields[$1J] = $1K;
- this.fieldsDuration[$1J] = $1D + (parseInt($U) * 1000);
- if (!$1L) {
- this.write();
- }
- ;
- return $1K;
- };
- this.prepare = function ($1J, $1K, $U, $c) {
- this.set($1J, $1K, $U, $c, true);
- };
- this.read();
- };
- };
- var webtrekkPixel = false;
- function wt_sendinfo(p, mode, ep) {
- if (webtrekkPixel) {
- for (var i in webtrekk) {
- if (i != "plugins" && i != "sendinfo") {
- webtrekkPixel[i] = webtrekk[i];
- }
- }
- webtrekkPixel.sendinfo(false, p, mode, ep);
- }
- }
- if (typeof(webtrekk) == "object") {
- webtrekkConfig = webtrekk;
- webtrekkPixel = new webtrekkV3();
- if (typeof(wt_updatePixel) == "function") {
- wt_updatePixel();
- }
- if (webtrekk.sendinfo && webtrekk.sendinfo == '1') {
- webtrekkPixel.sendinfo();
- }
- }
- ;
- ;
- var ___b24 = ___b24 || {};
- ___b24.webtrekk = (function (window, $) {
- var tracking = B24_debug_status.getMode('tracking');
- var pub = {};
- var done = false;
- var init = function () {
- if (!tracking) {
- return false;
- }
- if (typeof(webtrekkV3) != 'function') {
- return false;
- }
- basicCall();
- };
- var DOMready = function () {
- if (done) {
- return false;
- }
- stopTrackingByConversionComment();
- if (!tracking) {
- return false;
- }
- if (typeof(wt) != 'object') {
- return false;
- }
- setUpWebtrekkDomReady();
- done = true;
- };
- pub.DOMready = DOMready;
- var stopTrackingByConversionComment = function () {
- var order = B24_order_object.getOrder();
- if (!!order && typeof(order.customer_comment) == 'string' && !!order.customer_comment.match(/\#test\#/i)) {
- tracking = false;
- }
- };
- var basicCall = function () {
- var contentID = '';
- window.pageConfig = {'linkTrack': "standard", 'heatmap': "0", 'form': "0", 'contentId': contentID};
- window.wt = new webtrekkV3(window.pageConfig);
- wt.domain =
- "REGEXP:^(.*smartassistant.*|www\.paypal\\.com|secure\\.ogone\\.com|www\\.sofort\\.com|www\\.gambio\\.de|asset.brille24\\..*|www\\.brille24\\..*)$";
- var query = collectEntryParams();
- if (!!query) {
- wt.mediaCode = 'ad;ad_cj;ad_zx;ad_sa;utm_campaign;ad_bel';
- wt.customCampaignParameter = {8: query};
- }
- };
- pub.pageView = function (page) {
- if (typeof(wt) == 'object') {
- wt.sendinfo({'contentId': page});
- }
- };
- var collectEntryParams = function () {
- var which = ['utm_source', 'utm_medium', 'simidb24', 'cidb24'];
- var what = false;
- $.each(which, function (index, value) {
- if (typeof($.getlocations().params[value]) == 'string') {
- what = what || {};
- what[value] = $.getlocations().params[value];
- }
- });
- if (!!what) {
- what = JSON.stringify(what);
- return what;
- }
- return false;
- };
- pub.collectEntryParams = collectEntryParams;
- var setUpWebtrekkDomReady = function () {
- var mageParams = B24_shoplocation.getMageParams();
- wt.customSessionParameter = {};
- if (!!mageParams.Q) {
- wt.customSessionParameter['1'] = mageParams.Q;
- }
- wt.customSessionParameter['2'] = mageParams.S;
- if (!!mageParams.C) {
- wt.customerId = mageParams.C;
- }
- var loc = B24_shoplocation.get();
- var order = B24_order_object.getOrder();
- if (loc == 'detail') {
- var product = B24_product_object.get();
- wt.product = product.name;
- wt.productCategory = {1: B24_shoplocation.getCategory()};
- wt.productQuantity = "1";
- wt.productCost = product.price;
- wt.productStatus = "view";
- wt.customEcommerceParameter = {1: '', 2: product.sku, 3: '', 4: ''};
- }
- else if (loc == 'cart') {
- var cart = B24_cart_object.getCart();
- if (B24_cart_object.getCartAction().action == 'add') {
- added_items = B24_cart_object.getCartAction().balance;
- var prods = [];
- var qtys = [];
- var costs = [];
- var skus = [];
- $.each(added_items, function (index, value) {
- prods.push(value.product_name.substr(0, 100));
- qtys.push(parseInt(value.qty_ordered));
- costs.push(value.netTotalItemSingleShipping);
- skus.push(value.product_sku);
- });
- wt.product = prods.join(';');
- wt.productQuantity = qtys.join(';');
- wt.productCost = costs.join(';');
- wt.productStatus = "add";
- wt.customEcommerceParameter = {1: mageParams.Q, 2: skus.join(';'), 3: '', 4: ''};
- }
- }
- else if (!!order) {
- var prods = [];
- var qtys = [];
- var costs = [];
- var skus = [];
- $.each(order.order_items, function (index, value) {
- prods.push(value.product_name.substr(0, 100));
- qtys.push(parseInt(value.qty_ordered));
- costs.push(value.netTotalItemShippment);
- skus.push(value.product_sku);
- });
- wt.product = prods.join(';');
- wt.productQuantity = qtys.join(';');
- wt.productCost = costs.join(';');
- wt.productStatus = "conf";
- wt.orderValue = order.payment.amount_ordered;
- wt.orderId = order.id;
- wt.customEcommerceParameter = {1: order.quoteID, 2: skus.join(';'), 3: '', 4: '', 5: B24_cpid_object.getCpid()};
- }
- else if (loc == 'checkout') {
- return false;
- }
- ___l(wt, 'webtrekk');
- wt.sendinfo();
- };
- init();
- $(DOMready);
- return pub;
- })(window, jQuery, undefined);
- ;
- ;
- var ___b24 = ___b24 || {};
- ___b24.channeladvisor = (function (window, $) {
- var pub = {};
- var tracking = B24_debug_status.getMode('tracking');
- var init = function () {
- if (!tracking) {
- return false;
- }
- window._caq = window._caq || [];
- var url = "//t.channeladvisor.com/v2/12012621.js";
- ___b24.loadscript.load(url);
- };
- var transAction = function () {
- if (!tracking) {
- return false;
- }
- var order = B24_order_object.getOrder();
- if (!order || !order.tracking) {
- return false;
- }
- window._caq = window._caq || [];
- var products = [];
- $.each(order.order_items, function (index, value) {
- products.push({Sku: value.product_sku_extended, UnitPrice: value.netTotalSingle, Quantity: value.qty_ordered});
- });
- var trans = ["Order", {OrderId: order.id, Revenue: order.payment.totalClean, CurrencyCode: 'EUR', Products: products}];
- ___l(trans, 'ChannelAdvisor');
- _caq.push(trans);
- };
- pub.transAction = transAction;
- init();
- return pub;
- })(window, jQuery, undefined);
- ;
- ;
- var ___b24 = ___b24 || {};
- ___b24.controlgroup = (function (window, $) {
- var pub = {}, storageName = '_b24a', tracking = B24_debug_status.getMode('tracking'), group = null, expTTL = 30;
- var get = function () {
- if (!tracking) {
- return false;
- }
- if (!!getStored()) {
- return getStored();
- }
- store(randomGroup());
- return getStored();
- };
- pub.get = get;
- var randomGroup = function () {
- return Math.random() * 10 > 5 ? 'A' : 'B';
- };
- var getStored = function () {
- if (group !== null) {
- return group;
- }
- group = $.cookie(storageName);
- return group
- };
- var store = function (s) {
- $.cookie(storageName, s, {'path': '/', 'expires': expTTL});
- };
- return pub;
- })(window, jQuery, undefined);
- ___b24.tracking = (function (window, $) {
- var pub = {}, tracking = B24_debug_status.getMode('tracking');
- debug = B24_debug_status.getMode('ga'), live = B24_debug_status.getMode('live');
- var init = function () {
- if (!tracking) {
- window.ga = function () {
- var empty = true;
- };
- return false;
- }
- setupGoogleAnalytics();
- };
- var domReady = function () {
- sendCartEvents();
- };
- var setupGoogleAnalytics = function () {
- var gaID = live ? 'UA-8525683-1' : 'UA-8525683-5';
- var fileexent = debug ? '_debug' : '';
- (function (i, s, o, g, r, a, m) {
- i['GoogleAnalyticsObject'] = r;
- i[r] = i[r] || function () {
- (i[r].q = i[r].q || []).push(arguments)
- }, i[r].l = 1 * new Date();
- a = s.createElement(o), m = s.getElementsByTagName(o)[0];
- a.async = 1;
- a.src = g;
- m.parentNode.insertBefore(a, m)
- })(window, document, 'script', '//www.google-analytics.com/analytics' + fileexent + '.js', 'ga');
- ga(function () {
- callback('start')
- });
- var uid = B24_customer_object.getCustomerId();
- if (!uid) {
- ga('create', gaID, 'auto');
- }
- else {
- ga('create', gaID, 'auto', {'userId': uid.toString()});
- }
- ga('set', 'anonymizeIp', true);
- ga('require', 'linkid', 'linkid.js', {'levels': 5});
- ga('require', 'displayfeatures');
- page();
- ga(function () {
- callback('end')
- });
- };
- var page = function (p) {
- if (!!p) {
- ga('send', 'pageview', p);
- return true;
- }
- var pageEr = checkErrorPage();
- if (pageEr.is) {
- ga('send',
- 'pageview',
- {'page': pageEr.where + '?page=' + document.location + '&from=' + document.referrer, 'title': pageEr.what + document.title});
- return true;
- }
- ga('send', 'pageview');
- return true;
- };
- pub.page = page;
- var checkErrorPage = function () {
- var a = {is: false, what: ''};
- if (!!document.title.match(/nicht gefunden/i)) {
- a = {is: true, what: 'ERROR_404::: ', where: '/404.html'};
- }
- return a;
- };
- var callback = function (a) {
- if (debug) {
- ___l('google analytics ' + a)
- }
- ;
- };
- var eCommerce = function () {
- if (!tracking) {
- return false;
- }
- var order = B24_order_object.getOrder();
- if (!order) {
- return false;
- }
- if (typeof(order.customer_comment) == 'string' && order.customer_comment.match(/\#test\#/i) != null) {
- return false;
- }
- ga('require', 'ecommerce', 'ecommerce.js');
- ga('ecommerce:addTransaction', {'id': order.id.toString(), 'revenue': order.payment.amount_ordered.toString(), 'shipping': '0', 'tax': '0'});
- $.each(order.order_items, function (key, value) {
- ga('ecommerce:addItem',
- {'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, });
- });
- ga('ecommerce:send');
- };
- pub.eCommerce = eCommerce;
- var sendCartEvents = function () {
- if (!tracking) {
- return false;
- }
- if (B24_shoplocation.get() == 'cart') {
- B24_cart_object.getCart();
- ga('send', 'event', 'Warenkorb', B24_cart_object.getCartStatus(), B24_cart_object.getCustomerStatus());
- }
- };
- var error = function (pos, err) {
- if (typeof(pos) != 'string' && typeof(pos) != 'number') {
- pos = 'ThereIsNoCorrectPosition';
- }
- pos += ':::' + location.pathname;
- if (!!!err) {
- err = 'undefined';
- }
- if ($.type(err) == 'error') {
- err = err.toString();
- }
- else if (typeof(err) == 'object') {
- err = JSON.stringify(err);
- }
- ga('send', 'event', 'JS-Errors', pos, err, {'nonInteraction': true});
- };
- pub.error = error;
- var PVevent = function (pos, content) {
- if (typeof(pos) != 'string' && typeof(pos) != 'number') {
- pos = 'ThereIsNoCorrectPosition';
- }
- if (!!!content) {
- content = 'undefined';
- }
- if ($.type(content) == 'error') {
- content = content.toString();
- }
- else if (typeof(content) == 'object') {
- content = JSON.stringify(content);
- }
- content = content.toString();
- ga('send', 'event', 'ProductView', pos, content, {'nonInteraction': true});
- };
- pub.PVevent = PVevent;
- var alert = function (pos, alertM) {
- if (typeof(pos) != 'string' && typeof(pos) != 'number') {
- pos = 'ThereIsNoCorrectPosition';
- }
- pos += ':::' + location.pathname;
- var quteID = '';
- if (typeof(B24_shoplocation) === 'object' && typeof(B24_shoplocation.getMageParams().Q) === 'string') {
- quteID = '#quoteID=' + B24_shoplocation.getMageParams().Q;
- }
- pos += quteID;
- if (!!!alertM) {
- alertM = 'undefined';
- }
- if (typeof(alertM) == 'object') {
- alertM = JSON.stringify(alertM);
- }
- alertM = alertM.substr(0, 60);
- ga('send', 'event', 'JS-Alert', pos, alertM, {'nonInteraction': true});
- };
- pub.alert = alert;
- var event = function (pos, evt) {
- if (typeof(pos) != 'string' && typeof(pos) != 'number') {
- pos = 'ThereIsNoCorrectPosition';
- }
- pos += ':::' + location.pathname;
- if (!!!evt) {
- evt = 'undefined';
- }
- if (typeof(evt) == 'object') {
- evt = JSON.stringify(evt);
- }
- evt = evt.substr(0, 60);
- ga('send', 'event', 'JS-Event', pos, evt, {'nonInteraction': true});
- };
- pub.event = event;
- var trackingEvent = function (pos, evt) {
- if (typeof(pos) != 'string' && typeof(pos) != 'number') {
- pos = 'ThereIsNoCorrectPosition';
- }
- pos += ':::' + location.pathname;
- if (!!!evt) {
- evt = 'undefined';
- }
- if (typeof(evt) == 'object') {
- evt = JSON.stringify(evt);
- }
- evt = evt.substr(0, 100);
- ga('send', 'event', 'TrackingEvents', pos, evt, {'nonInteraction': true});
- };
- pub.trackingEvent = trackingEvent;
- var freeEvent = function (name, pos, evt) {
- if (typeof(evt) == 'object') {
- evt = JSON.stringify(evt);
- }
- else if (typeof(evt) == 'undefined') {
- evt = location.pathname;
- }
- ga('send', 'event', name, pos, evt, {'nonInteraction': true});
- };
- pub.freeEvent = freeEvent;
- pub.search = function (searchPhrase) {
- pos = location.pathname;
- ga('send', 'event', 'Search', pos, {'nonInteraction': true});
- };
- $(domReady);
- init();
- return pub;
- })(window, jQuery, undefined);
- var ___b24 = ___b24 || {};
- ___b24.peak = (function (window, $) {
- var pub = {};
- var peak = false;
- var virgin = null;
- var connections = -1;
- 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];
- var init = function () {
- };
- var setVirgin = function () {
- $.cookie('___peakvir', '1', {path: '/'});
- };
- var getVirgin = function () {
- if (virgin != null) {
- return virgin;
- }
- if (!!$.cookie('___peakvir')) {
- virgin = false;
- }
- else {
- setVirgin();
- virgin = true;
- }
- return virgin;
- };
- var isPeakVirgin = function () {
- if (getVirgin() && isPeak()) {
- return true;
- }
- return false;
- };
- pub.isPeakVirgin = isPeakVirgin;
- var isPeak = function () {
- if (getConnections() > peakMap[new Date().getHours()]) {
- peak = true;
- }
- else {
- peak = false;
- }
- return peak;
- };
- pub.isPeak = isPeak;
- var isTVDirect = function () {
- if (!isPeakVirgin()) {
- return false;
- }
- if (!!$.getlocations().params.utm_source) {
- if (!!$.getlocations().params.utm_source.match(/^google|yahoo|bing$/i) && !!$.getlocations().params.utm_medium
- && $.getlocations().params.utm_medium == 'cpc') {
- return true;
- }
- else {
- return false;
- }
- }
- var ref = document.referrer;
- if (!!document.referrer.match(/^()|(google\.)|(yahoo\.)|(bing\.)$/i)) {
- return true;
- }
- var utmz = $.cookie('__utmz');
- if (!utmz) {
- utmz = '';
- }
- if (!!utmz.match(/(utmcmd=organic)|(utmcsr=googleutmcmd=cpc)/i)) {
- return true;
- }
- return false;
- };
- pub.isTVDirect = isTVDirect;
- var getConnections = function () {
- if (connections > -1) {
- return connections;
- }
- if (!!$.cookie('___peak')) {
- connections = $.cookie('___peak');
- }
- else {
- connections = 1;
- }
- return connections;
- };
- pub.getConnections = getConnections;
- var getTimeConnectionMaped = function () {
- var t = new Date().getHours();
- return{'t': t, 'connections': getConnections(), 'peakMap': peakMap[new Date().getHours()]};
- };
- pub.getTimeConnectionMaped = getTimeConnectionMaped;
- return pub;
- })(window, jQuery, undefined);
- var ___b24 = ___b24 || {};
- ___b24.analytics = (function (window, $) {
- var pub = {};
- var debug = B24_debug_status.getMode('ga');
- var tracking = B24_debug_status.getMode('tracking');
- var live = B24_debug_status.getMode('live');
- var done = false;
- var init = function () {
- setUpChartbeat();
- };
- var DOMready = function (fast) {
- if (done) {
- return false;
- }
- done = true;
- stopTrackingByConversionComment();
- $('body').append('<div id="dynamic"> </div>');
- ___b24.tracking.eCommerce();
- setUpDivolution();
- ___b24.trackRDE.track();
- ___b24.channeladvisor.transAction();
- setUpSociomantic();
- setUpEcomcon();
- setUpAdTelligence();
- setUpAdScale();
- if (typeof(fast) == 'boolean' && fast) {
- setTimeout(task, 1000);
- }
- else {
- task();
- }
- return true;
- };
- pub.DOMready = DOMready;
- var task = function () {
- setUpAdition();
- finalChartbeat();
- googleRemarketing();
- setUpZanoxMaster();
- selligent();
- setUpXplosion();
- setupBelboon();
- setUpYahooReMarketing();
- setUpZanox();
- setUpCommissionJunction();
- setUpUDMarin();
- setUpFacebookConversion();
- setUpEthno();
- latenzReady();
- return true;
- };
- var latenzReady = function () {
- setTimeout(function () {
- setUpUniqueDigital();
- }, 2000);
- };
- $(function () {
- sovendusGutscheinConnection();
- setUpTharuka();
- setUpSchutzKlick();
- });
- var stopTrackingByConversionComment = function () {
- var order = B24_order_object.getOrder();
- if (!!order && typeof(order.customer_comment) == 'string' && !!order.customer_comment.match(/\#test\#/i)) {
- tracking = false;
- }
- };
- var setUpAdScale = function () {
- if (!tracking) {
- return false;
- }
- try {
- window.adscaleProductViews = window.adscaleProductViews ? window.adscaleProductViews : [];
- 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';
- var loc = B24_shoplocation.get(), order = B24_order_object.getOrder(), cart = B24_cart_object.getCart();
- if (loc === 'homepage') {
- pixelName = 'Homepage';
- pages = ['homepage'];
- }
- else if (loc === 'listing') {
- pixelName = 'Category';
- pages = ['category'];
- categorys = [B24_shoplocation.getCategory(true)];
- }
- else if (loc === 'detail') {
- pixelName = 'Product';
- pages = ['product'];
- categorys = [B24_shoplocation.getCategory(true)];
- products = [B24_product_object.get().sku_extended_clean];
- }
- else if (loc == 'cart') {
- pixelName = 'basket';
- pages = ['basket'];
- if (!!cart) {
- products = [];
- $.each(cart.order_items, function (key, value) {
- products.push(value.product_sku_extended_clean);
- });
- }
- }
- else if (loc == 'success') {
- pixelName = 'Transaction';
- pages = ['transactions'];
- if (!!order) {
- products = [];
- $.each(order.order_items, function (key, value) {
- products.push(value.product_sku_extended_clean);
- });
- $dompart.attr({'data-pixelName': '1', 'data-accountId': 'ZTY1ODA'}).addClass('adscale-cpx');
- ___b24.loadscript.putDOM($dompart);
- ___b24.loadscript.load('//js.adscale.de/cpx-a.js');
- }
- else {
- return false;
- }
- }
- else {
- return false;
- }
- window.adscaleProductViews.push({"aid": asID, "productIds": products, "categoryIds": categorys, "pageTypes": pages, });
- ___l(window.adscaleProductViews, 'Adscale');
- ___b24.loadscript.load(url);
- $dompart.attr('data-pixelName', pixelName).addClass('adscale-rt');
- ___b24.loadscript.putDOM($dompart);
- ___b24.loadscript.load('//js.adscale.de/rt-a.js');
- return true;
- }
- catch (err) {
- ___b24.tracking.error('analytics.setUpAdScale', err);
- }
- };
- var setUpAdTelligence = function () {
- if (!tracking) {
- return false;
- }
- try {
- var url = "//www.example.org";
- var products = [];
- var loc = B24_shoplocation.get();
- var order = B24_order_object.getOrder();
- var cart = B24_cart_object.getCart();
- if (!!order) {
- $.each(order.order_items, function (key, value) {
- products.push(value.product_sku_extended);
- });
- products = products.join('|');
- url = '//brille24-service.adtelligence.de/convertplus-web-rest/rest/action/2/1?objective=6&epc=true&product=' + products;
- ___l(url, 'AdTelligence');
- ___b24.loadscript.loadImg(url);
- }
- else if (!!cart) {
- var comparedCarts = B24_cart_object.compareCarts();
- if (comparedCarts.action != 'add') {
- return false;
- }
- $.each(comparedCarts.balance, function (key, value) {
- products.push(value.product_sku_extended);
- });
- products = products.join('|');
- url = '//brille24-service.adtelligence.de/convertplus-web-rest/rest/action/2/1?objective=5&epc=true&product=' + products;
- ___l(url, 'AdTelligence');
- ___b24.loadscript.loadImg(url);
- }
- else if (loc == 'detail') {
- var product = B24_product_object.get().sku_extended;
- url = '//brille24-service.adtelligence.de/convertplus-web-rest/rest/action/2/1?objective=7&epc=true&product=' + product;
- ___l(url, 'AdTelligence');
- ___b24.loadscript.loadImg(url);
- }
- else {
- return false;
- }
- return true;
- }
- catch (err) {
- ___b24.tracking.error('analytics.setUpAdTelligence', err);
- }
- };
- var setUpTharuka = function () {
- if (!tracking) {
- return false;
- }
- try {
- var order = B24_order_object.getOrder(true);
- if (!location.pathname.match(/\/success\/?/i)) {
- return false;
- }
- var loc = B24_shoplocation.get();
- if (!order) {
- return false;
- }
- var salutation = order.customer.gender != 'm' ? 'Frau' : 'Herr';
- var dob = order.customer.dob;
- var street = order.billing_address.street.replace(/ +\d[-\da-z]*$/i, '');
- var num = order.billing_address.street.replace(/^.+ +(\d[-\da-z]*)$/i, '$1');
- var byear;
- if (dob === false) {
- dob = '';
- byear = '';
- }
- else {
- byear = dob.replace(/^(\d+)-(\d+)-(\d+)$/i, '$1');
- dob = dob.replace(/^(\d+)-(\d+)-(\d+)$/i, '$3.$2');
- }
- var country = order.billing_address.country;
- if (!!country.match(/germany/i)) {
- country = 'D';
- }
- if (!!country.match(/austria/i)) {
- country = 'A';
- }
- if (!!country.match(/switzerland/i)) {
- country = 'CH';
- }
- window.THFilter = {anrede: salutation, plz: order.billing_address.postcode, land: country, gebJahr: byear};
- window.THPrefill =
- {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};
- ___l(window.THFilter, 'TharukaFilter');
- ___l(window.THPrefill, 'TharukaPrefill');
- ___b24.loadscript.load('//tharuka-app.de/api/576/tharuka.js');
- }
- catch (err) {
- ___b24.tracking.error('analytics.setUpTharuka', err);
- }
- };
- var sovendusGutscheinConnection = function () {
- if (!tracking) {
- return false;
- }
- try {
- var order = B24_order_object.getOrder(true);
- if (!!order) {
- ___b24.tracking.trackingEvent('sovendus', 'gotOrder');
- }
- if (!location.pathname.match(/\/success\/?/i)) {
- return false;
- }
- ___b24.tracking.trackingEvent('sovendus', 'locationHit');
- if (!!order) {
- var _API_Key = '395ab25dcf8' + 'f02b0' + '0989ba';
- window._gconData = window._gconData || [];
- var _partnerID = '679';
- _gconData.push(['_partnerId', _partnerID]);
- var _bannerID = '2';
- _gconData.push(['_bannerId', _bannerID]);
- var _sessionID = order.customer.id;
- _gconData.push(['_sessionId', _sessionID]);
- var _timestamp = Math.round(new Date().getTime() / 1000);
- _gconData.push(['_timestamp', _timestamp]);
- _gconData.push(['_customerSalutation', order.customer.gender === 'm' ? 'Herr' : 'Frau']);
- _gconData.push(['_customerFirstName', order.customer.firstname]);
- _gconData.push(['_customerLastName', order.customer.lastname]);
- _gconData.push(['_customerEmail', order.customer.email]);
- _gconData.push(['_orderId', '']);
- _gconData.push(['_orderValue', '']);
- _gconData.push(['_orderCurrency', 'EUR']);
- var _usedCouponCode = order.discount_description;
- if (_usedCouponCode.match(/^SOVENDUS/i) === null) {
- _usedCouponCode = '';
- }
- _gconData.push(['_usedCouponCode', _usedCouponCode]);
- var _checksum = _sessionID + _timestamp + _usedCouponCode + _API_Key;
- _checksum = $.encoding.digests.hexSha1Str(_checksum);
- _gconData.push(['_checksum', _checksum]);
- ___l(window._gconData, 'Sovendus');
- B24_load_script.loadScript('//api.gutscheinconnection.de/js/client.js');
- ___b24.tracking.trackingEvent('sovendus', 'tracked');
- if (!$('#gutscheinconnection-container').length) {
- ___b24.tracking.error('analytics.sovendusGutscheinConnection', 'WARNING: There is no #gutscheinconnection-container');
- }
- return true;
- }
- return false;
- }
- catch (err) {
- ___b24.tracking.error('analytics.sovendusGutscheinConnection', err);
- }
- };
- var setUpSchutzKlick = function () {
- if (!tracking) {
- return false;
- }
- try {
- var order = B24_order_object.getOrder(true);
- if (!location.pathname.match(/\/success\/?/i)) {
- return false;
- }
- if (!!order) {
- if (!$('#schutzklick-container').length) {
- ___b24.tracking.error('analytics.setUpSchutzKlick', 'WARNING: There is no #schutzklick-container');
- }
- var schutzklick_frame = '<iframe width="760" height="330" src="';
- schutzklick_frame += 'https://www.schutzklick.de/wl/init?partner_id=5087&shop_id=1';
- schutzklick_frame += '&utm_content=iframe';
- schutzklick_frame += '&order_id=' + order.id;
- schutzklick_frame += '&customer[email]=' + order.customer.email;
- var i = 0;
- var schutzklick_frame_t = '';
- $.each(order.order_items, function (index, value) {
- if (value.product_type_extended.sort == 'Glass') {
- schutzklick_frame_t += '&products[' + i + '][category_id]=' + value.product_type;
- schutzklick_frame_t += '&products[' + i + '][name]=' + value.product_name;
- schutzklick_frame_t += '&products[' + i + '][price]=' + value.price;
- schutzklick_frame_t += '&products[' + i + '][currency]=EUR';
- schutzklick_frame_t += '&products[' + i + '][qty]=' + Math.round(value.qty_ordered);
- schutzklick_frame_t += '&products[' + i + '][category_name]=' + value.product_type_extended.group;
- schutzklick_frame_t += '&products[' + i + '][id]=';
- schutzklick_frame_t += '&products[' + i + '][sku]=' + value.product_sku;
- i++;
- }
- ;
- });
- schutzklick_frame += schutzklick_frame_t;
- schutzklick_frame += '" scrolling="no" style="margin:1em"></iframe>';
- if (i > 0) {
- $('#schutzklick-container').html(schutzklick_frame);
- return true;
- }
- else {
- return false;
- }
- }
- }
- catch (err) {
- ___b24.tracking.error('analytics.setUpSchutzKlick', err);
- }
- };
- var loadIFrame = function (url, params) {
- var getP = '?';
- if (typeof(params) == 'object') {
- $.each(params, function (key, value) {
- getP += key + '=' + encodeURIComponent(value) + '&';
- });
- getP = getP.replace(/\&$/i, '');
- }
- url += getP;
- ___l(url, 'iFrame');
- $('<iframe />').attr({'class': 'visuallyhidden', 'src': url}).appendTo('body');
- };
- pub.loadIFrame = loadIFrame;
- var setUpDivolution = function () {
- if (!tracking) {
- return false;
- }
- if (!B24_debug_status.getMode('divolution')) {
- return false;
- }
- var ok = false;
- window.rt_clid = "divoluso_s195_EF5nhCtp4hx07|sitedivolu";
- window.rt_add = "";
- window.rt_sum = "";
- window.rt_async = true;
- var order = B24_order_object.getOrder();
- if (!!order) {
- var products = [];
- $.each(order.order_items, function (index, value) {
- products.push(value.product_type_name);
- });
- window.rt_pageid = "Action_OrderConversion";
- window.rt_product = products.join('|');
- ___l(window.rt_product, 'DivolutionConversion')
- ok = true;
- }
- if (!!location.pathname.match(/newsletter\/bitte-bestaetigen/i)) {
- window.rt_pageid = 'Action_NewsletterSubscription';
- window.rt_product = '';
- ___l('Action_NewsletterSubscription', 'DivolutionMicroConversion');
- ok = true;
- }
- if (!!location.pathname.match(/brillenberater.html/i)) {
- window.rt_pageid = 'Action_Brillenberater';
- window.rt_product = '';
- ___l('Action_Brillenberater', 'DivolutionMicroConversion');
- ok = true;
- }
- if (ok) {
- var url = '//rt.divolution.com/js/site/so_s195_EF5nhCtp4hx07.js';
- loadScript(url);
- }
- };
- var setupBelboon = function () {
- if (!tracking) {
- return false;
- }
- try {
- if (typeof($.getlocations().params.belboon) == 'string') {
- $.cookie('belboon', $.getlocations().params.belboon, {'path': '/', 'expires': 30});
- }
- var belboonID = $.cookie('belboon');
- var order = B24_order_object.getOrder(/belboon/i);
- if (!order) {
- return false;
- }
- if (!belboonID) {
- belboonID = 'NONE';
- }
- var url = '//www1.belboon.de/adtracking/sale/000019693.gif';
- var params = {oc: order.id};
- var itemMode = 'error';
- switch (getPartnerConverionMode(order)) {
- case 1:
- itemMode = 'stufe1';
- break;
- case 2:
- itemMode = 'gutschein1';
- break;
- case 3:
- itemMode = 'stufe2';
- break;
- case 4:
- itemMode = 'gutschein2';
- break;
- case 5:
- itemMode = 'stufe3';
- break;
- case 6:
- itemMode = 'gutschein3';
- break;
- case 7:
- itemMode = 'sale';
- break;
- }
- params[itemMode] = order.payment.netTotal.toString();
- params.belboon = belboonID, ___l(params, 'belboon');
- ___b24.loadscript.loadImg(url, params, '/');
- }
- catch (err) {
- ___b24.tracking.error('analytics.belboon', err);
- }
- };
- var setUpAdition = function () {
- if (!tracking) {
- return false;
- }
- var order = B24_order_object.getOrder();
- if (!order) {
- return false;
- }
- var url = 'https://adfarm1.adition.com/track';
- var sid = B24_cpid_object.testCpid(/_ADS$/) ? 18023 : 18141;
- var params = {'tid': 7090, 'sid': sid, 'type': 'js'};
- params.quantity = 0;
- params.orderid = order.id
- params.total = order_object.payment.totalClean;
- params.itemno = [];
- params.price = [];
- params.descr = [];
- params.parm1 = [];
- params.parm2 = [];
- params.parm3 = [];
- params.parm4 = [];
- $.each(order.order_items, function (key, value) {
- params.quantity += parseInt(value.qty_ordered, 10);
- params.itemno.push(value.id);
- params.price.push(value.price);
- params.descr.push(value.product_name);
- params.parm1.push(value.product_type_extended.group);
- var lens = '0';
- var lensColor = '0';
- if (!!value.product_type_extended.lens) {
- lensColor = value.lensvalues.LColor;
- lens += value.product_type_extended.lens;
- }
- if (!!value.product_type_extended.lensext) {
- lens += value.product_type_extended.lensext;
- }
- params.parm2.push(lens);
- params.parm3.push(lensColor);
- params.parm4.push(value.discount_amount);
- });
- $.each(params, function (key, value) {
- if (typeof(value) == 'object') {
- params[key] = value.join('.');
- }
- });
- ___l(params, 'Adition');
- var getP = '?';
- $.each(params, function (key, value) {
- getP += key + '=' + encodeURIComponent(value) + '&';
- });
- getP = getP.replace(/\&$/i, '');
- url += getP;
- ___l(url, 'Adition');
- loadScript(url);
- };
- var setUpXplosion = function () {
- if (!tracking) {
- return false;
- }
- try {
- var url = '//ssl.xplosion.de/profiler.html';
- var xpl_params = {};
- xpl_params.customer = 'brille24.de';
- var mageParams = B24_shoplocation.getMageParams();
- var loc = B24_shoplocation.get();
- var order = B24_order_object.getOrder();
- var cart = B24_cart_object.getCart();
- if (loc == 'listing') {
- xpl_params.event_id = 'shop_visit';
- xpl_params.shop_id = B24_shoplocation.getCategory();
- xpl_params.shop_trackingproducts = B24_product_object.getList(6);
- ___l(xpl_params, 'Xplosion');
- loadIFrame(url, xpl_params);
- }
- else if (loc == 'detail') {
- xpl_params.event_id = 'product_view';
- xpl_params.product_id = B24_product_object.get().sku_extended_clean;
- xpl_params.product_price = B24_product_object.get().price;
- xpl_params.product_onsale = 0;
- xpl_params.shop_id = B24_shoplocation.getCategory();
- xpl_params.product_brand = 'Brille24';
- ___l(xpl_params, 'Xplosion');
- loadIFrame(url, xpl_params);
- }
- else if (loc == 'cart' && !!cart) {
- var prods = [];
- var qtys = [];
- var costs = [];
- var skus = [];
- $.each(cart.order_items, function (index, value) {
- prods.push(value.product_name.substr(0, 100));
- qtys.push(parseInt(value.qty_ordered));
- costs.push(value.netTotal);
- skus.push(value.product_sku_extended_clean);
- });
- xpl_params.event_id = 'add_to_basket';
- xpl_params.order_article = skus;
- xpl_params.product_quantity = qtys;
- ___l(xpl_params, 'Xplosion');
- loadIFrame(url, xpl_params);
- }
- else if (!!order) {
- var prods = [];
- var qtys = [];
- var costs = [];
- var skus = [];
- $.each(order.order_items, function (index, value) {
- prods.push(value.product_name.substr(0, 100));
- qtys.push(parseInt(value.qty_ordered));
- costs.push(value.netTotal);
- skus.push(value.product_sku_extended_clean);
- });
- xpl_params.xpl_sale = B24_cpid_object.testCpid(/xplosion/i).toString();
- xpl_params.event_id = 'order';
- xpl_params.order_article = skus;
- xpl_params.product_quantity = qtys;
- xpl_params.order_total = order.payment.amount_ordered;
- xpl_params.order_revenue = costs;
- xpl_params.order_id = order.id;
- ___l(xpl_params, 'Xplosion');
- loadIFrame(url, xpl_params);
- }
- }
- catch (err) {
- ___b24.tracking.error('analytics.setUpXplosion', err);
- }
- };
- var setUpChartbeat = function () {
- window._sf_async_config = {uid: 2155, domain: "brille24.de"};
- window._sf_startpt = (new Date()).getTime();
- return true;
- };
- var googleRemarketing = function () {
- if (!tracking) {
- return false;
- }
- try {
- var loc = B24_shoplocation.get();
- var googleLoc = 'other';
- switch (loc) {
- case'homepage':
- googleLoc = 'home';
- break;
- case'cart':
- googleLoc = 'cart';
- break;
- case'listing':
- googleLoc = 'category';
- break;
- case'detail':
- googleLoc = 'product';
- break;
- case'success':
- googleLoc = 'purchase';
- break;
- default:
- googleLoc = 'other';
- break;
- }
- if (googleLoc == 'home') {
- window.google_tag_params = {ecomm_prodid: '', ecomm_pagetype: 'home', ecomm_totalvalue: ''};
- }
- else if (loc == 'listing') {
- window.google_tag_params = {ecomm_prodid: '', ecomm_pagetype: 'category', ecomm_totalvalue: ''};
- }
- else if (loc == 'detail') {
- window.google_tag_params =
- {ecomm_prodid: B24_product_object.get().sku_extended, ecomm_pagetype: 'product', ecomm_totalvalue: B24_product_object.get().price.toString()};
- }
- else if (loc == 'cart') {
- var cart = B24_cart_object.getCart();
- var productIDs = [];
- var productValues = [];
- $.each(cart.order_items, function (key, value) {
- productIDs.push(value.product_sku_extended);
- productValues.push((value.netTotal / value.qty_ordered).toString());
- });
- window.google_tag_params = {ecomm_prodid: productIDs, ecomm_pagetype: 'cart', ecomm_totalvalue: productValues};
- }
- else if (loc == 'success') {
- var order = B24_order_object.getOrder();
- if (!!order) {
- var productIDs = [];
- var productValues = [];
- $.each(order.order_items, function (key, value) {
- productIDs.push(value.product_sku_extended);
- productValues.push((value.netTotal / value.qty_ordered).toString());
- });
- window.google_tag_params = {ecomm_prodid: productIDs, ecomm_pagetype: 'purchase', ecomm_totalvalue: productValues};
- window.google_conversion_id = 1062447180;
- window.google_conversion_label = "";
- }
- else {
- return false;
- }
- }
- else if (googleLoc == 'other') {
- window.google_tag_params = {ecomm_prodid: '', ecomm_pagetype: 'other', ecomm_totalvalue: ''};
- }
- else {
- return false;
- }
- window.google_conversion_id = 1062447180;
- window.google_custom_params = window.google_tag_params;
- window.google_remarketing_only = true;
- ___l(google_tag_params, 'googleRemarketing');
- ___b24.loadscript.load('//www.googleadservices.com/pagead/conversion.js');
- setUpGoogleConversionTracking();
- return true;
- }
- catch (err) {
- ___b24.tracking.error('analytics.googleRemarketing', err);
- }
- };
- pub.googleRemarketing = googleRemarketing;
- var setUpGoogleConversionTracking = function () {
- if (!tracking) {
- return false;
- }
- try {
- var order = B24_order_object.getOrder();
- if (!!order) {
- var url = "//www.googleadservices.com/pagead/conversion/1062447180/?value=" + parseFloat(order.payment.amount_ordered, 10)
- + "?currency_code=EUR?label=u3_FCLiHVxDM0M76Aw?guid=ON?script=0";
- ___b24.loadscript.loadImg(url);
- ___l(url, 'googelConversionTracking');
- }
- return false;
- }
- catch (err) {
- ___b24.tracking.error('analytics.setUpGoogleConversionTracking', err);
- }
- };
- var setUpEthno = function () {
- if (!tracking) {
- return false;
- }
- try {
- var order = B24_order_object.getOrder();
- if (!!order) {
- ___b24.loadscript.load('//ads.escinteractive.com/admultitrack.php?id=58&saleid=' + order.id);
- ___l(url, 'EthnoTrackingPart1');
- var url = "//www.googleadservices.com/pagead/conversion/957603810/?label=xkeOCPCGp1YQ4r_PyAM&guid=ON&script=0";
- ___b24.loadscript.loadImg(url);
- ___l(url, 'EthnoTrackingPart2');
- }
- return false;
- }
- catch (err) {
- ___b24.tracking.error('analytics.setUpEthno', err);
- }
- };
- var setUpZanoxMaster = function () {
- if (!tracking) {
- return false;
- }
- try {
- window._zx = window._zx || [];
- var loc = B24_shoplocation.get();
- var zxid = '';
- if (loc == 'other' && !!$.getlocations().pathname.match(/^\/om\//i)) {
- zxid = '0BEE63FC0BC0D61F4246';
- _zx.push({"id": zxid});
- ___l({'_zx': _zx}, 'ZanoxMaster');
- }
- else if (loc == 'other') {
- zxid = '0509C52149AB6F35237C';
- _zx.push({"id": zxid});
- ___l({'_zx': _zx}, 'ZanoxMaster');
- }
- else if (loc == 'homepage') {
- zxid = '0A6795076178D2BCE991';
- _zx.push({"id": zxid});
- ___l({'_zx': _zx}, 'ZanoxMaster');
- }
- else if (loc == 'listing') {
- window.zx_category = B24_shoplocation.getCategory();
- zxid = '0BEE63FC0BC0D61F4246';
- _zx.push({"id": zxid});
- ___l({'_zx': _zx, 'zx_category': zx_category}, 'ZanoxMaster');
- }
- else if (loc == 'detail') {
- window.zx_identifier = B24_product_object.get().sku_extended;
- window.zx_fn = B24_product_object.get().name;
- window.zx_price = B24_product_object.get().netPrice.toString();
- window.zx_amount = B24_product_object.get().price.toString();
- window.zx_category = B24_shoplocation.getCategory();
- zxid = '47B05B1B34AE30C9B8ED';
- _zx.push({"id": zxid});
- ___l({'_zx': _zx, 'zx_identifier': zx_identifier, 'zx_fn': zx_fn, 'zx_price': zx_price, 'zx_amount': zx_amount, 'zx_category': zx_category},
- 'ZanoxMaster');
- }
- else if (loc == 'search') {
- zxid = '6EB4837F5BD50D7088F5';
- _zx.push({"id": zxid});
- ___l({'_zx': _zx}, 'ZanoxMaster');
- }
- else if (loc == 'register') {
- zxid = '2AEC83A958D2EA52CB95';
- _zx.push({"id": zxid});
- ___l({'_zx': _zx}, 'ZanoxMaster');
- }
- else if (loc == 'cart') {
- var cart = B24_cart_object.getCart();
- window.zx_products = [];
- $.each(cart.order_items, function (key, value) {
- zx_products.push({'identifier': value.product_sku_extended, 'amount': (value.netTotal
- / value.qty_ordered).toString(), 'currency': 'EUR', 'quantity': parseInt(value.qty_ordered).toString()});
- });
- zxid = '7E71A28F4DC4DA56FF7F';
- _zx.push({"id": zxid});
- ___l({'_zx': _zx, 'zx_products': zx_products}, 'ZanoxMaster');
- }
- else if (loc == 'success') {
- var order = B24_order_object.getOrder();
- if (!!order) {
- window.zx_products = [];
- $.each(order.order_items, function (key, value) {
- zx_products.push({'identifier': value.product_sku_extended, 'amount': (value.netTotal
- / value.qty_ordered).toString(), 'currency': 'EUR', 'quantity': parseInt(value.qty_ordered).toString()});
- });
- window.zx_transaction = order.id;
- window.zx_total_amount = order.payment.netTotal.toString();
- window.zx_total_currency = "EUR";
- zxid = '4428A1F3547B7DE5DC98';
- _zx.push({"id": zxid});
- ___l({'_zx': _zx, 'zx_transaction': zx_transaction, 'zx_total_amount': zx_total_amount, 'zx_total_currency': zx_total_currency, 'zx_products': zx_products},
- 'ZanoxMaster');
- }
- }
- else {
- return false;
- }
- $('body').append('<div class="zx_' + zxid + ' zx_mediaslot" />');
- ___b24.loadscript.load('//static.zanox.com/scripts/zanox.js');
- return true;
- }
- catch (err) {
- ___b24.tracking.error('analytics.zanoxmaster', err);
- }
- };
- var setUpUniqueDigital = function () {
- if (!tracking) {
- return false;
- }
- try {
- window._adftrack = {};
- var location = B24_shoplocation.get();
- var cart = B24_cart_object.getCart();
- var order = B24_order_object.getOrder();
- if (location == 'homepage') {
- _adftrack = {pm: 65623, id: 929473};
- }
- else if (location == 'detail' && B24_shoplocation.getProductType() != 'contactlens') {
- _adftrack = {pm: 65623, id: 929226, order: {itms: [
- {'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'}
- ]}};
- }
- else if (location == 'listing') {
- _adftrack = {pm: 65623, id: 956859, order: {itms: [
- {'categoryname': B24_shoplocation.getCategory()}
- ]}};
- }
- else if (!!cart) {
- var itms = [];
- $.each(cart.order_items, function (key, value) {
- var productname = $.trim(value.product_name.replace(/^.*brille/i, ''));
- var productid = value.product_sku;
- var categoryname = '';
- var productsales = value.price;
- itms.push({'productname': productname, 'productid': productid, 'categoryname': categoryname, 'productsales': productsales});
- });
- _adftrack = {pm: 65623, id: 956857, order: {'itms': itms}};
- }
- else if (!!order) {
- var ordertrack = {};
- ordertrack.sales = order.payment.netTotal;
- ordertrack.orderid = order.id;
- ordertrack.basketsize = 0;
- ordertrack.itms = [];
- $.each(order.order_items, function (key, value) {
- var productname = $.trim(value.product_name.replace(/^.*brille/i, ''));
- var productid = value.product_sku;
- var categoryname = '';
- var productsales = value.price;
- ordertrack.itms.push({'productname': productname, 'productid': productid, 'categoryname': categoryname, 'productsales': productsales});
- ordertrack.basketsize++;
- });
- if (B24_cpid_object.testCpid(/UNIQUE-RTE/)) {
- _adftrack = {pm: 65623, id: 929445, 'order': ordertrack};
- }
- else {
- _adftrack = {pm: 65623, id: 958202, 'order': ordertrack};
- }
- }
- else {
- return false;
- }
- loadScript('https://track.adform.net/serving/scripts/trackpoint/async/');
- ___l(_adftrack, 'uniqueDigital');
- }
- catch (err) {
- ___b24.tracking.error('analytics.setUpUniqueDigital', err);
- }
- };
- var setUpSociomantic = function () {
- if (!tracking) {
- return false;
- }
- try {
- var soc_customer = B24_shoplocation.getMageParams().empty ? '' : B24_shoplocation.getMageParams().C;
- window.customer = {'identifier': soc_customer};
- var loc = B24_shoplocation.get();
- var cart = B24_cart_object.getCart();
- var order = B24_order_object.getOrder();
- if (!!order) {
- var beacon = 'sociomanticSuccess';
- window.basket = {};
- basket.products = [];
- $.each(order.order_items, function (index, value) {
- basket.products.push({'identifier': value.product_sku_extended_clean, 'amount': (value.netTotal
- / value.qty_ordered), 'currency': 'EUR', 'quantity': parseInt(value.qty_ordered)});
- });
- basket.transaction = order.id;
- basket.amount = order.payment.netTotal;
- basket.currency = 'EUR';
- ___l(basket, 'sociomantics basket success');
- if (B24_cpid_object.testCpid(/sociomantic/i)) {
- window.sale = {confirmed: true};
- beacon = 'sociomanticCPIDsuccessPRE';
- if (typeof sociomantic !== 'undefined' && typeof sociomantic.sonar !== 'undefined' && typeof sociomantic.sonar.advertiser
- !== 'undefined' && typeof sociomantic.sonar.advertiser.getConfirmed !== 'undefined') {
- sociomantic.sonar.advertiser.getConfirmed();
- beacon = 'sociomanticCPIDgetConfirmedSuccess';
- }
- else {
- beacon = 'sociomanticCPIDsuccess';
- }
- ___l(window.sale, 'sociomantics cpid success');
- }
- ___b24.tracking.trackingEvent('sociomatic', beacon);
- }
- else if (loc == 'cart') {
- var cart = B24_cart_object.getCart();
- window.basket = {};
- basket.products = [];
- $.each(cart.order_items, function (index, value) {
- basket.products.push({'identifier': value.product_sku_extended_clean, 'amount': (value.netTotal
- / value.qty_ordered), 'currency': 'EUR', 'quantity': parseInt(value.qty_ordered)});
- });
- ___l(basket, 'sociomantics basket cart');
- }
- else if (loc == 'detail') {
- window.product = {'identifier': B24_product_object.get().sku_extended_clean};
- ___l(product, 'sociomantics the product');
- }
- else if (loc == 'listing') {
- window.product = {'category': [B24_shoplocation.getCategory()]};
- ___l(product, 'sociomantics the category');
- }
- else if (loc == 'homepage') {
- ___l('home', 'sociomantics home');
- }
- else if (loc == 'other' && !!$.getlocations().pathname.match(/^\/om\//i)) {
- ___l('ompages', 'sociomantics ompages');
- }
- else {
- return false;
- }
- loadScript('//eu-sonar.sociomantic.com/js/2010-07-01/adpan/brille24-de');
- }
- catch (err) {
- ___b24.tracking.error('analytics.setUpSociomantic', err);
- }
- };
- var setUpEcomcon = function () {
- if (!tracking) {
- return false;
- }
- try {
- var loc = B24_shoplocation.get();
- var order = B24_order_object.getOrder();
- if (!!order) {
- var url = 'https://secure.adnxs.com/px?id=196091&seg=1775791&order_id=' + order.id + '&value=' + order.payment.netTotal + '&t=1';
- ___b24.loadscript.load(url);
- ___l('Ecomcon', url);
- }
- else if ($.getlocations().ssl) {
- return false;
- }
- else if (loc == 'homepage') {
- var url = 'http://ib.adnxs.com/px?id=196087&seg=1775786&t=1';
- ___b24.loadscript.load(url);
- ___l('Ecomcon', url);
- }
- else if (loc == 'detail') {
- var url = 'http://ib.adnxs.com/px?id=196089&seg=1775788&t=1';
- ___b24.loadscript.load(url);
- ___l('Ecomcon', url);
- }
- else if (loc == 'listing') {
- var url = 'http://ib.adnxs.com/px?id=196088&seg=1775787&t=1';
- ___b24.loadscript.load(url);
- ___l('Ecomcon', url);
- }
- else if (loc == 'cart') {
- var url = 'http://ib.adnxs.com/px?id=196090&seg=1775790&t=1';
- ___b24.loadscript.load(url);
- ___l('Ecomcon', url);
- }
- }
- catch (err) {
- ___b24.tracking.error('analytics.setUpEcomcon', err);
- }
- };
- var selligent = function () {
- if (!tracking) {
- return false;
- }
- try {
- var url = '//brille24.emsecure.net/optiext/webtracker.dll';
- $.ajax({url: url, dataType: 'script', error: function (errr) {
- ___b24.tracking.error('analytics.selligent1.ajaxcall', errr);
- }, success: function () {
- ;
- }}).done(function (data) {
- ma_track();
- var order = B24_order_object.getOrder()
- if (!!order) {
- ma_track('aOcyfliaA',
- '',
- '',
- order.payment.netTotal.toString().replace(/\./, ',') + '',
- '',
- '',
- order.id + '',
- order.customer.id + '');
- ___l(ma_track, 'selligent1');
- }
- });
- }
- catch (err) {
- ___b24.tracking.error('analytics.selligent1', err);
- }
- try {
- var orderObject = B24_order_object.getOrder() || B24_cart_object.getCart();
- if (orderObject == null) {
- return false;
- }
- if (orderObject.empty) {
- return false;
- }
- if (B24_shoplocation.get() != 'cart' && B24_shoplocation.get() != 'success') {
- return false;
- }
- if (typeof(orderObject.order_items[0]) != 'undefined' && orderObject.order_items[0].product_type == 2) {
- return false;
- }
- var params = '';
- params = 'ID=mIppkqbeErYpyaG%2Ba2TxaRhnAulOC3DxUe3heV';
- params += '&';
- var wkstatus = '10';
- if (B24_cart_object.getCartStatus() == 'stillEmpty' || B24_cart_object.getCartStatus() == 'haveaLook') {
- return false;
- }
- else if (B24_cart_object.getCartStatus() == 'terminated' || B24_cart_object.getCartStatus() == 'deletedPosition') {
- wkstatus = '00';
- params += 'sku=000';
- params += '&';
- params += 'brillentyp=-1';
- }
- else {
- params += 'sku=' + orderObject.order_items[0].product_sku;
- params += '&';
- params += 'brillentyp=' + orderObject.order_items[0].product_type;
- }
- if (typeof(orderObject.customer.id) == 'string') {
- params += '&';
- params += 'customer_id=' + orderObject.customer.id;
- }
- if (typeof(window.order_object) == 'object') {
- wkstatus = '00';
- }
- params += '&';
- params += 'wk_status=' + wkstatus;
- var ssl = $.getlocations().ssl ? 's' : '';
- var path = 'http' + ssl + '://brille24.emsecure.net/optiext/optiextension.dll';
- var img = '<img src="' + path + '?' + params + '" border="0" alt="" />';
- ___l(params, 'selligent');
- $('#dynamic').append(img);
- }
- catch (err) {
- ___b24.tracking.error('analytics.selligent2', err);
- }
- };
- var finalChartbeat = function () {
- if (!tracking) {
- return false;
- }
- window._sf_endpt = (new Date()).getTime();
- var src = (("https:" == document.location.protocol) ? "https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/js/chartbeat.js" :
- "http://static.chartbeat.com/js/chartbeat.js");
- loadScript(src);
- };
- var setUpYahooReMarketing = function () {
- if (!tracking) {
- return false;
- }
- var order = B24_order_object.getOrder(/yahoo/i);
- if (!!order) {
- var img = '<img src="https://ad.yieldmanager.com/pixel?id=1371402&t=2" width="1" height="1" />';
- $('#dynamic').append(img);
- ___l(img, 'yahooRemarketing');
- return true;
- }
- return false;
- };
- var setUpZanox = function () {
- if (!tracking) {
- return false;
- }
- var order = B24_order_object.getOrder(/(zx\_aff)|(zanox)/i);
- if (!!order) {
- if (new Date().getFullYear() > 2013 || B24_debug_status.getMode('ga')) {
- var params = {CustomerID: order.customer.id, OrderID: order.id, CurrencySymbol: 'EUR', TotalPrice: order.payment.netTotal, CID: getPartnerConverionMode(order)};
- var url = 'https://ad.zanox.com/pps/?9417C470646257&mode=[[2]]';
- ___b24.loadscript.loadImg(url, params);
- ___l(params, 'newZanox');
- }
- else {
- var param_string = '';
- param_string += '&CustomerID=' + order.customer.id;
- param_string += '&OrderID=' + order.id;
- param_string += '&CurrencySymbol=EUR';
- param_string += '&TotalPrice=' + order.payment.netTotal;
- var img = '<img src="https://ad.zanox.com/pps/?9417C470646257&mode=[[2]]' + param_string + '" width="1" height="1" />';
- $('#dynamic').append(img);
- ___l(img, 'zanox');
- }
- return true;
- }
- return false;
- };
- var setUpCommissionJunction = function () {
- if (!tracking) {
- return false;
- }
- var order = B24_order_object.getOrder(/^cj/i);
- if (!!order) {
- var itemMode = 'WK_Error';
- switch (getPartnerConverionMode(order)) {
- case 1:
- itemMode = 'WK_60_oG';
- break;
- case 2:
- itemMode = 'WK_60_mG';
- break;
- case 3:
- itemMode = 'WK_60-01_120_oG';
- break;
- case 4:
- itemMode = 'WK_60-01_120_mG';
- break;
- case 5:
- itemMode = 'WK_120-01_oG';
- break;
- case 6:
- itemMode = 'WK_120-01_mG';
- break;
- case 7:
- itemMode = 'WK_CL';
- break;
- }
- var params = {'CID': '1502798', 'OID': order.id, 'TYPE': '362057', 'ITEM1': itemMode, 'AMT1': order.payment.netTotal, 'QTY1': 1, 'CURRENCY': 'EUR', 'METHOD': 'IMG'};
- ___b24.loadscript.loadImg('https://www.kdukvh.com/u', params);
- ___l(params, 'CJ');
- }
- return false;
- };
- var getPartnerConverionMode = function (ord) {
- var mode = 0;
- var price = ord.payment.netTotal
- var discount = ord.discount_description != '';
- var glass = true;
- $.each(ord.order_items, function (index, value) {
- if (value.product_type_extended.sort != 'Glass') {
- glass = false;
- }
- });
- if (!glass) {
- mode = 7;
- }
- else if (price < 60) {
- mode = !discount ? 1 : 2;
- }
- else if (price < 120) {
- mode = !discount ? 3 : 4;
- }
- else {
- mode = !discount ? 5 : 6;
- }
- return mode;
- };
- var setUpAccado = function () {
- if (!tracking) {
- return false;
- }
- if (B24_shoplocation.get() == 'homepage') {
- 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>';
- $('#dynamic').append(img);
- ___l(img, 'Accado');
- return true;
- }
- var order = B24_order_object.getOrder(/accado/i);
- if (!!order) {
- var img = '<iframe src="https://accado.adspirit.de/admultitrack.php?output=2&id=93&saleid=' + order.id + '&price='
- + order.payment.netTotal + '" width="1" height="1" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe>';
- $('#dynamic').append(img);
- ___l(img, 'Accado');
- return true;
- }
- return false;
- };
- var setUpUDMarin = function () {
- if (!tracking) {
- return false;
- }
- 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);
- if (!!order) {
- var saleType = 'sale';
- $.each(order.order_items, function (index, value) {
- if (typeof(value.lensvalues) == 'object' && typeof(value.lensvalues.LColor) == 'string') {
- var tintingRate = parseInt(value.lensvalues.LColor.match(/\d{2}$/i)[0]);
- if (tintingRate > 40) {
- saleType = 'sale_sonnenbrille';
- }
- }
- });
- var img = '<img src="https://tracker.marinsm.com/tp?act=2&cid=8iy913f5t0¤cy=EUR&trans=UTM:T|' + order.id + '||'
- + order.payment.netTotal + '|||||%0AUTM:I|' + order.id + '|' + saleType + '|||' + order.payment.netTotal
- + '|" width="1" height="1" />';
- $('#dynamic').append(img);
- ___l(img, 'Marin');
- return true;
- }
- return false;
- };
- var setUpFacebookConversion = function () {
- if (!tracking) {
- return false;
- }
- var order = B24_order_object.getOrder();
- if (!!order) {
- window.fb_param = {};
- fb_param.pixel_id = '6007721195337';
- fb_param.value = order.payment.netTotal;
- ___l(fb_param, 'Facebook');
- loadScript('//connect.facebook.net/en_US/fp.js', true, true);
- }
- return false;
- };
- var loadScript = function (source, sync, utf8) {
- var script = document.createElement('script');
- script.type = 'text/javascript';
- if (typeof(sync) == 'boolean' && sync) {
- script.async = true;
- }
- else {
- script.async = false;
- }
- if (typeof(utf8) == 'boolean' && utf8) {
- script.charset = 'utf-8';
- }
- script.src = source;
- var scriptDOM = document.getElementsByTagName('script')[0];
- scriptDOM.parentNode.insertBefore(script, scriptDOM);
- }
- pub.loadScript = loadScript;
- init();
- $(DOMready);
- return pub;
- })(window, jQuery, undefined);
- ;
- var ___b24 = ___b24 || {};
- ___b24.frontmode = (function (window, $) {
- var pub = {};
- var name = 'frontmode';
- var prefix = name;
- var storageName = prefix;
- var modes = {};
- var classes = '';
- var expTTL = 86400000;
- var expTTLD = 1;
- var init = function () {
- modes = extendModes(getStorage(), getParams());
- classes = setModes(modes);
- setStorage(modes);
- };
- var clearModes = function () {
- $('html').removeClass(classes.join(' '));
- modes = {};
- setStorage(modes);
- return modes;
- };
- pub.clearModes = clearModes;
- var extendModes = function (tar, src) {
- var m = $.extend(tar, src);
- var out = {};
- $.each(m, function (key, value) {
- key = key.toLowerCase(), value = value.toLowerCase();
- if (value != 'false') {
- out[key] = value;
- }
- });
- return out;
- };
- var setModes = function (m) {
- var cls = [];
- $.each(m, function (key, value) {
- var c = key;
- if (value != 'true') {
- c += '_' + value;
- }
- cls.push(c);
- });
- $('html').addClass(cls.join(' '));
- return cls;
- };
- var getParams = function () {
- var params = $.getlocations().params;
- var collection = {};
- $.each(params, function (key, value) {
- if (!!key.match(new RegExp('^' + prefix + '_', 'i'))) {
- collection[key] = value;
- }
- });
- return collection;
- };
- var getStorage = function () {
- return!!$.cookie(storageName) ? JSON.parse($.cookie(storageName)) : {};
- };
- var setStorage = function (j) {
- $.cookie(storageName, JSON.stringify(j), {'path': '/', 'expires': expTTLD});
- return true;
- };
- init();
- return pub;
- })(window, jQuery, undefined);
- ;
- ; //
- /* Brille24
- * optimise-it implementation
- * #3513
- */
- //
- // var ___b24 = ___b24 || {};
- //
- // ___b24.optimiseIt = (function(window, $){
- //
- // var tracking = B24_debug_status.getMode('tracking');
- //
- // var pub = {};
- //
- // var DOMready = function() {
- // stopTrackingByConversionComment();
- // if(!tracking) {
- // return false;
- // }
- // basiCall();
- // conversion();
- // };
- //
- //
- // var stopTrackingByConversionComment = function() {
- // // disables the conversionTracking by a customer-order-comment
- // var order = B24_order_object.getOrder();
- // if(!!order && typeof(order.customer_comment) == 'string' && !!order.customer_comment.match(/\#test\#/i)) {
- // tracking = false;
- // }
- // };
- //
- // var basiCall = function() {
- // var loc = B24_shoplocation.get();
- // var departmentId = 1;
- // if(loc == 'homepage') {
- // departmentId = 1;
- // }
- // if(loc == 'other') {
- // if(!!location.pathname.match(/selbsttoenende-brillenglaeser.html/i)) {
- // departmentId = 4;
- // }
- // else if(!!location.pathname.match(/polarisierende-brillenglaeser.html/i)) {
- // departmentId = 5;
- // }
- // else {
- // departmentId = 2;
- // }
- // }
- // if(loc == 'listing') {
- // departmentId = 3;
- // }
- // if(loc == 'detail') {
- // departmentId = 6;
- // }
- // if(loc == 'cart') {
- // departmentId = 7;
- // }
- // if(loc == 'checkout') {
- // departmentId = 8;
- // }
- // if(loc == 'success') {
- // return false;
- // }
- // var url = 'https://chat.brille24.de/system/scripts/rp_status.php';
- // var params = {};
- // params.deptid = departmentId.toString();
- // params.pagename = location.pathname;
- // params.json = {
- // nothing: 'NOTHING',
- // }
- // var getP = '?';
- // $.each(params, function(key, value) {
- // if(typeof(value) == 'object') {
- // value = JSON.stringify(value);
- // }
- // getP += key + '=' + encodeURIComponent(value) + '&';
- // });
- // getP = getP.replace(/\&$/i, '');
- // url += getP;
- // ___l(url, 'OPTIMISE');
- // ___b24.analytics.loadScript(url);
- // };
- //
- // var conversion = function() {
- // if(!tracking) {
- // return false;
- // }
- // var order = B24_order_object.getOrder();
- // if(!order) {
- // return false;
- // }
- // var url = 'https://chat.brille24.de/system/report.php';
- // var params = {};
- // params.OrderNumber = order.id;
- // params.json = {
- // nothing: 'NOTHING'
- // }
- // var getP = '?';
- // $.each(params, function(key, value) {
- // if(typeof(value) == 'object') {
- // value = JSON.stringify(value);
- // }
- // getP += key + '=' + encodeURIComponent(value) + '&';
- // });
- // getP = getP.replace(/\&$/i, '');
- // url += getP;
- // ___l(url, 'OPTIMISE');
- // ___b24.analytics.loadScript(url);
- // };
- //
- // $(DOMready);
- //
- // return pub;
- //
- // })(window, jQuery, undefined);
- (function ($) {
- $(document).on('click', '#TRYON_ADAPTION', function (event) {
- if (typeof event == 'undefined') {
- event = window.event;
- }
- var $this = $(this);
- var x = event.clientX - $this.offset().left + $(document).scrollLeft();
- var y = event.clientY - $this.offset().top + $(document).scrollTop();
- $.log($this.offset().top);
- $.log(event);
- $.log(x + ' x ' + y);
- if ($('#EYEPOINT_x1').val() == '') {
- $('#EYEPOINT_x1').val(x);
- $('#EYEPOINT_y1').val(y);
- $('#EYEPOINT_GHOST_1').css({top: (y - 22) + 'px', left: (x - 22) + 'px'});
- }
- else {
- $('#EYEPOINT_x2').val(x);
- $('#EYEPOINT_y2').val(y);
- $('#tryon_adaption .ADAPT_SAVE').removeAttr('disabled').removeClass('disabled');
- $('#EYEPOINT_GHOST_2').css({top: (y - 22) + 'px', left: (x - 22) + 'px'});
- }
- $('.part_3').removeClass('step_error');
- });
- $(document).on('click', '#tryon_adaption .ADAPT_REDO', function () {
- $.log(1);
- $('#EYEPOINT_x1, #EYEPOINT_y1, #EYEPOINT_x2, #EYEPOINT_y2').val('');
- $('#tryon_adaption .ADAPT_SAVE').addClass('disabled');
- $('#EYEPOINT_GHOST_1, #EYEPOINT_GHOST_2').css({top: '-100px', left: '-100px'});
- $('.part_3').removeClass('step_error');
- return false;
- });
- $(document).on('click', '#tryon_adaption .ADAPT_SAVE', function () {
- if ($(this).hasClass('disabled')) {
- $('.part_3').addClass('step_error');
- return false;
- }
- else {
- return true;
- }
- });
- $(document).on('change', '#tryon_ajax_options .refreshTryonAjax', function () {
- var frame_selectiD = $('.b24_frame').val();
- var frame_t = "Frame_" + frame_selectiD;
- $.log("Frame t " + frame_t);
- var objectstringpath = "FrameOptions.selectionId_" + frame_selectiD + ".sku";
- var frame_sku = eval("$('#BUNDLEOPTIONS').metadata()." + objectstringpath);
- var frame = frame_sku;
- $.log("frame " + frame);
- var glass = $('.b24_lensshape').val();
- var color = $('.b24_lenscolor').val();
- $('.PRODUCTLINK').attr('href', $('.PRODUCTLINK').data('link') + "?frame=" + frame);
- url = '/shop/tryon/image/glassasblock/frame/' + frame + '/glass/' + glass + '/color/' + color + '/category/' + B24Tools.getCategory();
- $('#tryonloader').show();
- $('#userglasses').hide();
- $.ajax({url: url, success: function (data) {
- $('#tryonloader').hide();
- $('#userglasses').html(data);
- $('#userglasses').show();
- $.log(data);
- }});
- });
- $(document).on('click', '#CATALOG_TRYON_PREVIOUS, #CATALOG_TRYON_NEXT', function () {
- $t = $(this);
- var $overlaybox = $('#overlayBox');
- var $container = $(".contentWrap", $overlaybox);
- $container.html("");
- $overlaybox.addClass("indicator");
- var url = $t.attr('href');
- url = url.replace(/(\?)/i, '?category=' + B24Tools.getCategory() + '&');
- var selector = url.match(/\#[^\?\#]+/i);
- if (selector == null || typeof(selector) == "undefined" || selector.length < 1) {
- selector = false;
- }
- else {
- selector = selector[0];
- }
- var baseURL = "/";
- var rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
- $.ajax({url: url, type: 'GET', dataType: "html", cache: false, complete: function (jqXHR, status, responseText) {
- $overlaybox.removeClass("indicator");
- responseText = jqXHR.responseText;
- jqXHR.done(function (r) {
- responseText = r;
- });
- var $extract = $();
- if (selector) {
- $extract = jQuery("<div>").append(responseText.replace(rscript, "")).find(selector);
- if (!$extract.length) {
- $extract = jQuery("<div>").append(responseText.replace(rscript, ""));
- }
- }
- else {
- $extract = jQuery("<div>").append(responseText.replace(rscript, ""));
- }
- $container.html('').append($extract).show();
- $('.PRODUCTLINK').data('link', $('.PRODUCTLINK').attr('href'));
- }});
- return false;
- });
- $(document).on('click', '.OVERLAYBOX_TRYON', function (e) {
- var whom = $.trim($(this).closest('.item').find('.product-name .product_name_inner').text());
- if (!whom) {
- whom = "Brille-Default_ECode=61515162427934027";
- }
- if (!$('#overlayBox').length) {
- $('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>');
- }
- e.preventDefault();
- window.$overlay =
- $(this).overlay({target: '#overlayBox', api: true, load: true, mask: {color: '#000', opacity: 0.6, loadSpeed: 0, closeSpeed: 0}, onClose: function () {
- $t = this.getOverlay();
- $t.removeClass("tryon_ajax indicator");
- }, onBeforeLoad: function () {
- $t = this.getOverlay();
- $t.addClass("tryon_ajax indicator");
- var $container = $t.find(".contentWrap");
- $container.html("");
- $t.find('.headline').text(this.getTrigger().text());
- var url = this.getTrigger().metadata().url;
- url = url.replace(/(\?)/i, '?category=' + B24Tools.getCategory() + '&');
- var selector = url.match(/\#[^\?\#]+/i);
- if (selector == null || typeof(selector) == "undefined" || selector.length < 1) {
- selector = false;
- }
- else {
- selector = selector[0];
- }
- var baseURL = "/";
- var rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
- $.ajax({url: url, type: 'GET', dataType: "html", cache: false, complete: function (jqXHR, status, responseText) {
- responseText = jqXHR.responseText;
- jqXHR.done(function (r) {
- responseText = r;
- });
- var $extract = $();
- if (selector) {
- $extract = jQuery("<div>").append(responseText.replace(rscript, "")).find(selector);
- if (!$extract.length) {
- $extract = jQuery("<div>").append(responseText.replace(rscript, ""));
- }
- }
- else {
- $extract = jQuery("<div>").append(responseText.replace(rscript, ""));
- }
- ___b24.tracking.freeEvent('Tryon_ProductView', whom);
- $container.html('').append($extract).show().parent().removeClass('indicator');
- $('.PRODUCTLINK').data('link', $('.PRODUCTLINK').attr('href'));
- }});
- }});
- });
- $(document).on('click', '#TRYONEDIT', function (e) {
- $('#tryon_quick_change').addClass('load');
- $('#tryon_quick_change').show();
- $('#tryon_quick_change,#b24_tryon').expose({color: '#000', opacity: 0.6, loadSpeed: 0, closeSpeed: 0, onClose: function (event) {
- $('#tryon_quick_change').hide(0, function () {
- $('#tryon_quick_change .canvas, #tryon_quick_change .nav').remove();
- });
- }});
- $.ajax({url: '/shop/tryon/productview/', success: function (data) {
- $('#tryon_quick_change').append(data);
- $('#tryon_quick_change').removeClass('load');
- $('#tryon_quick_change .canvas').show();
- }, error: function (data) {
- $.mask.close();
- ___b24.tracking.error('tryon.js', 'Open tryon overlay.ajax');
- alert($('#tryon_quick_change').metadata().error);
- }});
- ___b24.tracking.freeEvent('Tryon_ProductView', 'Open the overlay');
- return false;
- });
- $(document).on('click', '#tryon_quick_change .CHANGETRYON', function (e) {
- var $t = $(this);
- var picurl = '/shop/tryon/productview/set/userpic_id/' + $t.attr('href');
- var picSelector = picurl.replace('/shop/tryon/productview/set/userpic_id/', '').charAt(0);
- $.ajax({url: picurl, success: function (data) {
- $('#tryonloader').show();
- $('#userglasses, #userpic').hide();
- $('#tryon_quick_change .pic').removeClass('active');
- $t.addClass('active');
- $.ajax({url: '/shop/tryon/image/userpicasblock/', success: function (data) {
- $('#userpic').html(data);
- $('#userpic, #userglasses').show();
- $('#tryonloader').hide();
- if (picSelector == 's') {
- $('#CATWALKSTATUS').addClass('STANDARDUSERPIC');
- }
- else {
- $('#CATWALKSTATUS').removeClass('STANDARDUSERPIC');
- }
- }, error: function (data) {
- $('#tryonloader').hide();
- $('#userglasses, #userpic').show();
- $('#userpic').show();
- ___b24.tracking.error('tryon.js', 'Change photo.ajax.picasblock');
- alert($('#tryon_quick_change').metadata().error);
- }});
- }, error: function (data) {
- $('#tryonloader').hide();
- $('#userglasses, #userpic').show();
- ___b24.tracking.error('tryon.js', 'Change photo.ajax.picurl');
- alert($('#tryon_quick_change').metadata().error);
- }});
- ___b24.tracking.freeEvent('Tryon_ProductView', 'Change photo');
- return false;
- });
- $(document).on('click', '#tryon_quick_change .RIGHT', function (e) {
- var slideposition = $('#tryonpics').position();
- var slides = $('#tryonpics').width() - 960;
- if (slides + slideposition.left >= 910) {
- slide = 910;
- $('#tryon_quick_change .LEFT').removeClass('disable');
- }
- else {
- slide = slides + slideposition.left;
- $('#tryon_quick_change .RIGHT').addClass('disable');
- }
- $('#tryonpics').animate({left: '-=' + slide}, {queue: false, duration: 350});
- return false;
- });
- $(document).on('click', '#tryon_quick_change .LEFT', function (e) {
- var slideposition = $('#tryonpics').position();
- var slides = $('#tryonpics').width() - 960;
- if (Math.abs(slideposition.left) >= 910) {
- slide = '+=' + 910;
- $('#tryon_quick_change .RIGHT').fadeIn();
- $('#tryon_quick_change .RIGHT').removeClass('disable');
- }
- else {
- slide = 0;
- $('#tryon_quick_change .LEFT').addClass('disable');
- }
- $('#tryonpics').animate({left: slide}, {queue: false, duration: 350});
- return false;
- });
- $(document).on('click', '#tryon_quick_change .close', function (e) {
- $('#tryon_quick_change').fadeOut('fast', function () {
- $('#tryon_quick_change .canvas, #tryon_quick_change .nav').remove();
- });
- $.mask.close();
- return false;
- });
- $(document).on('click', '#UPLOAD .save.REQUIRED', function (e) {
- if ($('#file_uploader').val() == "") {
- ___b24.tracking.freeEvent('Tryon', 'Kein Bild ausgewählt');
- }
- else {
- ___b24.tracking.freeEvent('Tryon', 'Bild hochgeladen');
- }
- });
- if ($('html').hasClass('video')) {
- $('.webcam_foto_upload').prop('display', 'block');
- }
- $(document).on("click", "a.offsite", function () {
- alert("Goodbye!");
- });
- $(document).on("click", ".webcam_foto_upload_now.activecambutton", function (e) {
- var Pic = document.getElementById("canvas_big").toDataURL("image/jpeg");
- $('#userpic_canvas').attr('value', Pic);
- $('.userpic_canvas').attr('src', Pic);
- $("#UPLOAD_CANVAS").submit();
- event.preventDefault();
- });
- $(document).ready(function () {
- function hasGetUserMedia() {
- return!!(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
- }
- if (hasGetUserMedia()) {
- }
- else {
- $('.webcamuploaddiv').html(" ");
- }
- });
- $(document).on("click", ".webcam_foto_upload", function (e) {
- localStorage.removeItem("webcamheight");
- localStorage.removeItem("webcamwidth");
- localStorage.removeItem("webcamabstand_seiten");
- localStorage.removeItem("webcamaratio");
- localStorage.clear();
- if ($('.webcamdummy').length > 0) {
- var dummy = $('.webcamdummy').html();
- $('body').prepend(dummy);
- $('.webcamdummy').html(" ");
- }
- $('#bottommenu').hide();
- $('#overlayBoxWebcam').show();
- e.preventDefault();
- var OK = true;
- window.$overlay =
- $(this).overlay({target: '#overlayBoxWebcam', api: true, load: true, fixed: false, mask: {color: '#000', opacity: 0.6, loadSpeed: 0, closeSpeed: 0}, onBeforeLoad: function (event) {
- $thisOverlay = this.getOverlay();
- }, onClose: function (event) {
- }});
- $(document).on("click", "#overlayBoxWebcam .close", function (e) {
- $.mask.close();
- return false;
- });
- 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) {
- ___("Video capture error: ", error.code);
- };
- if (!$('#video').hasClass('webcam_mirror')) {
- context.translate(233, 0);
- context.scale(-1, 1);
- context_big.translate(233, 0);
- context_big.scale(-1, 1);
- $('#video').addClass('webcam_mirror');
- }
- if (navigator.getUserMedia) {
- navigator.getUserMedia(videoObj, function (stream) {
- video.src = stream;
- video.play();
- video.style.cssText = "-moz-transform: scale(-1, 1); \
- -webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1); \
- transform: scale(-1, 1); filter: FlipH;";
- }, errBack);
- }
- else if (navigator.webkitGetUserMedia) {
- navigator.webkitGetUserMedia(videoObj, function (stream) {
- video.src = window.webkitURL.createObjectURL(stream);
- video.play();
- video.style.cssText = "-moz-transform: scale(-1, 1); \
- -webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1); \
- transform: scale(-1, 1); filter: FlipH;";
- }, errBack);
- }
- else if (navigator.mozGetUserMedia) {
- navigator.mozGetUserMedia(videoObj, function (stream) {
- video.src = window.URL.createObjectURL(stream);
- video.play();
- video.style.cssText = "-moz-transform: scale(-1, 1); \
- -webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1); \
- transform: scale(-1, 1); filter: FlipH;";
- }, errBack);
- }
- vidresolution = SetCanvisVideoSize();
- function SetCanvisVideoSize() {
- var retryCount = 0;
- var retryLimit = 100;
- var video = $('#video')[0];
- video.onplaying = function (e) {
- var videoWidth = this.videoWidth;
- var videoHeight = this.videoHeight;
- if (!videoWidth || !videoHeight) {
- if (retryCount < retryLimit) {
- retryCount++;
- window.setTimeout(function () {
- video.pause();
- video.play();
- }, 100);
- }
- else {
- video.onplaying = undefined;
- }
- }
- else {
- video.onplaying = undefined;
- defaultheight = 310;
- defaultwidth = Math.round(defaultheight * (videoWidth / videoHeight));
- defaultratio = defaultwidth / defaultheight;
- faktor_zoom = videoWidth / defaultwidth;
- $('#video').attr('height', defaultheight);
- $('#video').attr('width', defaultwidth);
- webcamabstand_seiten = Math.round(((defaultwidth - 233) / 2) * faktor_zoom);
- webcamabstand_seiten_div = Math.round(((defaultwidth - 233) / 2));
- localStorage.setItem("webcamwidth", videoWidth);
- localStorage.setItem("webcamheight", videoHeight);
- localStorage.setItem("webcamratio", videoWidth / videoHeight);
- localStorage.setItem("webcamabstand_seiten", webcamabstand_seiten);
- $('#video').css('left', -webcamabstand_seiten_div);
- $('.LeftBoxWebcamButton').show();
- $('.overlay-webcam-position').show();
- }
- };
- }
- });
- $(document).on("click", "#snap", function () {
- var height = localStorage.getItem("webcamheight");
- var width = localStorage.getItem("webcamwidth");
- var abstand_seiten = localStorage.getItem("webcamabstand_seiten");
- var webcamratio = localStorage.getItem("webcamratio");
- 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) {
- };
- source_width = Math.round(((width) - (abstand_seiten * 2)));
- source_height = height;
- $('.fotoinforechts').hide();
- context.drawImage(video, abstand_seiten, 0, source_width, source_height, 0, 0, 233, 310);
- context_big.drawImage(video, abstand_seiten, 0, source_width, source_height, 0, 0, 233, 310);
- window.localStorage.setItem("SHOWTRYON", "1");
- $('button.webcam_foto_upload_now').addClass('activecambutton');
- });
- })(jQuery);
- ;
- (function ($) {
- $(function () {
- $('#search_head').on('submit', function () {
- var $inp = $('input', $(this));
- var searchPhrase = $inp.val();
- if (searchPhrase == $inp.prop('defaultValue')) {
- return false;
- }
- ___b24.tracking.search(searchPhrase);
- return true;
- });
- });
- })(jQuery);
- ;
- (function (root, factory) {
- if (typeof define === 'function' && define.amd) {
- define(factory);
- }
- else if (typeof exports === 'object') {
- module.exports = factory(require, exports, module);
- }
- else {
- root.ouibounce = factory();
- }
- }(this, function (require, exports, module) {
- return function ouibounce(el, config) {
- var config = config || {}, aggressive = config.aggressive || false, sensitivity = setDefault(config.sensitivity,
- 20), timer = setDefault(config.timer, 1000), delay = setDefault(config.delay, 0), callback = config.callback || function () {
- }, cookieExpire = setDefaultCookieExpire(config.cookieExpire) || '', cookieDomain = config.cookieDomain ? ';domain=' + config.cookieDomain :
- '', sitewide = config.sitewide === true ? ';path=/' : '', _delayTimer = null, _html = document.documentElement;
- function setDefault(_property, _default) {
- return typeof _property === 'undefined' ? _default : _property;
- }
- function setDefaultCookieExpire(days) {
- var ms = days * 24 * 60 * 60 * 1000;
- var date = new Date();
- date.setTime(date.getTime() + ms);
- return"; expires=" + date.toUTCString();
- }
- setTimeout(attachOuiBounce, timer);
- function attachOuiBounce() {
- _html.addEventListener('mouseleave', handleMouseleave);
- _html.addEventListener('mouseenter', handleMouseenter);
- _html.addEventListener('keydown', handleKeydown);
- }
- function handleMouseleave(e) {
- if (e.clientY > sensitivity || (checkCookieValue('viewedOuibounceModal', 'true') && !aggressive)) {
- return;
- }
- _delayTimer = setTimeout(_fireAndCallback, delay);
- }
- function handleMouseenter(e) {
- if (_delayTimer) {
- clearTimeout(_delayTimer);
- _delayTimer = null;
- }
- }
- var disableKeydown = false;
- function handleKeydown(e) {
- if (disableKeydown || checkCookieValue('viewedOuibounceModal', 'true') && !aggressive) {
- return;
- }
- else if (!e.metaKey || e.keyCode !== 76) {
- return;
- }
- disableKeydown = true;
- _delayTimer = setTimeout(_fireAndCallback, delay);
- }
- function checkCookieValue(cookieName, value) {
- return parseCookies()[cookieName] === value;
- }
- function parseCookies() {
- var cookies = document.cookie.split('; ');
- var ret = {};
- for (var i = cookies.length - 1; i >= 0; i--) {
- var el = cookies[i].split('=');
- ret[el[0]] = el[1];
- }
- return ret;
- }
- function _fireAndCallback() {
- fire();
- callback();
- }
- function fire() {
- if (el) {
- el.style.display = 'block';
- }
- disable();
- }
- function disable(options) {
- var options = options || {};
- if (typeof options.cookieExpire !== 'undefined') {
- cookieExpire = setDefaultCookieExpire(options.cookieExpire);
- }
- if (options.sitewide === true) {
- sitewide = ';path=/';
- }
- if (typeof options.cookieDomain !== 'undefined') {
- cookieDomain = ';domain=' + options.cookieDomain;
- }
- document.cookie = 'viewedOuibounceModal=true' + cookieExpire + cookieDomain + sitewide;
- _html.removeEventListener('mouseleave', handleMouseleave);
- _html.removeEventListener('mouseenter', handleMouseenter);
- _html.removeEventListener('keydown', handleKeydown);
- }
- return{fire: fire, disable: disable};
- };
- }));
- ;
- (function ($) {
- if (jQuery.browser.mobile === true) {
- $("html").addClass('is_mobile');
- }
- eKomiIntegrationConfig = new Array({certId: '73215AD7D54A234'});
- if (typeof eKomiIntegrationConfig != "undefined") {
- var eKomiIntegrationLoop = 0;
- }
- $(document).on('click', '.REQUIRED', function () {
- var message = $(this).metadata().message;
- var field = $(this).metadata().field;
- var $field = $(field);
- if ($field.val() == "") {
- $field.parent().addClass('redborder');
- alert(message)
- return false;
- }
- else {
- return true;
- }
- return false;
- });
- $(document).on('click', '.CONFIRM', function () {
- var data = $(this).metadata();
- if (typeof(data) != 'object') {
- return true;
- }
- if (typeof(data.message) != 'string') {
- return true;
- }
- if (confirm(data.message)) {
- return true;
- }
- return false;
- });
- $(document).on('click', '.ALERT', function () {
- var data = $(this).metadata();
- if (typeof(data) != 'object') {
- return true;
- }
- if (typeof(data.message) != 'string') {
- return true;
- }
- alert(data.message);
- return false;
- });
- $(document).on('click', '.SKU_HIDDEN_HINT', function (e) {
- if (!e.ctrlKey) {
- return true;
- }
- $t = $(this);
- if (typeof($t.metadata().sku) == 'string') {
- $t.append('<span style="color: white; background: red" />');
- $t.find('span').text($t.metadata().sku);
- $t.css('overflow', 'visible');
- }
- return false;
- });
- $(document).on('click', '.COUPON_CODE_SETTER', function () {
- var code = $(this).find('span').text();
- $('#coupon_code').val(code);
- });
- $(document).on('focusout', '.TRIM', function () {
- $t = $(this);
- $t.val($.trim($t.val()));
- });
- var categoryBannerSwitch = function () {
- var name = 'b24_banner_switch';
- var expTTL = 86400000;
- var variant = $.jStorage.get(name, "0");
- if (typeof($.getlocations().params.b24_banner_switch) == 'string') {
- variant = $.getlocations().params.b24_banner_switch;
- $.jStorage.set(name, variant, {TTL: expTTL});
- }
- $('html').addClass(name + '_' + variant);
- };
- $(function () {
- categoryBannerSwitch();
- $('.COUNTDOWN').each(function () {
- var $t = $(this);
- var text = $t.text();
- var match = text.match(/(\d)+/i);
- if (match != null || !match.length) {
- var url = $t.metadata().url;
- if (typeof(url) == 'undefined') {
- url = '/';
- }
- var interval = setInterval(function () {
- var number = parseInt($t.text().match(/(\d)+/i)[0]);
- number--;
- $t.text($t.text().replace(/(\d)+/i, number));
- if (number < 1) {
- window.clearInterval(interval);
- $.getlocations(url);
- }
- }, 1000);
- }
- });
- $('.FACEBOOK_LIKES').each(function () {
- var $this = $(this);
- if ($('link[rel=canonical]').length > 0) {
- var fb_url = $('link[rel=canonical]').attr('href');
- }
- else {
- var fb_url = $(location).attr('href').split('?')[0];
- }
- $.getJSON("https://graph.facebook.com/fql?q=SELECT url,normalized_url,share_count,like_count,comment_count,total_count FROM link_stat WHERE url='"
- + fb_url + "'", function (data) {
- if ((data['data'][0].like_count + data['data'][0].share_count) > 0) {
- $this.text(data['data'][0].like_count + data['data'][0].share_count);
- }
- else {
- $this.text('0');
- }
- });
- });
- });
- $(function () {
- if ($('body').hasClass('catalog-product-view')) {
- var b24ProductBanner = ['hamburg', 'dusseldorf', 'berlin', 'bremen', 'munchen', 'koln'];
- var bodyClass = $('body').attr('class').match(/.*\bproduct-([a-zA-Z]*)\b.*/m);
- if (b24ProductBanner.indexOf(bodyClass[1]) != -1) {
- $('.breadcrumbs').after('<div class="bannerAD"><img src="http://asset.brille24.de/fileadmin/Redakteur/shopbanner/productview/'
- + bodyClass[1] + '.jpg" class="bannerADclick"></div>');
- }
- }
- ;
- if ($('html').hasClass('frontmode_heine')
- && !$('body').is('.checkout-onepage-index, .checkout-onepage-success, .category-kontaktlinsen, .category-pflegemittel')) {
- $('.breadcrumbs').after('<div class="bannerAD"><img src="//asset.brille24.de/fileadmin/Redakteur/shopbanner/Banner_Heine_04_2014.jpg"></div>');
- }
- ;
- });
- $(document).on('click', '.cockpit_navigation.clearfix .nav', function () {
- ___b24.tracking.freeEvent('cockpit', $(this).attr('data-track'));
- if ($(this).hasClass('socialnetworks')) {
- if ($('.nav.socialnetworks').hasClass('active')) {
- $('.SOCIALNETWORKS .box').animate({left: 200}, 500, function () {
- $('.nav.socialnetworks').removeClass('active');
- $('.cockpit_navigation .SOCIALNETWORKS .box-canvas').hide();
- });
- }
- else {
- $('.SOCIALNETWORKS .box').animate({left: 0}, 500);
- $('.nav.socialnetworks').addClass('active');
- $('.cockpit_navigation .SOCIALNETWORKS .box-canvas').show();
- }
- return false;
- }
- });
- $(document).on('click', 'body', function () {
- if ($('.cockpit_navigation .nav').hasClass("active")) {
- $('.SOCIALNETWORKS .box').animate({left: 200}, 500, function () {
- $('.nav.socialnetworks').removeClass('active');
- $('.cockpit_navigation .SOCIALNETWORKS .box-canvas').hide();
- });
- }
- });
- })(jQuery);
- var B24Tools = {getCategory: function () {
- if (typeof(category_id) == "number") {
- return category_id;
- }
- var $ = jQuery;
- window.category_id = $('body').attr('class').match(/\bcategory-id-\d+/i);
- if (category_id == null) {
- category_id = 0;
- }
- else {
- category_id = category_id[0].match(/\d+/i)[0];
- category_id
- }
- category_id = parseInt(category_id);
- return category_id;
- }, json2string: function (json) {
- if (typeof(json) != 'object') {
- return"{}";
- }
- var string = '{';
- jQuery.each(json, function (key, value) {
- string += '"' + key + '":"' + value + '",';
- });
- string = string.replace(/\,$/i, '');
- string += '}';
- return string;
- }};
- (function ($) {
- $(document).ready(function () {
- var oiboxloginstatus = false;
- if ($.cookie('newsletter_status') == '1') {
- oiboxloginstatus = true;
- }
- if (oiboxloginstatus === false) {
- 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>';
- $('body').append(oiboxcontent);
- var _ouibounce = ouibounce(document.getElementById('ouibounce-modal'),
- {aggressive: false, cookieExpire: 31, sitewide: true, callback: function () {
- ___b24.tracking.freeEvent('ExitIntent', 'fired');
- }});
- $('body').on('click', function () {
- $('#ouibounce-modal').hide();
- });
- $('#ouibounce-modal .modal-footer, #ouibounce-modal .buttonclose').on('click', function () {
- $('#ouibounce-modal').hide();
- });
- $('#ouibounce-modal .modal').on('click', function (e) {
- e.stopPropagation();
- });
- }
- });
- })(jQuery);
- ;
- ;
- (function ($) {
- $(function () {
- $.fn.extend({Check_For_Coupon_Values: function () {
- if ($('.checkout-onepage-success').length > 0) {
- $.fn.Delete_Coupon_Values();
- }
- else if (($.getlocations().params.coupon_t != null) && ($.getlocations().params.coupon_t != "") && ($.getlocations().params.coupon_c
- != null) && ($.getlocations().params.coupon_c != "") && ($.getlocations().params.coupon_v != null)
- && ($.getlocations().params.coupon_v != "")) {
- var coupon_t = decodeURIComponent($.getlocations().params.coupon_t);
- var coupon_v = decodeURIComponent($.getlocations().params.coupon_v);
- var coupon_c = decodeURIComponent($.getlocations().params.coupon_c);
- $.fn.Write_Coupon_Values({coupon_t: coupon_t, coupon_v: coupon_v, coupon_c: coupon_c});
- }
- else if (((sessionStorage.getItem("coupon_t") != null) && (sessionStorage.getItem("coupon_t") != ""))
- && ((sessionStorage.getItem("coupon_c") != null) && (sessionStorage.getItem("coupon_c") != ""))
- && ((sessionStorage.getItem("coupon_v") != null) && (sessionStorage.getItem("coupon_v") != ""))) {
- var coupon_t = sessionStorage.getItem("coupon_t");
- var coupon_c = sessionStorage.getItem("coupon_c");
- var coupon_v = sessionStorage.getItem("coupon_v");
- $.fn.Write_Coupon_Values({coupon_t: coupon_t, coupon_v: coupon_v, coupon_c: coupon_c});
- }
- ;
- }, Load_Coupon_Values: function () {
- coupon_t = sessionStorage.getItem("coupon_t");
- coupon_c = sessionStorage.getItem("coupon_c");
- coupon_v = sessionStorage.getItem("coupon_v");
- $.fn.Show_Coupon_Footer({coupon_t: coupon_t, coupon_v: coupon_v, coupon_c: coupon_c});
- }, Delete_Coupon_Values: function () {
- sessionStorage.removeItem("coupon_t");
- sessionStorage.removeItem("coupon_c");
- sessionStorage.removeItem("coupon_v");
- }, Write_Coupon_Values: function (options) {
- var defaults = {coupon_t: null, coupon_c: null, coupon_v: null};
- var options = $.extend(defaults, options);
- sessionStorage.setItem("coupon_t", options.coupon_t);
- sessionStorage.setItem("coupon_c", options.coupon_c);
- sessionStorage.setItem("coupon_v", options.coupon_v);
- $.fn.Show_Coupon_Footer({coupon_t: options.coupon_t, coupon_v: options.coupon_v, coupon_c: options.coupon_c});
- }, Show_Coupon_Footer: function (options) {
- var defaults = {coupon_t: null, coupon_c: null, coupon_v: null};
- var showCouponCode = '<div id="COUPON_FOOTER"><div class="text">';
- showCouponCode += options.coupon_t + ' <div class="coupon_code">' + options.coupon_c + '</div> ' + options.coupon_v;
- showCouponCode += '<button class="green"><span>Jetzt einlösen</span></button></div></div>';
- $('body').append(showCouponCode);
- $('html').addClass('footer_coupon_true');
- $('#COUPON_FOOTER').show();
- if ($('body').hasClass('checkout-cart-index')) {
- if (document.getElementById('noCouponMode')) {
- $('#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>');
- }
- ;
- if (document.getElementById('coupon_code')) {
- $('#coupon_code').attr('value', options.coupon_c);
- $('#coupon_code').css({"color": "#444"});
- if ($('#remove-coupone').val() == 0) {
- $('#COUPON_FOOTER button').show();
- $(document).on('click', '#COUPON_FOOTER button', function () {
- $('form#discount-coupon-form').submit();
- });
- }
- }
- ;
- }
- }});
- $.fn.Check_For_Coupon_Values();
- });
- })(jQuery);
- ;
- ;
- function bodyinit() {
- }
- (function ($) {
- $(function () {
- if (typeof($.cookie) == 'function' && !!$.cookie('personalisation')) {
- userPersonalisation = $.parseJSON($.cookie('personalisation'));
- if (userPersonalisation.logged_in) {
- $('html').addClass('logged_in');
- }
- else {
- $('html').addClass('logged_out');
- }
- $('.cart_items').text(userPersonalisation.cart_count);
- }
- wishlistCountSet = function () {
- var wishlistCount = 0;
- if ($.cookie('wishlist_count') != null) {
- wishlistCount = $.cookie('wishlist_count');
- }
- else {
- $.ajax({type: "GET", url: '/shop/wishlist/index/ajaxindex/', dataType: 'json', cache: false, success: function (data) {
- var wishlistItems = JSON.stringify(data);
- window.localStorage.setItem('wishlist', wishlistItems);
- var wishlistItemsCount = $.parseJSON(wishlistItems);
- var wishlistCount = 0;
- $.each(wishlistItemsCount, function (i, items) {
- wishlistCount = wishlistCount + 1;
- console.log(wishlistCount);
- });
- $.cookie('wishlist_count', wishlistCount, {path: '/'});
- if (wishlistCount > 0) {
- $('#header .wishlist .count').html('(' + wishlistCount + ')');
- }
- else {
- $('#header .wishlist .count').html('');
- }
- }, error: function (data) {
- ___b24.tracking.error('Wishlist', 'AjaxError');
- }});
- }
- if (wishlistCount > 0) {
- $('#header .wishlist .count').html('(' + wishlistCount + ')');
- }
- else {
- $('#header .wishlist .count').html('');
- }
- }
- if (typeof($.cookie) == 'function') {
- wishlistCountSet();
- }
- $(document).on('click', '.HISTORY_BACK', function () {
- history.back();
- return false;
- });
- $(document).on('click', '.NEW_WINDOW, .OUTBOUND', function () {
- var href = this.href;
- ___b24.tracking.freeEvent('Outbound', href);
- setTimeout(function () {
- window.open(href);
- }, 800);
- return false;
- });
- window.$breadcrumb = $('#breadcrumb, .breadcrumbs');
- if (!$breadcrumb.find('.reference').length) {
- $breadcrumb.find('.reference_this').hide();
- }
- $breadcrumb.show();
- if (history.length > 1) {
- $breadcrumb.prepend('<a href="#" class="HISTORY_BACK">< Zurück</a> | ');
- }
- $("img.lazy").unveil(200, function () {
- $(this).load(function () {
- this.style.opacity = 1;
- });
- });
- });
- })(jQuery);
- (function ($) {
- $(function () {
- if (typeof($.getlocations().params.bb_geschlecht) == 'string' && typeof($.getlocations().params.bb_brille) == 'string') {
- var gender = $.getlocations().params.bb_geschlecht;
- var glass = $.getlocations().params.bb_brille;
- var bb_gender_man = '14579.68698';
- var bb_gender_woman = '14579.68699';
- var bb_glass_single = '15699.73378';
- var bb_glass_progressive = '15699.73379';
- if ($('#brillenberater').length) {
- var bb_url = $('#brillenberater').attr('src');
- if (gender == 'herren' && glass == 'einstaerkenbrille') {
- $('#brillenberater').attr('src', bb_url + '&p=' + bb_gender_man + '&p=' + bb_glass_single);
- }
- else if (gender == 'herren' && glass == 'gleitsichtbrille') {
- $('#brillenberater').attr('src', bb_url + '&p=' + bb_gender_man + '&p=' + bb_glass_progressive);
- }
- else if (gender == 'damen' && glass == 'einstaerkenbrille') {
- $('#brillenberater').attr('src', bb_url + '&p=' + bb_gender_woman + '&p=' + bb_glass_single);
- }
- else if (gender == 'damen' && glass == 'gleitsichtbrille') {
- $('#brillenberater').attr('src', bb_url + '&p=' + bb_gender_woman + '&p=' + bb_glass_progressive);
- }
- }
- }
- });
- })(jQuery);
- (function ($) {
- if (typeof($.getlocations().params.b24_associate) == 'string') {
- var associate = $.getlocations().params.b24_associate;
- associate = associate.toLowerCase();
- associate = $.trim(associate);
- associate = associate.replace(/[äöü\?\ ]/gi, '_');
- if (associate != 'null') {
- $.cookie('b24_associate', 'associate_' + associate, {path: '/'});
- }
- else {
- $.cookie('b24_associate', null, {path: '/'});
- }
- }
- if ($.cookie('b24_associate') != null) {
- $('html').addClass($.cookie('b24_associate'));
- }
- })(jQuery);
- var B24_survey_layer = (function ($) {
- var pub = {};
- var displayMode = null;
- pub.init = function () {
- if (getDisplayMode() && B24_shoplocation.get() == 'homepage') {
- setTimeout(setLayer, 1000);
- }
- }
- getDisplayMode = function () {
- if (displayMode != null) {
- return displayMode;
- }
- setDisplayMode();
- return displayMode;
- }
- setDisplayMode = function () {
- var c = $.cookie('b24_survey');
- if (c == null) {
- displayMode = getOneOfThree();
- $.cookie('b24_survey', displayMode ? '1' : '0', {path: '/'});
- return displayMode;
- }
- displayMode = c == '1' ? true : false;
- return displayMode;
- }
- pub.setMode = function (mode) {
- displayMode = mode;
- $.cookie('b24_survey', displayMode ? '1' : '0', {path: '/'});
- displayMode ? setLayer() : removeLayer();
- return displayMode;
- }
- pub.getMode = function () {
- return getDisplayMode();
- }
- getOneOfThree = function () {
- var ran = Math.round(Math.random() * 10) % 3;
- if (ran == 1) {
- return true;
- }
- return false;
- }
- setLayer = function () {
- $('#survey_layer').remove();
- $('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>');
- }
- removeLayer = function () {
- $('#survey_layer').remove();
- }
- return pub;
- })(jQuery);
- ;
- window.B24_items = {};
- (function ($) {
- $(init);
- function init() {
- $ci = $('.CALL_ITEMS');
- if (!$ci.length) {
- return false;
- }
- $ci.each(function () {
- renderItems($(this));
- });
- }
- function renderItems($t) {
- var url = '/shop/productinfo/index/multiple/data/[' + getItemsList($t) + ']';
- $.ajax({url: url, cache: false, dataType: 'json', success: function (data) {
- B24_items.push(data);
- buildItems($t, data);
- }, error: function () {
- $t.html('<p class="error">Ein Fehler ist aufgetaucht. Bitte laden Sie diese Seite neu.</p>');
- }});
- return true;
- }
- function getItemsList($t) {
- var sku_arr = $t.metadata().items;
- var sku_json = '';
- $.each(sku_arr, function (index, value) {
- sku_json += '"' + value + '",';
- });
- sku_json = sku_json.replace(/\,$/i, '');
- window.B24_items = sku_arr;
- return sku_json;
- }
- function buildItems($t, data) {
- var $item = $('<div />');
- $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>');
- $.each(data, function (key, value) {
- if (value.is_salable) {
- var $clone = $item.clone();
- $clone.find('h2').text(value.name);
- $clone.find('img').attr('src', value.generated_images[220]);
- $clone.find('p.description').html(value.short_description);
- if ($ci.hasClass('progressive')) {
- formated_price = '149,90 € *';
- }
- else {
- var formated_price = value.calculated_price;
- formated_price = formated_price.toFixed(2) + ' ';
- formated_price = formated_price.replace(/\./i, ',');
- formated_price += '€ *';
- }
- $clone.find('.price').html('<div class="category-from-price">ab </div>' + formated_price);
- if ($ci.hasClass('progressive')) {
- $clone.find('a').attr('href', value.url_path + '?glass=progressive');
- }
- else {
- $clone.find('a').attr('href', value.url_path);
- }
- $t.append($clone.show());
- }
- });
- }
- })(jQuery);
- (function ($) {
- $(init);
- function init() {
- $lp = $('.LOAD_PRODUCTS');
- if (!$lp.length) {
- return false;
- }
- $lp.each(function () {
- renderProducts($(this));
- });
- }
- function renderProducts($t) {
- var products = $t.data('products').replace(/,/g, '","');
- var url = '/shop/productinfo/index/products/products/["' + products + '"]?load';
- if ($t.data('glass')) {
- url += '&glass=' + $t.data('glass');
- if ($t.data('glass') == 'progressive') {
- $t.addClass('progressive');
- }
- }
- if ($t.data('glassmode')) {
- url += '&mode=' + $t.data('glassmode');
- }
- if ($t.data('sticker')) {
- if ($t.data('sticker') == 'new') {
- $t.addClass('sticker new');
- }
- else if ($t.data('sticker') == 'top') {
- $t.addClass('sticker top');
- }
- else if ($t.data('sticker') == 'sport') {
- $t.addClass('sticker sport');
- }
- else if ($t.data('sticker') == 'percent') {
- $t.addClass('sticker percent');
- }
- }
- $.ajax({url: url, cache: true, dataType: 'json', success: function (data) {
- buildProductList($t, data);
- }, error: function () {
- $t.html('<p class="error">Ein Fehler ist aufgetaucht. Bitte laden Sie diese Seite neu. [1510]</p>');
- }});
- return true;
- }
- function formatPrice(price) {
- var formated_price = price;
- formated_price = formated_price.toFixed(2) + ' ';
- formated_price = formated_price.replace(/\./i, ',');
- formated_price += '€*';
- return formated_price;
- }
- function buildProductList($t, data) {
- var $item = $('<div class="item" />');
- $item.html('<a><h2 /><span class="img"><img class="image" width="210" height="140"></span><span class="price" /></a>');
- $.each(data, function (key, value) {
- if (value.is_salable) {
- var $clone = $item.clone();
- $clone.find('h2').text(value.name);
- $clone.find('img').attr('src', value.generated_images[210]);
- $clone.find('p.description').html(value.short_description);
- $clone.find('a').attr('href', value.url_path);
- var formated_price = formatPrice(value.uvp);
- $clone.find('.price').html('<span class="b24_normal_price">' + formated_price + '</div>');
- if (value.uvp > value.calculated_price) {
- $clone.find('a').addClass('b24_special_price');
- var formated_price = formatPrice(value.calculated_price);
- $clone.find('.b24_normal_price').after('<span class="b24_special_price">ab ' + formated_price + '</span>');
- }
- if ($t.data('sticker')) {
- $clone.find('.img').prepend('<span class="sticker"/>');
- }
- $t.append($clone);
- }
- });
- }
- })(jQuery);
- (function ($) {
- $(init);
- function init() {
- $ls = $('.LOAD_SLIDER');
- if (!$ls.length) {
- return false;
- }
- $ls.each(function () {
- renderProducts($(this));
- });
- }
- function CallSlickSliderFunction(classname, porductcount) {
- $('div.' + classname).slick({dots: false, infinite: true, slidesToShow: porductcount, slidesToScroll: porductcount});
- }
- function renderProducts($t) {
- var products = $t.data('products').replace(/,/g, '","');
- var url = '/shop/productinfo/index/products/products/["' + products + '"]?load';
- if ($t.data('glass')) {
- url += '&glass=' + $t.data('glass');
- if ($t.data('glass') == 'progressive') {
- $t.addClass('progressive');
- }
- }
- if ($t.data('glassmode')) {
- url += '&mode=' + $t.data('glassmode');
- }
- if ($t.data('sticker')) {
- if ($t.data('sticker') == 'new') {
- $t.addClass('sticker new');
- }
- else if ($t.data('sticker') == 'top') {
- $t.addClass('sticker top');
- }
- else if ($t.data('sticker') == 'sport') {
- $t.addClass('sticker sport');
- }
- else if ($t.data('sticker') == 'percent') {
- $t.addClass('sticker percent');
- }
- }
- $.ajax({url: url, cache: true, dataType: 'json', success: function (data) {
- buildSlider($t, data);
- }, error: function () {
- $t.html('<p class="error">Ein Fehler ist aufgetaucht. Bitte laden Sie diese Seite neu. [1510]</p>');
- }});
- return true;
- }
- function formatPrice(price) {
- var formated_price = price;
- formated_price = formated_price.toFixed(2) + ' ';
- formated_price = formated_price.replace(/\./i, ',');
- formated_price += '€*';
- return formated_price;
- }
- function buildSlider($t, data) {
- var $item = "";
- $.each(data, function (key, value) {
- if (value.is_salable) {
- $item += '<div class="swiper-slide">';
- $item += '<a href="' + value.url_path + '">';
- if ($t.data('sticker')) {
- $item += '<span class="sticker"></span>';
- }
- var formated_price = formatPrice(value.uvp);
- if (value.uvp > value.calculated_price) {
- var formated_special_price = formatPrice(value.calculated_price);
- $item +=
- '<span class="price b24_special"><span class="b24_normal_price">' + formated_price
- + '</span><span class="b24_special_price"><div class="category-from-price">ab </div>' + formated_special_price
- + '</span></span>';
- }
- else {
- $item +=
- '<span class="price"><span class="b24_normal_price"><div class="category-from-price">ab </div>' + formated_price
- + '</span></span>';
- }
- $item += '<span class="name">Modell: ' + value.name + '</span>';
- $item += '<img src="' + value.generated_images[210] + '" width="150" />';
- $item += '</a>';
- $item += '</div>';
- }
- });
- if ($t.hasClass('big')) {
- product_count = 5;
- }
- else {
- product_count = 4;
- }
- var time = new Date().getTime();
- var uniqueclassname = "SLICK_" + time;
- $t.addClass(uniqueclassname);
- var sliderCanvas = $item;
- $t.html(sliderCanvas);
- CallSlickSliderFunction(uniqueclassname, product_count);
- }
- })(jQuery);
- (function ($) {
- $(init_slider);
- function init_slider() {
- $ciSlider = $('.CALL_SLIDER');
- if (!$ciSlider.length) {
- return false;
- }
- $ciSlider.each(function () {
- renderSliderItems($(this));
- });
- }
- function getItemsList($t) {
- var sku_arr = $t.metadata().items;
- var sku_json = '';
- $.each(sku_arr, function (index, value) {
- sku_json += '"' + value + '",';
- });
- sku_json = sku_json.replace(/\,$/i, '');
- window.B24_items = sku_arr;
- return sku_json;
- }
- function renderSliderItems($t) {
- var url = '/shop/productinfo/index/multiple/data/[' + getItemsList($t) + ']';
- $.ajax({url: url, cache: false, dataType: 'json', success: function (data) {
- var $item = "";
- $.each(data, function (key, value) {
- if (value.is_salable) {
- $item += '<div class="swiper-slide">';
- if ($t.hasClass('progressive')) {
- $item += '<a href="' + value.url_path + '?glass=progressive">';
- }
- else {
- $item += '<a href="' + value.url_path + '">';
- }
- if ($t.hasClass('progressive')) {
- var formated_price = value.calculated_price;
- formated_price = formated_price + 110;
- formated_price = formated_price.toFixed(2) + ' ';
- formated_price = formated_price.replace(/\./i, ',');
- formated_price += '€ *';
- }
- else {
- var formated_price = value.calculated_price;
- formated_price = formated_price.toFixed(2) + ' ';
- formated_price = formated_price.replace(/\./i, ',');
- formated_price += '€ *';
- }
- $item += '<span class="price"><div class="category-from-price">ab </div>' + formated_price + '</span>';
- $item += '<span class="name">Modell: ' + value.name + '</span>';
- if ($t.hasClass('sticker_top')) {
- $item += '<span class="sticker top"></span>';
- }
- else if ($t.hasClass('sticker_new')) {
- $item += '<span class="sticker new"></span>';
- }
- $item += '<img src="' + value.generated_images[220] + '" width="150" />';
- $item += '</a>';
- $item += '</div>';
- }
- });
- var sliderCanvas = '<div class="glasses-slider swiper"><div class="arrow-left gradient"></div><div class="glasses-container swiper-container"><div class="swiper-wrapper">'
- + $item + '</div></div><div class="arrow-right gradient"></div></div>';
- $t.after(sliderCanvas);
- $t.remove();
- if ($t.hasClass('big')) {
- $('.glasses-slider').addClass('bigSlider');
- var glassesSlider = $('.glasses-container').swiper({slidesPerView: 5, slidesPerGroup: 5, loop: true, calculateHeight: true, useCSS3Transforms: false});
- }
- else {
- var glassesSlider = $('.glasses-container').swiper({slidesPerView: 4, slidesPerGroup: 4, loop: true, calculateHeight: true});
- }
- $('.arrow-left').on('click', function (e) {
- glassesSlider.swipePrev();
- })
- $('.arrow-right').on('click', function (e) {
- glassesSlider.swipeNext();
- })
- }, error: function () {
- $t.html('<p class="error">Ein Fehler ist aufgetaucht. Bitte laden Sie diese Seite neu.</p>');
- }});
- return true;
- }
- })(jQuery);
- ;
- if (($.jStorage.get('b24_mobile') != 0 && $.browser.mobile && location.pathname.match(/^\//i) && $.getlocations().params.b24_m != 0)
- || ($.getlocations().params.b24_m == 1)) {
- $('html').addClass('mobilepage');
- $(function () {
- var mobileSlider = $('.swiper-container').swiper({loop: true, autoplay: true, speed: 700, autoplay: 3000, calculateHeight: true, pagination: '.pagination', paginationClickable: true});
- });
- }
- else if ($.getlocations().params.b24_m == 0) {
- $.jStorage.set('b24_mobile', 0);
- }
- ;
- ;
- (function ($) {
- function maybeCall(thing, ctx) {
- return(typeof thing == 'function') ? (thing.call(ctx)) : thing;
- };
- function isElementInDOM(ele) {
- while (ele = ele.parentNode) {
- if (ele == document) {
- return true;
- }
- }
- return false;
- };
- function Tipsy(element, options) {
- this.$element = $(element);
- this.options = options;
- this.enabled = true;
- this.fixTitle();
- };
- Tipsy.prototype = {show: function () {
- var title = this.getTitle();
- if (title && this.enabled) {
- var $tip = this.tip();
- $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
- $tip[0].className = 'tipsy';
- $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
- var pos = $.extend({}, this.$element.offset(), {width: this.$element[0].offsetWidth, height: this.$element[0].offsetHeight});
- var actualWidth = $tip[0].offsetWidth, actualHeight = $tip[0].offsetHeight, gravity = maybeCall(this.options.gravity, this.$element[0]);
- var tp;
- switch (gravity.charAt(0)) {
- case'n':
- tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
- break;
- case's':
- tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
- break;
- case'e':
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
- break;
- case'w':
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
- break;
- }
- if (gravity.length == 2) {
- if (gravity.charAt(1) == 'w') {
- tp.left = pos.left + pos.width / 2 - 15;
- }
- else {
- tp.left = pos.left + pos.width / 2 - actualWidth + 15;
- }
- }
- $tip.css(tp).addClass('tipsy-' + gravity);
- $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
- if (this.options.className) {
- $tip.addClass(maybeCall(this.options.className, this.$element[0]));
- }
- if (this.options.fade) {
- $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
- }
- else {
- $tip.css({visibility: 'visible', opacity: this.options.opacity});
- }
- }
- }, hide: function () {
- if (this.options.fade) {
- this.tip().stop().fadeOut(function () {
- $(this).remove();
- });
- }
- else {
- this.tip().remove();
- }
- }, fixTitle: function () {
- var $e = this.$element;
- if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
- $e.attr('original-title', $e.attr('title') || '').removeAttr('title');
- }
- }, getTitle: function () {
- var title, $e = this.$element, o = this.options;
- this.fixTitle();
- var title, o = this.options;
- if (typeof o.title == 'string') {
- title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
- }
- else if (typeof o.title == 'function') {
- title = o.title.call($e[0]);
- }
- title = ('' + title).replace(/(^\s*|\s*$)/, "");
- return title || o.fallback;
- }, tip: function () {
- if (!this.$tip) {
- this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
- this.$tip.data('tipsy-pointee', this.$element[0]);
- }
- return this.$tip;
- }, validate: function () {
- if (!this.$element[0].parentNode) {
- this.hide();
- this.$element = null;
- this.options = null;
- }
- }, enable: function () {
- this.enabled = true;
- }, disable: function () {
- this.enabled = false;
- }, toggleEnabled: function () {
- this.enabled = !this.enabled;
- }};
- $.fn.tipsy = function (options) {
- if (options === true) {
- return this.data('tipsy');
- }
- else if (typeof options == 'string') {
- var tipsy = this.data('tipsy');
- if (tipsy) {
- tipsy[options]();
- }
- return this;
- }
- options = $.extend({}, $.fn.tipsy.defaults, options);
- function get(ele) {
- var tipsy = $.data(ele, 'tipsy');
- if (!tipsy) {
- tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
- $.data(ele, 'tipsy', tipsy);
- }
- return tipsy;
- }
- function enter() {
- var tipsy = get(this);
- tipsy.hoverState = 'in';
- if (options.delayIn == 0) {
- tipsy.show();
- }
- else {
- tipsy.fixTitle();
- setTimeout(function () {
- if (tipsy.hoverState == 'in') {
- tipsy.show();
- }
- }, options.delayIn);
- }
- };
- function leave() {
- var tipsy = get(this);
- tipsy.hoverState = 'out';
- if (options.delayOut == 0) {
- tipsy.hide();
- }
- else {
- setTimeout(function () {
- if (tipsy.hoverState == 'out') {
- tipsy.hide();
- }
- }, options.delayOut);
- }
- };
- if (!options.live) {
- this.each(function () {
- get(this);
- });
- }
- if (options.trigger != 'manual') {
- var eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
- if (options.live) {
- $(this.context).on(eventIn, this.selector, enter).on(eventOut, this.selector, leave);
- }
- else {
- this.on(eventIn, enter).on(eventOut, leave);
- }
- }
- return this;
- };
- $.fn.tipsy.defaults =
- {className: null, delayIn: 0, delayOut: 0, fade: false, fallback: '', gravity: 'n', html: false, live: false, offset: 0, opacity: 0.8, title: 'title', trigger: 'hover'};
- $.fn.tipsy.revalidate = function () {
- $('.tipsy').each(function () {
- var pointee = $.data(this, 'tipsy-pointee');
- if (!pointee || !isElementInDOM(pointee)) {
- $(this).remove();
- }
- });
- };
- $.fn.tipsy.elementOptions = function (ele, options) {
- return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
- };
- $.fn.tipsy.autoNS = function () {
- return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
- };
- $.fn.tipsy.autoWE = function () {
- return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
- };
- $.fn.tipsy.autoBounds = function (margin, prefer) {
- return function () {
- var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)}, boundTop = $(document).scrollTop()
- + margin, boundLeft = $(document).scrollLeft() + margin, $this = $(this);
- if ($this.offset().top < boundTop) {
- dir.ns = 'n';
- }
- if ($this.offset().left < boundLeft) {
- dir.ew = 'w';
- }
- if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) {
- dir.ew = 'e';
- }
- if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) {
- dir.ns = 's';
- }
- return dir.ns + (dir.ew ? dir.ew : '');
- }
- };
- })(jQuery);
- ;
- (function ($) {
- function toIntegersAtLease(n) {
- return n < 10 ? '0' + n : n;
- }
- Date.prototype.toJSON = function (date) {
- return this.getUTCFullYear() + '-' + toIntegersAtLease(this.getUTCMonth()) + '-' + toIntegersAtLease(this.getUTCDate());
- };
- var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g;
- var meta = {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\'};
- $.quoteString = function (string) {
- if (escapeable.test(string)) {
- return'"' + string.replace(escapeable, function (a) {
- var c = meta[a];
- if (typeof c === 'string') {
- return c;
- }
- c = a.charCodeAt();
- return'\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
- }) + '"';
- }
- return'"' + string + '"';
- };
- $.toJSON = function (o, compact) {
- var type = typeof(o);
- if (type == "undefined") {
- return"undefined";
- }
- else if (type == "number" || type == "boolean") {
- return o + "";
- }
- else if (o === null) {
- return"null";
- }
- if (type == "string") {
- return $.quoteString(o);
- }
- if (type == "object" && typeof o.toJSON == "function") {
- return o.toJSON(compact);
- }
- if (type != "function" && typeof(o.length) == "number") {
- var ret = [];
- for (var i = 0; i < o.length; i++) {
- ret.push($.toJSON(o[i], compact));
- }
- if (compact) {
- return"[" + ret.join(",") + "]";
- }
- else {
- return"[" + ret.join(", ") + "]";
- }
- }
- if (type == "function") {
- throw new TypeError("Unable to convert object of type 'function' to json.");
- }
- var ret = [];
- for (var k in o) {
- var name;
- type = typeof(k);
- if (type == "number") {
- name = '"' + k + '"';
- }
- else if (type == "string") {
- name = $.quoteString(k);
- }
- else {
- continue;
- }
- var val = $.toJSON(o[k], compact);
- if (typeof(val) != "string") {
- continue;
- }
- if (compact) {
- ret.push(name + ":" + val);
- }
- else {
- ret.push(name + ": " + val);
- }
- }
- return"{" + ret.join(", ") + "}";
- };
- $.compactJSON = function (o) {
- return $.toJSON(o, true);
- };
- $.evalJSON = function (src) {
- return eval("(" + src + ")");
- };
- $.secureEvalJSON = function (src) {
- var filtered = src;
- filtered = filtered.replace(/\\["\\\/bfnrtu]/g, '@');
- filtered = filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
- filtered = filtered.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
- if (/^[\],:{}\s]*$/.test(filtered)) {
- return eval("(" + src + ")");
- }
- else {
- throw new SyntaxError("Error parsing JSON, source is not valid.");
- }
- };
- })(jQuery);
- ;
- ;
- var ___b24 = ___b24 || {};
- ___b24.RDEdisplay = (function (window, $) {
- var pub = {}, tracking = B24_debug_status.getMode('tracking'), tplIds = [], content = {}, $RDEdisplay, RDEdata = {}, $jQsData = {}, controlgroup = false;
- callerIndex = 0, pub.$jQsData = $jQsData;
- pub.RDEdata = RDEdata;
- pub.tplIds = tplIds;
- var init = function () {
- try {
- if (!tracking) {
- return false;
- }
- $RDEdisplay = $('.rde_display');
- if (!$RDEdisplay.length) {
- return false;
- }
- $.each($RDEdisplay, function (index, value) {
- var tmpl = getTplId($(this));
- if (!!tmpl.id) {
- tplIds.push({$rde: $(this), tlp: tmpl});
- }
- });
- startCall(tplIds[callerIndex]);
- return true;
- }
- catch (err) {
- ___b24.tracking.error('RDEdisplay.init', err);
- return true;
- }
- };
- pub.init = init;
- var registerABTest = function (a) {
- var expID = !a ? '398317' : '398316';
- window.___b24_experiments = window.___b24_experiments || {};
- if (typeof(window.___b24_experiments.RDE_Part_iii) === 'undefined') {
- window.___b24_experiments.RDE_Part_iii = new ___b24.experiment('RDE_Part_iii', ['398316', '398317'], 2, expID);
- ___b24.tracking.freeEvent('AB-RDE-iii', location.pathname, 'Exp_' + window.___b24_experiments.RDE_Part_iii.getExperiment());
- }
- if (window.___b24_experiments.RDE_Part_iii.getExperiment().toString() == '398317') {
- return true;
- }
- return false;
- };
- var getTplId = function ($o) {
- var tplId = {id: false, params: {}};
- var cart = B24_cart_object.getCart();
- var product = B24_product_object.get().sku_extended_clean;
- if (!!cart) {
- tplId.id = 'BSKB24';
- var skus = [];
- $.each(cart.order_items, function (key, value) {
- skus.push(value.product_sku_extended_clean);
- });
- tplId.params = {productid: skus.join(',')};
- }
- else if (product !== 'undefined') {
- tplId.params = {productid: product};
- }
- if ($o.hasClass('rde_homepage')) {
- tplId.id = 'HPB24';
- }
- else if ($o.hasClass('rde_lp_clean')) {
- tplId.id = 'B24LPClean';
- }
- else if ($o.hasClass('rde_lp_progressive')) {
- tplId.id = 'B24LPProgessive';
- }
- else if ($o.hasClass('rde_lp_sunglass')) {
- tplId.id = 'B24LPSunglass';
- }
- else if ($o.hasClass('rde_cart')) {
- var cart = B24_cart_object.getCart();
- if (!!cart) {
- tplId.id = 'BSKB24';
- var skus = [];
- $.each(cart.order_items, function (key, value) {
- skus.push(value.product_sku_extended_clean);
- });
- tplId.params = {productid: skus.join(',')};
- }
- }
- else if ($o.hasClass('rde_productview')) {
- tplId.id = 'PPB24';
- tplId.params = {productid: B24_product_object.get().sku_extended_clean};
- }
- else if (!!$o.attr('class').match(/rde_tpl_([-_a-z0-9]+)/i)) {
- tplId.id = $o.attr('class').match(/rde_tpl_([-_a-z0-9]+)/i)[1];
- }
- return tplId;
- };
- pub.getTplId = getTplId;
- var startCall = function (t) {
- if (typeof($jQsData[t.tlp.id]) === 'object') {
- display(t, $jQsData[t.tlp.id]);
- return true;
- }
- var url = '/___rde/rde_server/res/B24P/recomm/' + t.tlp.id + '/sid/' + ___b24.frontendSession.get();
- $.ajax({url: url, dataType: 'json', data: t.tlp.params, error: function () {
- ___b24.tracking.error('RDEdisplay.startCall', url + '?' + $.param(t.tlp.params));
- nextCall();
- }, success: function (data) {
- gatherData(t, data);
- }});
- };
- var nextCall = function () {
- callerIndex++;
- if (callerIndex < tplIds.length) {
- startCall(tplIds[callerIndex]);
- }
- }
- var gatherData = function (t, data) {
- data = reorderData(data);
- RDEdata[t.tlp.id] = data;
- if (controlgroup) {
- detachRDE(t.$rde);
- return false;
- }
- $jQs = buildjQuerys(data, t);
- $jQsData[t.tlp.id] = $jQs;
- display(t, $jQs);
- };
- var display = function (t, $jQs) {
- nextCall();
- var boxAttr = false;
- if (!t.$rde.hasClass('rde_box_all')) {
- boxAttr = $.grep(t.$rde.attr('class').split(' '), function (a) {
- return!!a.match(/^rde_box\d+/i);
- });
- }
- var $leaves = t.$rde.find('.rde_leave');
- t.$rde.empty();
- if (!!boxAttr) {
- $.each(boxAttr, function (i, v) {
- var theBox = v.replace(/^.*(box\d+).*$/i, '$1');
- if (typeof($jQs[theBox]) === 'object') {
- t.$rde.append($($jQs[theBox].find('.rdeslot')).clone());
- }
- });
- }
- else {
- $.each($jQs, function (i, v) {
- t.$rde.append($(v.find('.rdeslot')).clone());
- });
- }
- if (!t.$rde.find('.rdeslot').length) {
- t.$rde.remove();
- return false;
- }
- t.$rde.show();
- $leaves.insertBefore(t.$rde).show();
- if (t.$rde.hasClass('rde_slider')) {
- initSwiper(t.$rde);
- }
- registerEvents(t.$rde);
- };
- var detachRDE = function ($rde) {
- $rde.find('rde_leave').remove();
- $rdeChilds = $rde.children();
- if (!$rdeChilds.length) {
- $rde.remove();
- }
- else {
- $($rdeChilds[0]).unwrap();
- }
- }
- var buildjQuerys = function (data, t) {
- var jQs = {};
- $.each(data, function (key, value) {
- if (!!!key.match(/^global/i)) {
- jQs[key] = parse(key, value, getHTML_Tpl().tpl1, t);
- }
- });
- return jQs;
- };
- var parse = function (boxName, obj, HTML_Template, t) {
- var $box = HTML_Template.boxTpl.clone();
- var $slot;
- $box.addClass(boxName).addClass('box_' + boxName);
- $.each(obj, function (index, value) {
- $slot = HTML_Template.slotTpl.clone();
- $slot.addClass(value.mode).addClass('box_' + boxName);
- $.each(value, function (key, value1) {
- $slot.find('span.' + key).append('<span>' + value1 + '</span>');
- $slot.find('img.' + key).attr('src', value1);
- $slot.find('a.' + key).attr('href', value1);
- $slot.find('em.' + key).addClass('UID_' + value1);
- $slot.find('em.' + key).addClass('box_' + boxName);
- $slot.find('em.' + key).addClass('tpl_' + t.tlp.id);
- });
- $box.append($slot);
- });
- return $box;
- };
- var reorderData = function (data) {
- var boxes = {};
- $.each(data, function (index, value) {
- $.each(value, function (key, value1) {
- boxes[key] = value1
- });
- });
- $.each(boxes, function (key, value) {
- if (!!key.match(/box/i)) {
- $.each(value, function (index, value1) {
- boxes[key][index].mode = 'regular';
- if (value1.netUnitPrice != value1.strikeOutPrice) {
- boxes[key][index].mode = 'strikeout';
- }
- $.each(value1, function (key2, value2) {
- if (!!key2.match(/price/i)) {
- boxes[key][index]['formate_' + key2] = Math.round((value2 * 100)).toString().replace(/(\d{2})$/i, ',$1 €*');
- }
- if (!!key2.match(/^URL$/i)) {
- boxes[key][index][key2] = value2.replace(/^http\:\/\/www\.brille24\.de/, '');
- }
- });
- });
- }
- });
- if (typeof(boxes.global) === 'object' && typeof(boxes.global.controlgroup) === 'string' && boxes.global.controlgroup === 'true') {
- controlgroup = true;
- }
- return boxes;
- };
- var registerEvents = function ($o) {
- $o.find('.rdeslot a').on('click', function () {
- $UID = $(this).find('.UID');
- var uid = $UID.attr('class').replace(/^.*UID_([^ ]+).*$/i, '$1');
- var box = $UID.attr('class').replace(/^.*box_([^ ]+).*$/i, '$1');
- var tpl = $UID.attr('class').replace(/^.*tpl_([^ ]+).*$/i, '$1');
- var url = $(this).attr('href');
- return ___b24.trackRDE.click(uid, box, tpl, url);
- });
- };
- var getHTML_Tpl = function () {
- var tpls = {};
- var $box = $('<div class="rdebox" />');
- 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" />');
- var $slot = $('<span class="rdeslot" />');
- $slot.append($innerSlot);
- tpls.tpl1 = {boxTpl: $box, slotTpl: $slot};
- return tpls;
- };
- var initSwiper = function ($o) {
- var many = $o.find('.rdeslot').length;
- $o.wrapInner('<div class="swiper-wrapper" />').wrapInner('<div class="swiper-container" />');
- $o.find('.rdeslot').addClass('swiper-slide');
- var mySwiper = $o.find('.swiper-container').swiper({mode: 'horizontal', loop: false, slidesPerView: 4, slidesPerGroup: 4, calculateHeight: true, useCSS3Transforms: false});
- if (many > 4) {
- $o.append('<div class="arrow-right gradient">');
- $o.prepend('<div class="arrow-left gradient">');
- $o.find('.arrow-left').on('click', function (e) {
- mySwiper.swipePrev();
- });
- $o.find('.arrow-right').on('click', function (e) {
- mySwiper.swipeNext();
- });
- }
- };
- $(init);
- return pub;
- })(window, jQuery, undefined);
- var ___b24 = ___b24 || {};
- ___b24.trackRDE = (function (window, $) {
- var pub = {};
- var tracking = B24_debug_status.getMode('tracking');
- var track = function () {
- if (!tracking) {
- return false;
- }
- try {
- var ok = false;
- var loc = B24_shoplocation.get();
- var params = {};
- if (loc == 'detail') {
- params.productid = B24_product_object.get().sku_extended_clean;
- call('event/productview/sid/' + ___b24.frontendSession.get(), params);
- ok = true;
- }
- if (loc == 'listing') {
- params.categoryid = B24_shoplocation.getCategoryID();
- call('event/categoryview/sid/' + ___b24.frontendSession.get(), params);
- ok = true;
- }
- else if (loc == 'cart') {
- var order = B24_cart_object.getCart();
- if (!!order.order_items.length) {
- var itemsA = [];
- var qtyA = [];
- var priceA = [];
- $.each(order.order_items, function (key, value) {
- itemsA.push(value.product_sku_extended_clean);
- qtyA.push(value.qty_ordered);
- priceA.push(value.price);
- });
- params = {itemids: itemsA.join(','), quantities: qtyA.join(',')};
- call('event/basket/sid/' + ___b24.frontendSession.get(), params);
- ok = true;
- }
- }
- else if (loc == 'success') {
- var order = B24_order_object.getOrder();
- if (!order) {
- return false;
- }
- var itemsA = [];
- var qtyA = [];
- var priceA = []
- $.each(order.order_items, function (key, value) {
- itemsA.push(value.product_sku_extended_clean);
- qtyA.push(parseInt(value.qty_ordered, 10));
- priceA.push(Math.round(parseFloat(value.price) * 100) / 100);
- });
- params = {itemids: itemsA.join(','), quantities: qtyA.join(','), utp: priceA.join(',')};
- call('event/order/sid/' + ___b24.frontendSession.get(), params);
- ok = true;
- }
- if (ok) {
- recognizeCustomer();
- ___l(params, 'RDE.track');
- return true;
- }
- }
- catch (err) {
- ___b24.tracking.error('trackRDE.track', err);
- }
- };
- pub.track = track;
- var click = function (itm, b, tpl, url) {
- try {
- if (!tracking) {
- return true;
- }
- var params = {};
- if (typeof(itm) != 'string') {
- throw'wrong itm';
- }
- else {
- params.itemid = itm;
- }
- if (typeof(tpl) == 'string') {
- params.template = tpl;
- }
- if (typeof(b) == 'string') {
- params.box = b;
- }
- call('event/click/sid/' + ___b24.frontendSession.get(), params, function () {
- location.href = url;
- });
- ___l(params, 'RDE.click');
- return false;
- }
- catch (err) {
- ___b24.tracking.error('trackRDE.click', err);
- return true;
- }
- };
- pub.click = click;
- var recognizeCustomer = function () {
- if (!tracking) {
- return true;
- }
- var cID = B24_customer_object.getCustomerId();
- if (cID == false) {
- return false;
- }
- call('event/usertosession/sid/' + ___b24.frontendSession.get() + '/userid/' + cID);
- ___l(cID, 'RDE.user.track');
- return true;
- };
- var call = function (u, p, fb) {
- var url = '/___rde/rde_server/res/B24P/';
- url += u;
- if (typeof(p) == 'object') {
- url = makeURL(url, p);
- }
- $.ajax({url: url, dataType: 'script', error: function (jqX, errText) {
- ___b24.tracking.error('trackRDE.call.ajax', errText);
- if (typeof(fb) == 'function') {
- setTimeout(fb, 1000);
- }
- }, success: function () {
- if (typeof(fb) == 'function') {
- fb();
- }
- }});
- };
- var makeURL = function (url, params) {
- if (typeof(params) == 'object') {
- params = $.param(params);
- }
- else {
- return url;
- }
- if (!!url.match(/\?/i)) {
- url += '&';
- }
- else {
- url += '?';
- }
- url += params;
- return url;
- };
- return pub;
- })(window, jQuery, undefined);
- var ___b24 = ___b24 || {};
- ___b24.frontendSession = (function (window, $) {
- var pub = {};
- var session = false;
- var storage = '___b24s';
- var expTTL = 365;
- var init = function () {
- if (!!$.cookie(storage)) {
- session = $.cookie(storage);
- }
- else {
- session = setHash();
- }
- $.cookie(storage, session, {'path': '/', 'expires': expTTL});
- };
- var get = function () {
- return session;
- };
- pub.get = get;
- var fourDigits = function () {
- return(((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1).toUpperCase();
- };
- var setHash = function () {
- var rand = fourDigits() + fourDigits() + fourDigits() + fourDigits() + fourDigits() + fourDigits() + fourDigits() + fourDigits()
- + new Date().getTime();
- return $.md5(rand);
- };
- init();
- return pub;
- })(window, jQuery, undefined);
- ;
- function decryptCharcode(n, start, end, offset) {
- n = n + offset;
- if (offset > 0 && n > end) {
- n = start + (n - end - 1);
- }
- else if (offset < 0 && n < start) {
- n = end - (start - n - 1);
- }
- return String.fromCharCode(n);
- }
- function decryptString(enc, offset) {
- var dec = "";
- var len = enc.length;
- for (var i = 0; i < len; i++) {
- var n = enc.charCodeAt(i);
- if (n >= 0x2B && n <= 0x3A) {
- dec += decryptCharcode(n, 0x2B, 0x3A, offset);
- }
- else if (n >= 0x40 && n <= 0x5A) {
- dec += decryptCharcode(n, 0x40, 0x5A, offset);
- }
- else if (n >= 0x61 && n <= 0x7A) {
- dec += decryptCharcode(n, 0x61, 0x7A, offset);
- }
- else {
- dec += enc.charAt(i);
- }
- }
- return dec;
- }
- function linkTo_UnCryptMailto(s) {
- location.href = decryptString(s, -2);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement