var pmaWidgetInstance63eca6714218328905a6625c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f6b87117893895cb8d54a2bd2feda8a7:95d7c533b4ea90058396f7a43bdc6f7a024cb4c66bf9a5184f2f54f831c7d23a360520129deccd3affce40a22243a58b1244a5489543a6d72d2efd972ca2c089dea29577d77be1a45b89158e714348f0a0bdf0df1b82c2c0ec2076fb262f7a9e8c6003ebb56e908e88529769f535fe7dd1aa40daac89365808c1906216883991e6d0da98348702bf12b840eaa8665b45af52196dcbe9ea6f1338b35a0edf8cbc168a6d8952cf574ace02ffe4f7d356c8d9a3865b5949a4278bbc59c04a1bf4c5", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "241,71 €", product_shipping: "34,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(){ pmaWidgetInstance63eca6714218328905a6625c.initWidget("63eca6714218328905a6625c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }