var pmaWidgetInstance5fbfadf2d9685ed272c61225 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f290d27723aed63d8801bc03435eedbe:67af787514f4742c03680c315c1bb18be63968f1339c80ea0b82e28c1c41bad00f2564843e2d933ecfbc4c5b1744cfdc593c5bf8fcc0d0b1a271993a4242effdda5b964959bf08b0338b7f7fdc999d78d82f460a6f7fa0b6f4054a38ddd75f3ae9e512f943d7ec06992bd3e5b02f1ba2e93f1f24aa0e1f493155063f0acbde6a3d4ccf6e3badbb64dab2a022eeb9ac5a040fbe753b959c5c2417c177ff9a743d1e6c69cbd4284cbb52754a181135f7dae68bb52bcc10450d25fe23a998285009", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "53,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(){ pmaWidgetInstance5fbfadf2d9685ed272c61225.initWidget("5fbfadf2d9685ed272c61225"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }