var pmaWidgetInstance5fca05fdd9685ed27273c729 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=54f3e398a950ed8844a79f91cd7aeac5:29807f77f38e66bc53bfac4f3202cc1f2836bfb80405fd59e70dadffb42a3a163734ef4d6a66a54a6648db98f89f3d24a68359c07bb8696a7966c848dac1f6e4c4ed77fa9639cecaa0448d6a46bd48ffa07713d582690d12a4b0d2e57de4cb5479ae852070cc68bbcaae2c2355e07e0bae6a4b5d2dc1b4bae2b20e3b162d5c13246c5a7896bfe169d3ddc5e64973fbd41377f9ecb0c301dea68b0154f7aae6eb35df4c264a951ec036e1ed9f08eaf8643bcb08107f2529127333bf19002cd35f57510b58821fffa9da5f30605ba8a2aa", shop_name: "sxt.sk", shop_logo: "https://y1.sk/t/s/130x50/58114.jpg", product_price: "440,00 €", product_shipping: "", 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(){ pmaWidgetInstance5fca05fdd9685ed27273c729.initWidget("5fca05fdd9685ed27273c729"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }