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