var pmaWidgetInstance64d4e7f342183289058f4fc6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bf4efc106e844958488bfa0ec7109235:ad9adf20f94d62a50f012650f3db8fc56d91373aae1ccd6f13ba9a05dbeb9499ebf32897cc45b7e3c36eb0739763cdcddf6e1d0d14b5cfca8299a7fe01d0870e58951196f8762e7c1589700177f1abdffbfdafce51756d6e804ed6c54b4966fccc33ec8c1500c43961f2088cc02fdb23992b1c8770a45619fa11040e54abfb5794980c491e0e956c492eff794cd3cbc5e37acb1c156c9fa12b44a9a9130fa895441cff65446b680c0c97a0c9abc4c120a01b1baafa255128dbdd8a6507f447cfd41df1df481b9360803bdd512c77e98a", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "36,20 €", 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(){ pmaWidgetInstance64d4e7f342183289058f4fc6.initWidget("64d4e7f342183289058f4fc6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }