var pmaWidgetInstance6022ca97d9685ed272114fb8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=91f781cc2da0594238393480044f0df3:b4cdf29012c76d55c8efc8e2788ee3d01e40adb1abec9da32b2e5b6e365f920d0a097531cef141f32b36d43bfc55a95c7b5963b9b8e88c782c53bcf9fae97fbbf99627de3828055e689c3900ea3180615a96ee0ef3828c625e6cef96363d3a26a52c76c64865489bf8c07540184c6b59cbbdd49dcfb7ff8ccdaffdfb659fe11542f17cc384412362182b912164c7ccd26a222f73f1b80fdbad3cd365090fcb413602cc5a5083b34ff414d0ee9cb5e3f462383383c113621d4baf8433f15fe1c7bafe21f24a782f3e13e2ae06891fead6", 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); } }