var pmaWidgetInstance608807303975337b9e2552cd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5999605342dd0019b8f764e3269b8005:e7fdb6453802988e825a5055dfc1a3a6a781d56821585ea3694962ab34a683b0c49af37cf11e616af5da3a95a4a561f828fff0ea539d8414acb31f49ed80acbc4e94689978731956949d72f6d128f6ec96146278629b7b3dbf6a636705daa989ffcfeda55475aef6232da7587210c53d4097e6821cc5f60caa7e1a102f7d376e8044e6afe8d249835619af3efd9dde65d2603e389dcba52400bfce0b9510e0a46840584aff5848a80ba4245998396be8261e5a1cc0294781335a7ac2f717cd49", shop_name: "pomocnik.sk", shop_logo: "https://y1.sk/t/s/130x50/42713.jpg", product_price: "1499 €", product_shipping: "4,90 €", 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(){ pmaWidgetInstance608807303975337b9e2552cd.initWidget("608807303975337b9e2552cd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }