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