var pmaWidgetInstance6006b209d9685ed27249f892 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=097468282f9d55d5261c737043fb5363:cb8e6d2b21c00a818747524cab76c393cc876c2c4ee9d14616ee9dd210aa43c9ebb7dcc2f53584b62d938571d5e4280876014f86d0db7a9013a9d49e2c067fb01a3cfd5d9d3fb9e649c7b0d9dba45625f2a35da91cfd1b2d63f58a871c2cf58369d52bf7115de14c8cf5dd9ca266597a515dc34ce88b6227e7832c2acd030735ce2deb649c87ac18f388917ddb383c215dffd76299229917430fe8a3283d8b3768c3c53f8b785d9fa6c6678d8cdf8dab20d49dc6164119a29e327b6838a6fbae", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "18,90 €", product_shipping: "", 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(){ pmaWidgetInstance6006b209d9685ed27249f892.initWidget("6006b209d9685ed27249f892"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }