var pmaWidgetInstance614c5e5d0067a2ef593cd5d6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7e72e96935012e75a82ce0439eb72e9d:7237c895e9eedbb1a6dfff5ca3461627be02cee1f48be2799cfc26abf85edd1c630ae7ba3f7ba2a0a4c6a26bef2c4dcd275e328ab1241b871eb180a865a48788bf5d3a0cb91f61d87c828c70fc8adf72ec171495d0306a95bc861c0b7a4e0172e9d403a236b71dac39bfca44a2dde2c7c9e81fac7f4baabcee226bd2bb0722fb9b07e543cf7ea8eb998ec135e8265247498528b1e1e576658adb03dbf1580c4ef5e004e54bb34e7a3989781386db7e0852b7c8bf94da261f0e02a8a9735ca3c5ba4faef2a039d46ce04be1b687ea085c", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "1000 €", 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(){ pmaWidgetInstance614c5e5d0067a2ef593cd5d6.initWidget("614c5e5d0067a2ef593cd5d6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }