!function (e, t, n) { var r = "/plugins/css/spi-button.css", i = "/plugins/share.js", o = { de: { label: "Teilen", title: "Teilen auf XING: Vor dem Teilen sehen Sie eine Vorschau." }, en: { label: "Share", title: "Share on XING: You'll be able to see a preview before sharing." } }, a = { h: 530, w: 570 }, s = {}; function l(e, t) { (e = e || {}).resource = {}, this.validateConfigEntry(e, "plugin", ["login", "share", "follow"], "login").validateConfigEntry(e, "language", ["en", "de"], "en").validateConfigEntry(e, "visibleOnRender", [!0, !1], !0), this.config = e, this.node = t, this.content = null } function c(e) { var t, n = this; switch (e = e || "share", t = s.capitalize(e), e) { case "follow": n.product = FollowPlugin; break; default: n.product = u }return n.plugins = [], n.PLUGIN_SELECTOR = ['div[data-type="xing/' + e + '"]', 'div[data-type="XING/' + t + '"]', 'script[type="xing/' + e + '"]', 'script[type="XING/' + t + '"]', 'script[data-type="xing/' + e + '"]', 'script[data-type="XING/' + t + '"]'].join(","), n } (s = s || {}).capitalize = function (e) { return e.charAt(0).toUpperCase() + e.slice(1) }, (s = s || {}).encodeQuery = function (e) { var t, n = []; for (t in e) e.hasOwnProperty(t) && null != t && n.push(encodeURIComponent(t) + "=" + encodeURIComponent(e[t])); return n.join("&") }, (s = s || {}).environment = function (e, n) { var r = "prod", i = "sandbox", o = "preview", a = e.split("/").pop(); function s(e) { if (null === e.match(a + "$")) return null; var t = e.match(/xing(-share)?\.com(:\d*)?\//i); if (t) { var n = t[0]; return (e.split(n)[0] + n).replace(/\/+$/, "") } return null } function l() { for (var e, r = t.getElementsByTagName("script"), i = 0; i < r.length; i++)if (e = s(r[i].src)) { n = e; break } return n } function c(e) { return null !== (e || n).match(/preview\.xing(-share)?\.com$/) } function u(e) { return null !== (e || n).match(/env\.xing\.com$/) } function h(e) { var t = e || n, a = r; return c(t) ? a = o : u(t) && (a = i), a } return l(), { PRODUCTION: r, SANDBOX: i, PREVIEW: o, config: function (e) { var t, o = "xingcomdev"; switch (e || h()) { case r: t = "https://www.xing.com", o = "xingcomprod"; break; case i: t = n; break; default: t = n.replace(".xing-share.", ".xing.") }return { STATICS_HOST: n, BACKEND_HOST: t, TRACKING_ACCOUNT: o } }, host: l, hostFrom: s, isPreviewEnvironment: c, isSandboxEnvironment: u, name: h } }, (s = s || {}).events = s.events || {}, s.events.attach = function (e, t, n) { var r; return e.addEventListener ? r = e.addEventListener(t, n, !1) : e.attachEvent && (r = e.attachEvent("on" + t, n)), r }, s.events.detach = function (e, t, n) { e.removeEventListener ? e.removeEventListener(t, n, !1) : e.detachEvent && e.detachEvent("on" + t, n) }, (s = s || {}).extend = function (e, t) { var n; for (n in t) e[n] = t[n]; return e }, (s = s || {}).factoryInitializer = function (e) { "loading" === t.readyState ? s.events.attach(t, "readystatechange", function n() { "interactive" === t.readyState && (s.events.detach(t, "readystatechange", n), e.init()) }) : e.init() }, (s = s || {}).getDocumentFrom = function (e) { var t = e.contentWindow || e.contentDocument; return t && t.document && (t = t.document), t }, (s = s || {}).getHost = function (e) { var n, r; return (n = (e = e || ((r = t.createElement("a")).href = " ", r.href)).split("/"))[0] + "//" + n[2] + "/" }, (s = s || {}).indexOf = function (e, t, n) { if (n = n || 0, Array.prototype.indexOf) return e.indexOf(t, n); for (var r = n, i = e.length; r < i; r++)if (e[r] === t) return r; return -1 }, (s = s || {}).noop = function () { }, (s = s || {}).openPopup = function (t, n, r) { var i = r.h || 530, o = r.w || 570, a = Math.floor((e.screen.width - o) / 2), s = Math.floor((e.screen.height - i) / 2); return e.open(t, n, "toolbar=0, menubar=0, status=0, directories=0, location=0, resizable=1, scrollbars=1, width=" + o + ", height=" + i + ", top=" + s + ", left=" + a) }, (s = s || {}).parseJson = function (t) { try { return "string" == typeof t && t ? (t = this.trim(t), /^[\],:{}\s]*$/.test(t.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ? e.JSON && e.JSON.parse ? e.JSON.parse(t) : new Function("return " + t)() : { err: "Invalid JSON config" }) : null } catch (t) { return { err: t } } }, (s = s || {}).setAttributes = function (e, t) { for (var n in t) e.setAttribute(n, t[n]) }, (s = s || {}).setStyles = function (e, t) { for (var n in t) e.style[n] = t[n] }, (s = s || {}).subclass = function (e, t, n) { function r() { } return r.prototype = e.prototype, t.prototype = new r, t.prototype.constructor = t, n && this.extend(t.prototype, n), t }, (s = s || {}).trim = function (e) { return String.prototype.trim ? e.trim() : e.replace(/^\s\s*/, "") }, (s = s || {}).writeContentToFrame = function (e, t, n) { var r = s.getDocumentFrom(e), i = { height: 18, width: 1 }; r && (s.setStyles(e, { height: [i.height, "px"].join(""), visibility: "hidden", width: [i.width, "px"].join("") }), n && s.events.attach(e, "load", function () { setTimeout(function () { s.setIframeDimensions(e) }, 50) }), r.open(), r.write(t), r.close()) }, s.setIframeDimensions = function (e) { var t = s.getDocumentFrom(e), n = {}; if (t && t.body) { var r = t.scrollingElement ? t.scrollingElement : t.body; 18 < r.scrollWidth ? (n = { height: Math.floor(r.scrollHeight), width: Math.floor(r.scrollWidth) + 1 }, e.height = n.height, e.width = n.width, s.setStyles(e, { height: [n.height, "px"].join(""), visibility: "visible", width: [n.width, "px"].join("") })) : setTimeout(function () { s.setIframeDimensions(e) }, 100) } }, (s = s || {}).xdomainEvents = [], s.xdomain = function (e, n, r, i) { var o, a = "m" + (new Date).getTime(), l = { attributes: { height: 0, id: a, name: a, width: 0 }, styles: { display: "none", height: 0, width: 0 } }, c = e.document.createElement("iframe"), u = null; o = [n, r, "?", "callback_domain", "=", encodeURIComponent(s.getHost()), "&", "id", "=", a].join(""), i.path && (u = { path: i.path, id: a }, i.data && (u.data = i.data), i.method && (u.method = i.method), i.dataType && (u.dataType = i.dataType)), null === t.getElementById(a) && (s.xdomainEvents[a] = function (t) { !function (t) { var r; t.origin === n && (r = function (e) { var t = "", n = {}; if (e) { t = e; try { n = JSON.parse(e) } catch (e) { n = {} } } return { string: t, json: n } }(t.data)).json.id === a && function (t) { switch (t.json.success) { case "READY": u && (c.contentWindow.postMessage(JSON.stringify(u), n), u = null); break; default: i.callback(t.string), function () { var t; s.events.detach(e, "message", s.xdomainEvents[a]), delete s.xdomainEvents[a], (t = e.document.getElementById(a)).parentNode.removeChild(t) }() } }(r) }(t) }, l.attributes.src = o, s.setAttributes(c, l.attributes), s.setStyles(c, l.styles), e.document.getElementsByTagName("body")[0].appendChild(c), s.events.attach(e, "message", s.xdomainEvents[a])) }, l.prototype = { rendered: !1, extendConfigTo: function (e) { return s.extend(e, this), this }, render: function () { var e, n, r = this, i = r.node, o = ''; !r.rendered && i.parentNode && (e = t.createElement("iframe"), s.setAttributes(e, { allowTransparency: !0, frameBorder: "none", seamless: "seamless", scrolling: "no", src: "javascript:''" }), s.setStyles(e, { background: "transparent", border: "none", padding: "0" }), i.parentNode.insertBefore(e, i), i.parentNode.removeChild(i), n = '' + o + '
' + r.config.resource.html + "
", s.writeContentToFrame(e, n, r.config.visibleOnRender), r.frame = e, r.frameDocument = s.getDocumentFrom(r.frame), r.rendered = !0, r.attachEvents()) }, validateConfigEntry: function (e, t, n, r, i) { return (e[t] && n && -1 === s.indexOf(n, e[t]) || !e[t]) && (e[t] = r), this }, attachEvents: function () { return this } }, c.prototype.init = function () { var e; e = this.collectElements(), this.createPlugins(e), this.renderPlugins() }, c.prototype.collectElements = function () { return t.querySelectorAll(this.PLUGIN_SELECTOR) }, c.prototype.createPlugins = function (e) { for (var t = 0, n = e.length; t < n; t++)this.plugins.push(new this.product(e[t])) }, c.prototype.renderPlugins = function () { for (var e = 0, t = this.plugins.length; e < t; e++)this.renderPluginWithDelay(this.plugins[e], e) }, c.prototype.renderPluginWithDelay = function (e, t) { setTimeout(function () { e.render() }, 50 * (t + 1)) }; var u = s.subclass(l, function (e) { var t = { plugin: "share" }; return l.call(this, t, e), this.config = this.setConfig(t, e), this }, { resources: { css: r, js: i, html: '
<%label%>
' }, getSharePageUrl: function () { var e = this, t = [e.config.shape, (e.config.counter || "no") + "_counter"].join("-"); return [d.BACKEND_HOST + "/social/share/spi", "?url=", encodeURIComponent(e.config.url), "&button_style=", t, e.config.followUrl ? "&follow_url=" + encodeURIComponent(e.config.followUrl) : ""].join("") }, setConfig: function (e, t) { var n, r = this; return e.url = r.getShareUrl(), e.language = t.getAttribute("data-lang") || e.language, r.validateConfigEntry(e, "language", ["en", "de"], "en"), e.shape = t.getAttribute("data-shape") || t.getAttribute("data-button-shape") || e.shape, "small_square" === e.shape && (e.shape = "square"), r.validateConfigEntry(e, "shape", ["rectangle", "square"], "rectangle"), e.followUrl = t.getAttribute("data-follow-url") || null, n = o[e.language].label, e.resource.css = d.STATICS_HOST + r.resources.css, e.resource.html = r.resources.html.replace(/<%shape%>/g, e.shape).replace(/<%label%>/g, n).replace(/<%title%>/g, o[e.language].title), e }, attachEvents: function () { var e = this; function t() { var t = e.getSharePageUrl(); e.popup = s.openPopup(t, "xing_share_popup", a) } return function n() { e.frameDocument && e.frameDocument.getElementById("xing-share") ? (s.events.attach(e.frameDocument.getElementById("xing-share"), "click", t), e.config.counter && e.getStatisticsFor(e.config.url)) : setTimeout(n, 100) }(), e }, getShareUrl: function () { var t = this.node.getAttribute("data-url"); return t || e.location.href } }), h = new c("share"), d = s.environment(i, "https://www.xing-share.com").config(); s.factoryInitializer(h) }(window, document);