var pmaWidgetInstance63579ee8ac365ae3742585cd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1c8f5200b1f41a1513c12ff83ae4699f:ab05bddc3620807991ed7576ba17c3eda87037cc3867df613d01af1ed12b232a54c2dd683777cb30ebd00a81f7f2ac579465648a2d727928efa265c7ecf973415180170dea402bd72bf31af7b0b7e3afb195dee1455c6b8dac77ff70f4d0c6f38a7cee4a1f801f179718c56c6193dff412df0637b15f1d61c0e4890a0d926fff663b04cc6253ad7b552380b9b0f3d99f432fe570d8c4132ba02dc0e5671d616dbbe715b9da7da3f7adbbc22935bdcbdeb2d88e28e40f8bf86c7993b50ace6f22a741a7ffffa7cc38d72bbab73d99e866", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "4,72 €", 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(){ pmaWidgetInstance63579ee8ac365ae3742585cd.initWidget("63579ee8ac365ae3742585cd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }