var pmaWidgetInstance64c0f3184218328905d34949 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=646493bd41e34bfac0640ca78d5045d1:bbeffb2e8179bbba66ca3c743cd9926b7b13e060dec3d1f3dd82b24b8fe80396f9cf470dcc3a14875b3ec7df54bec720700706b4e3085e8da9939c936c249e65ea9808be7de60b7c9fb6ad83f7a93d5a6a0e7bba4981a6ef8538b33fa20578448ef9481741a5325e3282d3c64924f2da33126f17f220c6db315111c63e73be266cac7e8133f1a12621b0c6e9666eb5336544b1f927b8040b74b1f2992bcbc143fa989df07d6b116682278782638e62796275ca49099e1a2213ff0714a48fd1a6", shop_name: "Šimek.eu", shop_logo: "https://y1.sk/t/s/130x50/58202.jpg", product_price: "453,03 €", 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(){ pmaWidgetInstance64c0f3184218328905d34949.initWidget("64c0f3184218328905d34949"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }