var pmaWidgetInstance6022ca97d9685ed272114fb8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3deee95d034b28e0db909c4436c98bdc:998083b40c9a514088e6a1258c5172243d04fc6d7b3e4da020567398f98c7d0f68e0835de4dba804409748eef5c6a44bf7c36bd091947e785fc4c0340d690bd01ea78f3ce267033cf195dbc961e7e21f6a6c906249bd144032b53d6e1c9173599652b2117a4f17a5f2a4273a4a7da50942823db3365671e1b0834e056d413779704d760c380484aa85e4d189f23c85070026910461961fbdeb002d1f163cf9d99224a0a1b4223da27317ae6a62b3d9c55c516b28dc1cb70ea851d051247c96da28637b070c3ced06eafaa8577b6d9afd", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "300,19 €", 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(){ pmaWidgetInstance6022ca97d9685ed272114fb8.initWidget("6022ca97d9685ed272114fb8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }