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