var pmaWidgetInstance64fedab7421832890552da0e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b3f8e26eec46c0e723f109988be64d64:394a2dd093b0e3618b12108fe00eccc5774e011af0a2a3c3ecb84c5c88419aaf1ca334f930b7886541b909d22bfbda59dc4b8a7c321a01fba06fb252e86ba2f0983023ce70669746391dd4d4c0909d6554e040f7cf3ca339883a2920eda1f439a7343b1b14ae8f39ea09aa08a0470cff3a23029f07d6d18f7b45f4e00cfc07f71a48e542a341d920b15f9d89d30637724eb973b5fa0618c666427bba0e4fd997a64d3b5bd4ab0e9049dab7327d1fc025eb99d09f60d896d0fb399790981d24d04a8c158bdf367b09e89d42f7c1633bf4", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "6,49 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance64fedab7421832890552da0e.initWidget("64fedab7421832890552da0e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }