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