var pmaWidgetInstance602d2e41d9685ed27251df9d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1ace0beef87d7e83f12cae2eae6c41da:0ac6c69a3841ae8ce7addaa59212b5064b16bd59b075ec091a0ac1ce83b5df7218c631fa04d742df7998d771c6428bb2fab40bd62f910cc87315f8b0cbe12c2e9a9a13959f9b8ccbe09acd661cbe66930bcc4b9766d43330e2b6a87486c66560a18ffde9be48fb4295560b01bba315ae57fe2b3bff5a275c33e6dd840ef4ee9596e661958fea528e7cee40dee48f56705cc53546eb9f2e2be329a8ffd60e8c204c938d0b03083d6330ae6a390481dd3bf5caf841a4de9e81f320df6cece514d74656440bb2eb4c23c2d63e66c84c556b", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "730,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(){ pmaWidgetInstance602d2e41d9685ed27251df9d.initWidget("602d2e41d9685ed27251df9d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }