var pmaWidgetInstance63fc7afc4218328905a87f46 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3f7cd3c9fd73f74def767aaf7ded5c4c:638486afdf387a9e0679dc934e8c87bb91a7a12eb24e95839797a132dc8c04e6fd270e77982a447938a8d19b59449bbedd85d9bb6ee0a32305498dca399f42163667c83f60125eeb0dc5ee05196cd177e7077827a2e3e4e7e653c0bc8fb2ce5b28feec3732cb1efd995137e1c629b300bfb90edd357ba38b42cbedef0d31d4f91d48a740d241a8ef92eeccb4a5d488ebed4da27fa84e41cd904750d1c97d2105be436a94d951ed89b5fb4127e1e4e921dd50fd82971453af083d7f44b8b47764f8eff22f08631029e53a333e9281aa68", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "1099 €", 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(){ pmaWidgetInstance63fc7afc4218328905a87f46.initWidget("63fc7afc4218328905a87f46"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }