var pmaWidgetInstance60d1958a0067a2ef59065ecf = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=de996c961a039d401ab879f42ef54895:8829a8d6dea0caf6977d0a1f54f9de6b8c871418c91a9f93d6b35f6ff1656b08c6de794645fdd54a182f75c6cf0dc58b48351550608fb69b8ded6abda0582c5cdd7d1adfb9cef0dda5a9247fb0f7e24f81c82085b356869c988fd85b52d0feca328c37f19b3e96a9c57a3aeb3bac84bc4d04e1506a235f79d7ac5222f9a389558de2af22b70f4d49ef48987944e81bde9df50ad9c017022c1d6ab244f4737a90eafa166a1a60cdd95ad8bc50df3344cdc457ccb1ff6b11da949c06cc04c34b87", shop_name: "MobilPC.sk", shop_logo: "https://y1.sk/t/s/130x50/46049.jpg", product_price: "818,20 €", product_shipping: "3,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(){ pmaWidgetInstance60d1958a0067a2ef59065ecf.initWidget("60d1958a0067a2ef59065ecf"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }