var pmaWidgetInstance6022c749d9685ed2720efcf6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=61b28b04a0efb61bdca793959ab96dc6:b7d3f07b69fb8dc2049ae8e3c03171592c90909b0bbc69903d58ae9e605d373ae00c5a287a92b65a5c86d753e55026f2908bb12235185b2f3635c6d293f18cd8ef819786255573ad629a478b7eafb4a0910d30c61ac286a264130e3703b53ce1fd5bd4af042024cc72dc06688f641223232a57b6d7a4d38cadbd9567204d82814a9f3b5739b76f354a5b21f9992e47a15fc69015a6d725d3866099761478bad68e4945a59c177937cf85455d5a68606815acdb314f67d96504bb084d6bc1dd3e8b59608617a3d571ba0c2f5901d9045f", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "157,95 €", 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(){ pmaWidgetInstance6022c749d9685ed2720efcf6.initWidget("6022c749d9685ed2720efcf6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }