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