var pmaWidgetInstance6129e6c40067a2ef5933a10b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ccee49796d84124eac0f4564bb1b3867:65759b7c5bb02f510be4402e3724256860fb4f252ca6b6242e1a0ae07fbad9daae393b541648cf5ea32da368f41124b2b66fa09ad1d3fff7a252acc94cd2b34f4c46c808dda811d1077022bc439e993116dbacb0f538e81aae9fc325db165da56908dea1edac0ff1a2e8e0cba21b490b00f46dbacb7d2e9ee0d464c3eb3ed187cab8acdc3ccb988391018c8443508ca6fa9cf10fd74bd5bbd10c4a173652ece96ffa28a82d3f6a1a2909accff6a9099bcfa953ebf2f2f1d6338225b0863f974eba5f36418c994fcf8a986cf9cc5ca83f", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "1099 €", product_shipping: "", product_availability: "Skladom", initWidget: function(widgetId){ this.insertLinkToButton(widgetId); }, insertLinkToButton: function(widgetId){ const instance = this; const btns = this.findButtonWidgets(widgetId); for(var btn of btns){ instance.insertButtonVariables(btn); if(btn.tagName == "A"){ btn.href = this.exitLink; btn.target = "_blank"; btn.rel = "nofollow"; } else { btn.onclick = function(event){ event.stopPropagation(); window.open(instance.exitLink); } } } }, findButtonWidgets: function(widgetId){ var currentModalButtons = []; var modalButtons = document.getElementsByClassName(`pma-widget`); for(var modalButton of modalButtons){ if(modalButton.getAttribute('data-id') == widgetId){ currentModalButtons.push(modalButton); } } return currentModalButtons; }, insertButtonVariables: function(element){ element.innerHTML = element.innerHTML.replaceAll("{{shop_name}}",this.shop_name?this.shop_name:""); element.innerHTML = element.innerHTML.replaceAll("{{shop_logo}}",this.shop_logo?this.shop_logo:""); element.innerHTML = element.innerHTML.replaceAll("{{product_price}}",this.product_price?this.product_price:""); element.innerHTML = element.innerHTML.replaceAll("{{product_shipping}}",this.product_shipping?this.product_shipping:""); element.innerHTML = element.innerHTML.replaceAll("{{product_availability}}",this.product_availability?this.product_availability:""); } } docReady(function(){ pmaWidgetInstance6129e6c40067a2ef5933a10b.initWidget("6129e6c40067a2ef5933a10b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }