var pmaWidgetInstance604f626cd9685ed272f5dcbb = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=14389b15379568d9291b6ca8b56f27dc:e8a7b8a6a84512d80826a4dea578a1b2d06e008d80d35d176e8bdbd7525bdca5d49544bea2eca1fd71a5b45fd7d270d8782e0797a496377d1ffacd0e02e9d95278532b1882e94eb58e24d402cca5b818895f23295a18c9c8a2160389ef77f8e0704a0c31a15c08ee744c5ca755c2397533b9889063e10eead9bd771bd2a95375d18eabed201b298d6234e9a70a1b182f7c3c4a8fb1ec9e69316163989629eba3709313157bef0e5aa925aa68b94f95940fcf26ea3eaac784aa1e138f6493a0ed563d398ec756ac5f550a4b94080520e3", 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(){ pmaWidgetInstance604f626cd9685ed272f5dcbb.initWidget("604f626cd9685ed272f5dcbb"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }