var pmaWidgetInstance63e2201d4218328905dee820 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=22cd78599f600f6398cc8162ac78ba7a:1d627e185732f82f1fddc46c898450ec74241c3cfeb94dc7709387f6326f060ce532bf6812609935a38941fa0ff5e69f7542f3bd8d46900bfc9f27a1fb6acf78a3f50d67154c3561c666f17f5c8ae609716e0a1f4948e3cfc2b1855b51ff5fa4c6bbdefadd6a9cda8efc459f55b8f48d24e49f608a3f77e47280997e514a73bba57c89a49cf75a7026138fa186ea1399bd96ecb79b061cfe7351032162fafd1b47d3a8872b129b9e5c6ea79e87b29642002694fa1bd342d2e218cebfb9b6ee94fa9b5b51dc5baff80c0045ba7cb1dcf9", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "373,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(){ pmaWidgetInstance63e2201d4218328905dee820.initWidget("63e2201d4218328905dee820"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }