var pmaWidgetInstance608a70b43975337b9e6f9d5c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=26e41d149148024007196475dc620555:d081e81dab66ac3225a15ad33f6c66fe5d4c331672892c86eaecd2fbee6606483c0a4704b27ff74fc932c39b1758a8c9d415bd3e2b15dc578f4e506c4dc068a4c1c04bff2dad4bfa560ec992bf420e7974254078f6ac9f66eb749da5787a0bf7f94c4854d197c357a976e4d6af5890d5e6c62b9bbceb293030128d6a18318c5d3005ec965c2b9e9937e19893d4b0338767b9d6be9fd2ac69c372535f84bb7047e0359dfdd1b9f5046eae9ddaaac068f23cf36983765237d43b46f8fe5606f9d827adf127ac68e3514fa890850dc62dea", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "375,84 €", 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(){ pmaWidgetInstance608a70b43975337b9e6f9d5c.initWidget("608a70b43975337b9e6f9d5c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }