var pmaWidgetInstance601272cbd9685ed272971944 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d5b58910b3fc6be1173db1e6b53bd0fe:8eabd867133012d46bc941704f5eb2cb8482992592dbb0b0214227433848f7baf28812ae294a2159d0d7e4e67635e283968e3cd79f128dec529af0c309001c1e350fd4cf0aec4c99426629bcc4d6997819ea7d3a6d2998917fe9e7e05caa5db42eac211bf2f18793725e20b1127bcafc9b160d8b11f860c4f0272f8351dc01475fea0fd0bfd40a0b52ab97b3eb54490f3a16713113f98603b34f517fdd5bc252f865ed9a14c7e00bbea89d5cd0c3838b5b297e48e9e59fa8c1ec0e093c0ef21a", shop_name: "najlekaren.eu", shop_logo: "https://y1.sk/t/s/130x50/4200.jpg", product_price: "22,26 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance601272cbd9685ed272971944.initWidget("601272cbd9685ed272971944"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }