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