var pmaWidgetInstance60bdd91d0067a2ef599c6a2c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d9422e9a5b8074e3cfee840ee8484133:1f18259f79fe03360d783a95a4df521b5f3fd8b158e8fb59639c2c9060025efc9aac863cac7b6469345baf33514aa43ed590f78e64f23867ec00477872b3674e010ebe53d46192428cb5a772ad27c7e763df0840c7b0bd0c6a56f4173553cf256da8f275832d725318750db3cf2e674c403f2af976cf6977f8752e61d69004cb4ebb45cb58736d0958a53c29ff2eff4b7233edf0ac8d2e956a1c54a7ea7bdf534c3c895f411809ffa9e20cca810b7a0bc6f3bc03debdc52d51b912e100bcd5ba135378c8a448458f9b988d4f0f2eb1e7", 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(){ pmaWidgetInstance60bdd91d0067a2ef599c6a2c.initWidget("60bdd91d0067a2ef599c6a2c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }