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