var pmaWidgetInstance61123abe0067a2ef59569d7d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b9e2097bd2cd890b3dae7811286bf415:04cebb387f16c4e75627f1911bfa6dd700445e07ddbbefadfa5a12591e77a8391a7cdc7675fffacf16c8cfa3a2ff18e5f94fa70d4c2fd2a7b950cf9d71363dd3d4a0218fed59668f67af266fa209fa533958e799ef94aed58829f12ba32a1ddc8963dcf36f3a4b0f6b02c39a8c298dcc96558b8a1d88dfe97902d9426ac2df336058a734da2e5ed3ac61fbe4403bd393d2a27fe1951fcd61ac36d64b45046588f25c07b9a522dafb1ae302149a301d45b8586d1e1630e5a09cdb358aff5816fd0792f4d4e5c81174e0bd9fff325e8895", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "339,90 €", 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(){ pmaWidgetInstance61123abe0067a2ef59569d7d.initWidget("61123abe0067a2ef59569d7d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }