var pmaWidgetInstance64c0f3184218328905d34949 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6fd9a4b45ad2b1618e6736a1cffbdebf:af3b163b859c33c7413f8cc3c6119acb4afc6dee70bcc81ba477565df0bc5f4c08953c76821ff933ce76585bc7fa9666c949dd5989382a9afc1d21f2cad6f0dd51542d9e98339a2587879bfcf49d0950416458fef3ababd900f55f2dc20a3df72c1c6f7607d84e75fcb4f36ee2b84f5576e5c98ee1ed1106a997084ae8670f2d9c7243da4be5e6a760e21c46c5b9251710c78c10076b749669adf1c40f82a6a15ef9dea4c54c5d40b3083023146cfae76a26ea45fb62e04d4a113cd98f47b68c71620ab9180224f36b8abfe819f635cb", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "459,00 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance64c0f3184218328905d34949.initWidget("64c0f3184218328905d34949"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }