var pmaWidgetInstance638b44bfac365ae374f5daf9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d2977a32996cc994aa3b456ab59528d0:40b13821a7c001641e172684c7f3275db75added2810058d2e612ce06bf7300f218b1f98ee62fc277a325f9241b75c5c7a8e1fefb4aaefed19660307799bffc5bf275d377f39782eacb962c8bdc2391f3d2a824a06459cc8db1bf3b07a05627bc556c455d90988703fb2fc59f261dba7f2900db8f47c4ff8f28d1ee7781a2ad0011a3688b873c02c71d24fb8acb26465c9df1d77a1017bded2a0a814575823cffcf91088312c315ae94be8f41eb61b337421bac636caf2ccc5345c782d5951ac72f05b4ca9baef4765912fa50f1422ab", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "458,70 €", 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(){ pmaWidgetInstance638b44bfac365ae374f5daf9.initWidget("638b44bfac365ae374f5daf9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }