var pmaWidgetInstance6048b9bfd9685ed27278b46e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8ca4127adfd1646535f0b0a476c11ca9:19266427e04a3c57deed0ba9adc84831f4162145bb1f44ce6d734b22bc172312ca72b3e31792e6fa8185b2fe6e5113d35ac6a04c98b0a06b0408a100a6e47b42253f0f9547705e50991aad7dde884646a479cf0d464bf7ee67576faaa00d6a89dddbebbacebabbba36ac10d2fd176b41c7d1a848ed8be2864a3792e447dca27230df5caacbe1ec194ff750dc4c47d2a9f22c74ef2ffc9137a3ed1d2de2457552f93ee2d4c975421cbf57b7391091a6bfe5977fc4290c46b915a78d2a9da5d55c", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "160,12 €", product_shipping: "3,99 €", product_availability: "", 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(){ pmaWidgetInstance6048b9bfd9685ed27278b46e.initWidget("6048b9bfd9685ed27278b46e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }