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