var pmaWidgetInstance615081340067a2ef591ffb6e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7f7611f325c8a534d451ac4fbad5be6d:fcc80a3a7e44d618c2242f277d053a5964b65d898712b862c8aff6998c222878e48366b7cb7ce564d45ed3e46858845b71014c3de8f02eadb1081ad760c5f1d62afe06ecd68ce023069e359783bf53daa69c41d9247450f9f733c0e9215f07436ef4d1f1a7be4eabdff4db43d359eb0e05ee7cd005f98ce009598c4b16a11ae23f6653b507eee2c839298cb5a6160df228a9b09ab07cde297fc615b9496b3f54ec343539d332e07cae3228cf81656c578bb5f0633b095212a0ca92d8f8698274903e5953b6a9714047f301a764412064", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "194,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(){ pmaWidgetInstance615081340067a2ef591ffb6e.initWidget("615081340067a2ef591ffb6e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }