var pmaWidgetInstance608fba133975337b9e0455af = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b6a21fc6e5fd33328f70c8d50834140e:b42e488efff2fd76d07f1859d985c917392b2d2559ff91426c6aa07cbb31768f6ad5666ac4209f23e7467b60622c9d64dc88b65d40c0bd9efe50b145328482bbb1f32ee23db2bd4e5b5fd3eea8170db764b79a1432725dda3503e9d911fe52a76e7dc3e5b9cb290732ac2675bbfa857b52e7fb8c98c48a9fda17ecc47009e064c6654736e8b77ef9dcb548226f2755458a234d2b186f4c3a515621750862164e6690c407d600428f499efec567d4ecdce59988e4e354b3b0c5d03646310794b0e033b764c311e22d6607ff7fd756c001", shop_name: "elu.sk", shop_logo: "https://y1.sk/t/s/130x50/59355.jpg", product_price: "249,49 €", 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(){ pmaWidgetInstance608fba133975337b9e0455af.initWidget("608fba133975337b9e0455af"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }