var pmaWidgetInstance5fcf701fd9685ed2723b5923 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6b9fc26825c796be04ff78cbd2061c30:b94a417a99bac7f7f2ffe827086402cdd4ef043caea3f7aecf72653247410b6c8c3c045cf9c746a92cea8e7b2c37e132b8a2d33d61e27cdac33ee5ae2543c8934513d248158c9c2f8856b2b76808392a87d11bdc54838e827b445183bc3799f8ef1063242c60a30cde58911dcc156edd26d70be51871857e2267de4f4c4501d62d3006799a291121cff46bd1dde54cd76b9bfb857153781cdb710efddb0c90b28ec6beb0eed75a741925b67a726e4dabc996d044d580faa82d33bbde62fbc072", shop_name: "SADAJ.sk", shop_logo: "https://y1.sk/t/s/130x50/59800.jpg", product_price: "526,24 €", 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(){ pmaWidgetInstance5fcf701fd9685ed2723b5923.initWidget("5fcf701fd9685ed2723b5923"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }