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