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