var pmaWidgetInstance64fed6cc4218328905423fc1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b98bcaa23eeaa98ab2f58730e0119995:76ff872fa1127acfb588e031d386c853522d419446f8ef607b94cf193cc62b132a7abaf3dd5ffede0637b677965b0f0e20b7505ea39d7c2984e9bc9f76ebc54d31541a6b659202a1b72b5a456c329516841bb6059cdee7a0154481676124867f79830867c2d9c067ebaf99efadfe067f4c53dc942cac08195528e939db52f2a33e812feff6fdaf1f3eae89a90d107be6f2f40df81b13dd18368ba6a950135e55b3fc56459d8546ca20ab3d694138d5d94ba5114df8a5b716946b14791e07f051e447d6ee580484a66a3a815c47d65fd3", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "12,29 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance64fed6cc4218328905423fc1.initWidget("64fed6cc4218328905423fc1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }