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