var pmaWidgetInstance60cc441a0067a2ef5991569e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a21dde7c3bdb2110ae67568768fb7ebc:22ecbd6cfa3696e25cd1df4400b48638a8ef1513c7678220fe4cd5dd26649c4302b129a14a148d31f062dfea246651ea494f521607f1f80a0d79cdfc6f21f61539c29527e03d133482bb37c06b009fcc98a07eaf25c26b7a07855b8c62345c18f60546fa52e5c621a818e882df3ca6dc80d61c7834e7d1d3f852c92b821071aa32b7ed100d39495b4dae04624bfb088d66b6a66f76b08b1770b1bfd9fcbf80de1aa6557ffa162bcaa4cab69fd7dc5116b2791677c1ead60536c49ad526bd81680f76c05b34cd929c909d9769014fcfcc", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "75,58 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance60cc441a0067a2ef5991569e.initWidget("60cc441a0067a2ef5991569e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }