var pmaWidgetInstance607e875ad9685ed2727d8ba1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ddb7c38d4dfa408c2e193a5cfd2a1ba8:8da58fe4ec9785c1e87d54997c04137ae8551898f34834dd5de2b54a4b898ac2699f407b6a056c152f4ac9f16e0c0f425c47ba3012c64d48a5361475fc2f2a736e81e4f918bf4adca429b374d6d0760b17886fb0207448e70fbfec75a04c52a992eaf099245b81faac6d31d04c362c45eb01bb377efe4e15f1599224ff07d8bb36c5ad1427983830f410da3675c80eaf962b6eb34deb9fd0d304aa5841b2a92f68aae83c75d6511ebac70b7593956223d73ab3a7442686b49f9b906e0488bd4ebaf3b954675c42f169549ec6305de3f7", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "158,90 €", product_shipping: "", 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(){ pmaWidgetInstance607e875ad9685ed2727d8ba1.initWidget("607e875ad9685ed2727d8ba1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }