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