var pmaWidgetInstance6357a097ac365ae374359a0b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0b3058b6c29afac14b0fe92899d52b41:ff204812229b7c509ff765ce9e95ce1c584e2b691b6a82e7de4d8f067553e0f5304575d892fc59040bb448a6a1c137d57e281387889c53cdcd90b0b3fa1f31ef41ea0e9220d139092e7beeba6ca771960d025ebb3afa7a8cd19154cf0d74178a8815fe209b56a4b4ea8b6c72c94360ea3bd1f6fb36669fc89bd5ab440ff1931fabe1f1b160c6c0ac941e66161e77fceccf214928df9b63e93ec7b0c482bec8b7ff968a09967d9c8984594853893b1d79bf04d294cada7ae4c7fd2a3918b6f3bec646eb5db5c7504a1365afcd6994fe7d", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "8,95 €", product_shipping: "", 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(){ pmaWidgetInstance6357a097ac365ae374359a0b.initWidget("6357a097ac365ae374359a0b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }