var pmaWidgetInstance5fc8f23fd9685ed2721609ea = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8ba2f718a2bd76dc431551240b49da9f:bb49f2adb57e3bcbe1f4a00cbcbe27da14f903e5f5e4428c5a062dd3a5a8408881d1af2740cbebcd32b0917290a54dce5e16ba1583310bc0b2e33ee9c45471ab3603951666809fc88771033e6cd8198cad9d179360fc0f40476403706dcfc9a6785bca9416541701b2645d45f354dfd18fc83e6d853bcde2e43063e62cc34c21a0b6216b27fbcae9ae048bfeb3e981b011f9102fb2d0c1a7cb4c132bcaf308590d55eeb5997de154e7e25108c163dc387e7e5b5508b103c0eaf166653139b294", shop_name: "andreashop.sk", shop_logo: "https://y1.sk/t/s/130x50/530.jpg", product_price: "79,98 €", 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(){ pmaWidgetInstance5fc8f23fd9685ed2721609ea.initWidget("5fc8f23fd9685ed2721609ea"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }