var pmaWidgetInstance634fccbeac365ae3745fbd88 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a88a4bfa1e1b8615df53a72035bad97a:43fe2d72d86d32d5dd8e45413921a8b4cbc6270da53aa69a8208d3e6e710bff650e56f0492b31af4b675d478e28e25b72d5822a17affefcf2fbdbecb03aef32166dfd99321104fd8e0d296e75934e3b212032d596e465d7fa16455de889cc5ded246e9c8615088905f174ce878adc0581837da550380534af611b1b912df0b4afaaec9a7565945142656c487a2db2a0c88428c8a0f9e052d1d519fbeaaca95b0f70ba21602c0892b29454c7f75a76a2e475775706a1657e3a4d00c154687ccdd7ef758762527c70a6b511fbf6d24c757", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "899,99 €", product_shipping: "8,99 €", 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(){ pmaWidgetInstance634fccbeac365ae3745fbd88.initWidget("634fccbeac365ae3745fbd88"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }