var pmaWidgetInstance63739483ac365ae3748a79d5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1e8a001f5663726e5305effa8d94770a:33e5cbbdef517361620ecb3465a36b6bed96621515664b66236ff6f5ef40d75c97ffcc8e756858128dec81e8187bb7aa5e369a9c307bf12640f1ab1dc27a1890f231f69d0d0c4ddb0f5f8828b17a5789e798bb46891b474c07bfac671114ca49be9a2d359c920f2c739d60fda9db7f179edc26fbf236a07e93d176eb23390991094accd95bc6d76030afdee762f46ee0c48799637eaa142d9e4700b49eef52366bacaf98cc8b9d8eaf5d631d700f7c7c67e9559117dbf6f9a6b05a9e5c4bac278449f89ded4501317f414b99e9d1cd1d", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "685,63 €", 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(){ pmaWidgetInstance63739483ac365ae3748a79d5.initWidget("63739483ac365ae3748a79d5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }