var pmaWidgetInstance608a6a013975337b9e4ccec9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f481dd7b714c7a865291940e6cd9101d:f840a5387e50fbbc0aa76db29bd14fcfe24458d210f0ae233b1d80b617f3717702ea7f9c11e4183f01e2c0e1b2236f0f760372027b3fc43ba0f34e6292e3791bc654795d83bfc5ad418e8f04560c330518ed381a7c607315368522ceede80c7ce258f2255f7a03c54b9627093cd60509e7c77be2e9249b086113d95a98ce781f1fb710cb9ad7d4c802a62c54ffce8742cb127817b999f95c3c4fcfe18742b2f519fe15b17332a1e3259259a308ad91f88146cc49a8dca21b096306f73feca153c99391dcb8b3f814510ae6a3073290b5", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "202,95 €", product_shipping: "2,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(){ pmaWidgetInstance608a6a013975337b9e4ccec9.initWidget("608a6a013975337b9e4ccec9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }