var pmaWidgetInstance6038bf33d9685ed272cff1c3 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8cdab69ba5d99e8688a3fe06fec3b020:1002ae2277f51f79d1889c78c98a0133b38eeb35707c0c8687d62469327ec4bdbb1decc6320517f07283d1a7922bf791f11dd3284a70c8198928d761f4b65f993094aba3fdc7d32e224ec225f25907e2b01e79e707d71a46d67243c861f3bf47ce9222a56cc8fa98d49e4184ebb2ddca40a97030d5da39b1d76a33b2b8bba8660600d9ca683c703ce47afc6459fbda0885bb0c7290dc7fd171cccc07c2f23a0abc68d28c44751363da85f4a31d1ce8aa68ab37b9a54d5094aef37ed0c390d8137c019f6dff0f879f3bb258486693f585", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "299,00 €", 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(){ pmaWidgetInstance6038bf33d9685ed272cff1c3.initWidget("6038bf33d9685ed272cff1c3"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }