var pmaWidgetInstance601275a5d9685ed2729c96d7 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a56cf6a3ee4bc1325ec54a997216f8fd:3ec54c201838cbc2fe865523ec319bd4b45932aa4684340041c488dac03ab867047d818031322f67f42badbfccd1aa9631d5142f7dc92c22b7626ef927923fe8a7e73c7885557ce33691c7b100434b3f7b590dd37a37d8cd689bf6babbc91fcb92aba3ba6d586e2f32139d000f02d74eea8e9c93a7c5466272677930ab90f54a8e8666b047dae06e5bfe701aa7daca66905412e12c5fb56d9948ba2d291ada486b6d381fe2e1f91a5cd888111e325bc3e9894ee79a054f4b0a67826c7552f3f5", shop_name: "lekarenvkocke.sk", shop_logo: "https://y1.sk/t/s/130x50/57146.jpg", product_price: "3,79 €", product_shipping: "2,19 €", 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(){ pmaWidgetInstance601275a5d9685ed2729c96d7.initWidget("601275a5d9685ed2729c96d7"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }