var pmaWidgetInstance60701628d9685ed27259f3d9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=94be588c45a6512354a285e7a61aaa42:8b9f35acd159dd38d412cebf7f7428d6b3375f70aac96809bfdd8b10bdc60f4b0924de36086bc122bf9847cfb6ff95353e428f784e9be17cec8da2b24f3752575c5eb8e30cecdd01f900174867ec57b2c037c686571288d1734af438f1d1e47967ee8c8ec278d1e6053e5b15e9ef756ae88663cce1daa8559fc79bf9a6a7ccfcdfb1d12bb8a98f4e2f14853049da059015aa6927980d84caa540b30ff1d7beaae09aa534b88dc13b4437caf84a2ad3abcc39a5ba0b6922d7b7788632bc480346b7cc9b1b33a94010155dee4f32e12e00", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "529,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(){ pmaWidgetInstance60701628d9685ed27259f3d9.initWidget("60701628d9685ed27259f3d9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }