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