var pmaWidgetInstance609d2fd40067a2ef59d96419 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ccf89e6bfe44e1a3cad971f697f1797d:ef7bae13030b18d6a27eb887b483a172df8d876009a838813ae5561b73d3e2339da2488b83e9e4517cebfa2441adfe01387fa17065693f43ce26851e5ba9c6f2f01007765293ce24705c8572fe31f1605e6ec58086aa625e3dd7d367640117ba035c9c860548e4ea0f8fc40c2ca31eb2357c9628bf3bc694c42c0d18ffcbf37b838e4bfd40b357f1e205c9ddf52a48a864631d19142642d207e7bb2229f09dd8f052e7e6b9490554ee8de99f9136da8ba3e3c12865948cf681dbdaceaa58025e935ae43b533700f14e48b5aaa49ecb19", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "587,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(){ pmaWidgetInstance609d2fd40067a2ef59d96419.initWidget("609d2fd40067a2ef59d96419"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }