var pmaWidgetInstance603e53dcd9685ed2728af5a0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=895921b60fb514be3fe47c665ea301a1:d191c652308a4e7d5b1f36e4cf687becc5162ed2a8a24625ede47730f8753fc8e1ee423823bf8f52e972abe07dc8028c5c47328d63a62419e4d2566ca87731ec80db640e115bfcb1fc88740ac59ebf390dcf7b2b6da7f9b62440b2a1dcb3b0d2d89a5b74a23e01911c99ad94042620ed2b30cb273c6106a0ddfa4c14a2c6855ca362f678338756c6e3296c2924f7cc44194ab0dc669f5b0844d34a544d1f991d42e590aa84fe47ca0b6c067045f33e11d9932c9908702bc6ff05dcfc144df401", shop_name: "Ekaviaren.sk", shop_logo: "https://y1.sk/t/s/130x50/51729.jpg", product_price: "8,90 €", product_shipping: "2,15 €", 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(){ pmaWidgetInstance603e53dcd9685ed2728af5a0.initWidget("603e53dcd9685ed2728af5a0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }