var pmaWidgetInstance639da0f3ac365ae37426b8ae = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=39a6d353d0c56d5fcb582f1223c2f8ae:2a159d4ed229138efe77927b62a5de1088a6c55690ba091a66dc574b65ff214d266eb12dad5c64feec75c8add6ad281b205367b4caebdacbd682f26ca76f7896fb04095aa7685627161d23858d359d899daf2e616755e33783cb3abb4c655fb85b74fcb9e3627da9ce5962ab9987b2a46fe4f24976e351b2738da6d8ee2f386d776bc588e1f1496b062c980d6426ebdf6c232b92f3437106f16b1c2b349b6a47762bb078e0de1f0f4e296797622071fc4d64b178928721d9701210e41072c893c3985bbf6338381744c4037c4501c9cb", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "659,00 €", product_shipping: "8,99 €", 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(){ pmaWidgetInstance639da0f3ac365ae37426b8ae.initWidget("639da0f3ac365ae37426b8ae"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }