var pmaWidgetInstance6131d82f0067a2ef59fd0448 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=07e0d9b7ae8f6b8efbbaf5ab279f43f0:91760256d7d370bcb5dc30ba61d81cd97c0f3486d591b978c6c011d9dd1617fe2afe1c48c827485a1a03dc627c90ae858acbe039853528abc96fc8152bec3b3c230bfea8ec3c8756e4d2281623bbd6bf29eeed0d652efe1eeba2b055443cd78234584f5fce5fb90167b611e2f156d416a4d7f1585f6b751ad644d6fa0e213b14424dda8dfc7ea99a5e175b072d9f44d13460fd560c698661fe7567d91a6fddc5d1e1f56fc886bc5c16e1e9d31ce2285e36ec011f2c7dd2103769578ad6077194", shop_name: "najlekaren.eu", shop_logo: "https://y1.sk/t/s/130x50/4200.jpg", product_price: "6,07 €", 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(){ pmaWidgetInstance6131d82f0067a2ef59fd0448.initWidget("6131d82f0067a2ef59fd0448"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }