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