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