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