var pmaWidgetInstance64d4d8df421832890560437f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9f1df7bde74b1ff67c3b43acca43bb34:e5f6623c332f2863aeafebecb9df1121a0b5a6e631c0eaf43d46467cab97f5ad4fbc36365d83ff32df8da34788fbb371c6c673a566b926380e9ed83fc34997bdbb5d0cd57dd2197684162425209248d8c06ed7af4cb2b20a14241238dd55df4d860b02a7d2b4fd5f595f039caa10e35c037af9a4e615838fabd267b02f0346c328b51b033e00c821f10c0b2c2edfcab6e31d6a68dc985d54ac8c48bc43693754c05d7049bda122da0f894c76e1853a1e99fbf2e4d9265f17a9d598fcef0c6ddc8385aca1024906afedccd4d6d16dd38d", shop_name: "pomocnik.sk", shop_logo: "https://y1.sk/t/s/130x50/42713.jpg", product_price: "64,00 €", product_shipping: "4,90 €", 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(){ pmaWidgetInstance64d4d8df421832890560437f.initWidget("64d4d8df421832890560437f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }