var pmaWidgetInstance614375c60067a2ef598053fe = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8b5a96e34d8ddfb9bf33b3b1a148ddf6:df3ce401a3720e4707033bb2bdccce4530768646af9bdb46329ac11286faf8be6c4508546771bf000701a98cd02b4122918f6e6311858abe4234b77915cb379bb042bed6c8786410f528d9f0c3157d10cd723da4673f9ff22e3409ba636e22d1a5108f65b638bdb79d98cb9664d03726e9b79a8027857e4335d4713d0d577028099b62104c9abba09e8f873212ac4e24807ae4f0e29b0773e1e3227c3eabb122d2a57cf913be9334bd7f2d385c79a29cd548cf33a02a2ab4b54745d61123b4543375fc991787e3a30ba08e394ba263ed", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "449,00 €", 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(){ pmaWidgetInstance614375c60067a2ef598053fe.initWidget("614375c60067a2ef598053fe"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }