var pmaWidgetInstance60461bbed9685ed27225bf13 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d066937bcec8d24493ad4adb3d095377:cf8ebb310a2d814534e99070880a9d28e48dd3cdcf0e242f9269d4866bcb3a41a412f2e9faa20958738462c80492090134a2fdcdd49f1bc9a661bb7b780faa2e361e7d916b41647ba7738cac02ac0934a890f3e97de5e9caee6bf196e1a00f22020f68edc3030a1a7be7dce3a9a9dddfafa9b94d2f850e60ea3d70c66db1cf98b821d6876b3e6f4955f78b249613ce5c38aceee8dcfa7500b57aeb2a179de7b7a181900b13c9a9a2fcfdf268d5fb34245c38e2a995b0bfd0f39817888127ad910b05ba6c4c0e798ccce1810c78aefd25", 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(){ pmaWidgetInstance60461bbed9685ed27225bf13.initWidget("60461bbed9685ed27225bf13"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }