var pmaWidgetInstance616044230067a2ef594bdac8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0b44e9b09a0d2826abfc30077c5c8f93:994c601ad75ae67af7072d47b1bbe88d1f12cc652d31a9585d58f09b927f2984aa2a0ca7ed921dda2cb2b7220c27ef30581080ac550ac70c1ebb0cca98d67ed351aaa690c3ce12a3e029d8a8b41e3c1545e28f254b07fc6d73e1736881fdf5154764bc36edd822945c5b11339c13c046717aa48925ee9313859cebb42151dd465de4e36af702f9a7dec15bf23f898c29d82d7a1d80929d825630dc95cfd7c0630681969ed0790c48b31f66737d7edc8366b3258e2d4dc52e6070f2e239cfb25addbb7da01a007d6e36a4a00a4007add7", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "449,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(){ pmaWidgetInstance616044230067a2ef594bdac8.initWidget("616044230067a2ef594bdac8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }