var pmaWidgetInstance5ff3fd15d9685ed272af6b34 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c6fe069e25a0cf6755e08fc04b962ec5:5dd99d4ef2e3bdf432818d6e69539b94ea86ac4cb2687f22bde23cc2d3e72576933b4b87c363d383c5a4abafd541501081e834d07b2923885d42fc1c2e5375b31f948726f9737a41f6f522908b121885d6f514dd229a27daa8ee3ea0bf8e49b470a29a6649823ec076a47a919f0ba256f67602a2e687b73509c12e13a7733f0030bb5dc7e5855bd215e97f8bb04eb45561e0012a987a7dd4f1b839b9fdd3ee0989f4d1d58356fcf9c65ebd13bdb70dade46ce140e1f32a0aa355f6b5835c1af4", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "99,00 €", product_shipping: "", product_availability: "", 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(){ pmaWidgetInstance5ff3fd15d9685ed272af6b34.initWidget("5ff3fd15d9685ed272af6b34"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }