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