var pmaWidgetInstance61291f220067a2ef59641783 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=44590ba370f42f5736f0414d39f8f13a:467b12fcc133d01bd4b30cca9c296f18bbafc1c2170442a8b8c3a3b2b33a272e01cfdf9d0559b53b3efbc72a3d18930c3f999859b76dbcfb87b616db60d766f272d3f6e74059519045c36ea9c477b27a61fb8a767febb982b11f1fda0f4422d6d5f98b428d0ad41c680aff23b15cf2b30d0c8b2522f1e9733fbfd9007e3ad30e5362635d88cc227e4c0dfe8bcfd8c27f4de2a4b9d98cd438120ad8dc5e713ecd1d2291a5cd35afd709f89ff93904dd60e489e42d7a0691248e9d5584ad7e4e3879408323cb80c1dd41660c3c158e68ae", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "512,39 €", 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(){ pmaWidgetInstance61291f220067a2ef59641783.initWidget("61291f220067a2ef59641783"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }