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