var pmaWidgetInstance6037ac8ed9685ed2725d775e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d3a9fb1f1141a88134c3eeff77ca03bb:ab69b88dc83b697b4fe42378d5914e4261791de9c57d8b1991c181aceea2d162c5c15c27a42fb04abe9dba9d6dc074c0b965074f3e6dd7cbd739a9f69f99ab42cc512bfbd1b517d596205d12b4cd6c5fa3b78b2ae01be9a17fc14f1982de1a5f78a6a09cb7b253e5c97a42a78d59d51b10dfd9b79f4a5d1468ae49d729d9b536384037cc620625fb34e7142b855a94860fc3e4af352ee7150f34410149ee65e6aa0416ecfb49973caa70d250b56932934cb265c77b635ca8d9487cef749f85a0d6d9ba31edc394a1886bea3a99978c2b", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "189,90 €", 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(){ pmaWidgetInstance6037ac8ed9685ed2725d775e.initWidget("6037ac8ed9685ed2725d775e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }