var pmaWidgetInstance63982ed8ac365ae374570e2d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0bb3a76e87dea09a8d6878921cdbf5cd:c72b57e8632c5ca9918c28b1420e69fc82734dcb5a6ceecae26c2be9d3e59071caa50142738aa58981c2c2f3f235713bc7163fbf7853b2060f0139aa37d97bf0fa532a2e9a28bac0da4a680d9e91d83221362925c74f5b9ab203d2c60d544d5808c759eb93c644c49b056375b4edd5d4d836fcb03163463c6afeea33725a5102054e8b51e2f165716e088d547c3a8bd1a9f0e49a89cca53f0ab1090d1fe68e214dddc492ad2c0841129e29cc2337bee19408e8719b6489fdc80f9ea7b4669f2ea11e1fcd0f79219949be1db19eedab35", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "399,00 €", product_shipping: "8,99 €", product_availability: "", 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(){ pmaWidgetInstance63982ed8ac365ae374570e2d.initWidget("63982ed8ac365ae374570e2d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }