var pmaWidgetInstance6033c4d3d9685ed2720cea92 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=85a48c23c944ccd9b9293ebda3ef439d:58da98d53e6e20bd09b93bab5bb22945b4619139bb3f011e38dc534cdfa67ad418ddd0c2549d5ecf83ae01d08b81ddd64623a4c3f98e0f618e0979c69d3efc8119d1df47ed0432fdbd19bb02648e40b7c4a8f5e6977d7477bc8dff3b38be899cd2fc4679504ec23350893963ef4d7e61c1c273b6edfcdf75af9bb2dca2974af422c2b203e0420e3bdb82aa08025eff506f8afcef8bf347d3fff858cf151939d8213b13c0697f09ab554589516b1695ee06d1ea7a4199a99f9d71d8ecf1e819fc", shop_name: "solik.sk", shop_logo: "https://y1.sk/t/s/130x50/59915.jpg", product_price: "177,99 €", product_shipping: "", 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(){ pmaWidgetInstance6033c4d3d9685ed2720cea92.initWidget("6033c4d3d9685ed2720cea92"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }