var pmaWidgetInstance60ffbe590067a2ef59c0b4c3 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b89185f909fe128d0484232d237afea9:9635b391e246adb2de49ba11fa07d229880ae22582631f705ff5d06555d84791f327e87fc74c5ec33242436ab7b7bc869ae069413facbb1ed90bcf3f7414092fdc3c36e406bcf483f12f32276c0a46739b94f2fd44d00d5be73370f7de38e44e2e368c1cd57b6912d6800d117a7721bc987dfe0b346ef13980e9c71010503907cda5f3c0841a87d85584ea53f7c087380bd0adef2b877b6f9df42923dc7d7c61cf0d1e7aee817f6e4b1e38b589bf0e758fa6d22fb4a2a0e77281f8c495acd72b4b9ce4cf7eaad5b5e7c46049a97f50f7", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "754,90 €", 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(){ pmaWidgetInstance60ffbe590067a2ef59c0b4c3.initWidget("60ffbe590067a2ef59c0b4c3"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }