var pmaWidgetInstance63eb8ee94218328905a4116a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=da887ab3080a5e3e2ad5710a96842330:4953168965732ca3472dd00613e9f70773d793c5a16b8836b8cf42dae5d5fe6b29b774252e7645569b6acdc614fdc14938fc04b9002d910db9572d1245d3ae78cbf25abc67ceb74d22bafe6e9d95db4bed49e3c7ce05da8b509ab5155fcf453b4314f3b9dc256a554e0af47fa042008a23626ac5618ad1af22e945b7f8f4439ea8f5be6af479f2a2f9ef96565e7f00afd4fda0346af7ba4971a173b92c9b47b75cdf420d8a128669946feb2aff280179a86761a3fdddeba97fdefca34b30c1cae43c65150a132c4e5a14bcc4b621e7a0", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "269,00 €", product_shipping: "", product_availability: "", 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(){ pmaWidgetInstance63eb8ee94218328905a4116a.initWidget("63eb8ee94218328905a4116a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }