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