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