var pmaWidgetInstance6121fad70067a2ef59b74972 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b2ca3b9e0629cfb1f4074130dae2b3d1:1cd10f9d660daf82573f18362948d61e323e367c3fbb74990141d5f8cdf8e37ce7aefee167355fa4ba6fe9fc44f16335563433cc01787daa25edbdbad4adc597303577b0bd75c406c106d1ae735645cab7f3ae644a720e3aff840753552bc2c5205a99d0c22490b6d9bace24dc536826fa37cd0c27e9656f19f6357bde798d26d93a21dad1cddd2bf666959290d71619862321c827d5adabedf59f7a2e6cc372409ce7b2112774359dd82d44350911748aef4b7d75cd8643e614e5f44cbbfac773a1e3aaae0a5b708f97bbcb7313cbe6", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "488,99 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance6121fad70067a2ef59b74972.initWidget("6121fad70067a2ef59b74972"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }