var pmaWidgetInstance633d3c0bac365ae37466eddd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=15802aa58cb4b88c410f2c2cb751a81e:80ee51fb12c8f503d11da2880bc767e9c5249e49b01da87f6d7777c8a40eaa6c8ab344d6d14db50a19244dbc7a8125aef25ec08616ef69bcd53bd2a880febfbc3c2d896a861dff259adf20a42481db198f88d258e0bcde202b9ff5e6c3859df3278dd81778470107514d2b6201c123c554b2405d70af586b0e00548461357d5a663225f668c7157cbb5ab654bc879f3d8962544f0696ca566674329c76e1fc376c89a0506d976126bd8328ba327a3d5f81a962c5c9799eade027125300ea7324de35e188fa0df85ce8195ba97b6b138a", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "1079 €", 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(){ pmaWidgetInstance633d3c0bac365ae37466eddd.initWidget("633d3c0bac365ae37466eddd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }