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