var pmaWidgetInstance609151bc0067a2ef59011537 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0529bbee66f2fec7423db0d265a33c8e:a7c7269667e40a4834a2daff8481f02337f6688d01f1ddff8b73a3376a1a4c324a1b76bb29d13822c3f23bfcd8624221c9dd5b6b5375ed9079cbe7d08a4b3a94e5162d67ecf4ca325f41e8deeb0193b16988f68d922f8e35be7c403ae531a97cc2e5db31473e3428ad6c237b042cfa6d894aee6e0865207546ba9c59a0cc8ed2d204804b1d15f9ef0b9b6e40a32dbcb5abcd3ccde27c10daaebf7900b7a8fe9b878a35a2d68caadad536bd507e05f50dd086300e09aa39ca456052e115451cab67a4fa2518ebc5901de84a9c24b668f8", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "512,39 €", 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(){ pmaWidgetInstance609151bc0067a2ef59011537.initWidget("609151bc0067a2ef59011537"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }