var pmaWidgetInstance64ba5a5342183289057bea1e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5242f8951fd755db427df1d279238524:249264949a6e50cdb43491ddb04bade8043cf149f30aa9d0f97a6f2464f20d79c7df32c45beecaef9ceb854c73e7d4909811c7d2c06e86f5771b1dbc85b16ecdca9a5ae5d0c0daff95bbf7f261449b22911a530f9ad2e5b2bbca7f7a58a346e3a6421e5a561aa99afbd5a2fc3c66c59665530650f124f875d3811522d9ffef440aa3f4f5595115ce646aadbdb562be945d7d472d65157e6f2a7504a1f3cedea2e9f62ac9bbd03943c10c5a1d72b225490809eb82a9d87e25ab2db7c0b9d87e112427c9d7ff99700d4d05bd9d20b2f87d", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "720,01 €", product_shipping: "0,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(){ pmaWidgetInstance64ba5a5342183289057bea1e.initWidget("64ba5a5342183289057bea1e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }