var pmaWidgetInstance63fc8ec94218328905f4cd0a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b745b1c4df063e976006e4982f26b015:d0906ef42dc150c62e821daa2ae9160c26e1e745741251056cd086b5dbbc6dfbabf99fd3144b4b92ba58426c1e0d550927ad998d9da3de8e8e73a445a70527ca566202e4a5e06d27fb283fed6652561ea32e180f98dcac49b86ba530cf0b668f42b007f1305fdfa1086d8935b0f5878efabdf2d6fa0d537b892c0b480c460786903d1819b025c8893328ff21a863cb39e4b23b6c933463fef1ec7cdcfecfcc2586aae7661aaa1f04285ff02e14b707c67667b84682225c8f225cc9163a4b3b344c775cef6334361350a3a0d303f4fdd4", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "769,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(){ pmaWidgetInstance63fc8ec94218328905f4cd0a.initWidget("63fc8ec94218328905f4cd0a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }