var pmaWidgetInstance608a70b43975337b9e6f9d5c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d38cf8c164d026c379e0a80fc251dd87:4592a5b0553546c98b5cfadcd549bac1f7fe7c820786fb89e89928b6e5b6c7879969dc18c9336779b43aa7756052bd833c8745e5e307c767792742c0e638d888c770523e41a94b27b5907a9647f0301d9bf98e5025edb5f8cc4f9a0e415e6d758a2880e13279f00911d301c6dbb951797642a08dd45902d11fd97aeb3b56d67556bdb5b70b57713245668ba412109a5f96f46435db2e31a925715a553715f7d7a30ebd2c98b052ba96103151943c0198ff31caa4369c5e3cc453689f38f03e29185fcc27de48d506e4c4ba041d568391", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "365,00 €", product_shipping: "2,00 €", 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(){ pmaWidgetInstance608a70b43975337b9e6f9d5c.initWidget("608a70b43975337b9e6f9d5c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }