var pmaWidgetInstance61405cd30067a2ef5940d9d2 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3a247092d16a7ee2dab525426c7681c3:48bfade7e42fd0e3a3adfc54095fff45b9c672776d0b6340f4782ba12bbd7e28612d85c8da078dd9e68d8e898671eb5a5ac9e5587358356b6101a62de9c15cb9e378b820205bc2c1fe5f0bef119626ccfac1e57ea3d9f54e7c40248707b1d51781194fcf12e0f440a89824722fa84df3628d07756bd9e7400bd622d6d3a5258e0c4e38ba76b9db86912f88ce897ef8f86afa5bed81233d5e878d9dc48ed73f5da4b8e1246c9e3e25d7cfdc9b3af3758f08dd64a3fcaceec2336e262e6c971071815325d2cdf1a2c19104a13cb7e22ef3", 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(){ pmaWidgetInstance61405cd30067a2ef5940d9d2.initWidget("61405cd30067a2ef5940d9d2"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }