var pmaWidgetInstance601290dfd9685ed272e1a4b5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bd29bca7f3c25f3154994e7e07ac9635:8aefe06252807a0342ccbcf03b2dd5e33d93df164e0a87d00e87e3db4ec38b7cd74e27733e43051f99bc19f7b0e134331e6dda4de2cc9996c488b6fb80202815c375d9dc0bb857c476de6c371fb1f1f9d51488776be78f4924ee9771b17660862c1d12c48d7b0b99d9c2043558967442c0d5e9b1611631f9507b517b133c23f6f0c848be57bff01910b19758f575646870465ab730cc8fb9dec7171d18cdd8a27e8c32038b507b4b1e20c42b8722a7d3781e8d559aab33f7bddd3328fdd42e1d", shop_name: "najlekaren.eu", shop_logo: "https://y1.sk/t/s/130x50/4200.jpg", product_price: "16,70 €", 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(){ pmaWidgetInstance601290dfd9685ed272e1a4b5.initWidget("601290dfd9685ed272e1a4b5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }