var pmaWidgetInstance64c0f3184218328905d34949 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=14699d07b98d8b4c5aec85f8c9e1690c:2676acbcc4cd9cbc92f5196e1a8b2bdf16f65ace72a4c7e9e6b08e22baf0ce95c3d22b14d24d2d8b0dc3522639d488f087a55ba32506794ab7fab2995eeddcf02a7a266057f842d75108aa96d8a98a7c5c2cfc29fa16c62849c1dbc2cc538b9518161ae7400fdc5353a47366e311fd1aa5576a5bef706c04dc4d69491363233183e21aa8e42d2f919eb77bed708bd591de1b86d6094963056718fbe0d51126c2a07a821cf0140fceddf24bcd3830f533cb720d19ccff27a71d74de4a7c416116", shop_name: "Šimek.eu", shop_logo: "https://y1.sk/t/s/130x50/58202.jpg", product_price: "463,78 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance64c0f3184218328905d34949.initWidget("64c0f3184218328905d34949"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }