var pmaWidgetInstance6155beed0067a2ef59f2c563 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3c56fd444fcc03163d0bb6b5af8d2c38:5387dca51e98b2b808ae0ae8d79a3a02bf8b4e05df96aa1572e0ec613cd7d67ae0fa4325f9c7e0cf5f9e300338638c09099e978819731bc5c9f03dd40d06d3f38c5693d85daac06e998754be7d2a5171692d09041a3ef6f5314a163fd5e3877aa7ddb0b3b79acfb4d9b51f1c2b1bb194729f25003a1b464ce3afb594915142a6778dade12a2edb0e99faae4f9791d565a0009096c2450d5e5cf84278df1d2d7cd961bb376382925188c7dcd842029d750d3352a1a45c950dd05a89234bae4d9f", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "42,94 €", 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(){ pmaWidgetInstance6155beed0067a2ef59f2c563.initWidget("6155beed0067a2ef59f2c563"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }