var pmaWidgetInstance601133ddd9685ed272bf5733 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=18610deec8df9a56dbaae4e58b69441b:9225e82fc6ecd6a78805afd103ccb6a2fc948133bd00174d27178ed76d9c89e35df2f936f837516a83288461d4a6eb2c7f5dade2647884ca93186028512cc6a2881891c03aefe6bd2d8889809fb0b9cb9588d80195db87298ace4bb75bf427ded47e93c14fa6b4a051c5448373455cb566f2c237a7d40335442cc4bf95667ec7597c5bd10aea6192a4bef96d927f272c5d7870010ec027d8ebb23abd5c6f38eb8d00ac8ec21934316b47b9b66b9b7319b45b0241670a55ea19cbda54d1902330", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "97,99 €", product_shipping: "3,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(){ pmaWidgetInstance601133ddd9685ed272bf5733.initWidget("601133ddd9685ed272bf5733"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }