var pmaWidgetInstance614b18370067a2ef594de9d8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1bb92fe54ac5bcb3866b863f25788292:128e86017b2cbcebf15b1e443e735bf47a59ee5ef5f85bdfa1ed46f04023647ffc39024703e452ea640a5cf3d7706e789ac955b7f757b512f6f0aef33ae32ca1a37131d0c9bc1359385a948cdfa452fca1767ea312be6e27f8c61ddb6c558d8643cc93828d4df39fc8d3c808432d63e03338b8525881d042cfbde47415668755abd04bd09bb22ce600bfddc5ccf91018edd59d4b01038da19d7d5c8eefde2dbdbc422fb06f5c478ac0816cf12b9db67afa296e607d3735a4f14387dcc23503538702d924181de993b8b635c9646ba01e", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "470,90 €", 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(){ pmaWidgetInstance614b18370067a2ef594de9d8.initWidget("614b18370067a2ef594de9d8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }