var pmaWidgetInstance6052278ed9685ed272095451 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ad2cdf0904cd39433b7dd19b3ae3292e:d5fa1364ea0e1b7d1d405e9e2168094d1b09e28c2ab76681b32eac4d11dc52b3d66ff4f200307677164bbc4f738a80c3752c38bb0a3f1084b7ee164122c6ad4fb2eb61d07410422cf4919422ab7062c40b52d2965a5782d3f58ad13b3e6daa9a38f9a3122531295f7595efbd81945b6e8e992c28a92ba543e64c4bab71c6863d4736821e110e2a756c6ffc13f99f24862218dff668a38795db6f1bd3f5de040f185c9f89d86c0cb8d154ecf332492a2f8a46383ef22af45dafd5bac47f7d9332cd68c7c50e09ed8bd0500189af90522c", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "21,80 €", product_shipping: "", 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(){ pmaWidgetInstance6052278ed9685ed272095451.initWidget("6052278ed9685ed272095451"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }