var pmaWidgetInstance613878870067a2ef59a1deb9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=65b4de5e461fa9f13d64aaae93dfa31f:64834563efd2a57b04bfd9bd30a3db520b6e3960dde90b1712d4340c029c2cfde0cb9190ffa7f7f52d7c965a79b971c305d23b054caeb9a4905d3fee7a89887c4f8c9acb0c959306fcb3593a0145e93169d5c4c3d09cb2299f6ea64826de4cf16be14f0e7c8adb712077a9090f251d3b64daaabc1964d1591491eaa391e3b7b04331e8d570f171560cad6683511ef975dda287ee28ca7e97e30724969e2e0e3c0b54c38cebab39425bf79b73663fb754ea5b5f2b8c3f10641584fa6936e1af964639e2bee450b735191ea54c9696a329", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "450,00 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance613878870067a2ef59a1deb9.initWidget("613878870067a2ef59a1deb9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }