var pmaWidgetInstance614b8efe0067a2ef59e19980 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2a58591213d895da6149d0230c4fd847:b88840c8e080b21c04630c62372f14889dcc6e563014daa458763e15f95791325644dab748716bcede58f5318c168535af1e536f11a6c0172fd98cc44ccc60471b063c0afdd11db5298a34ffe0ab92c3fbdf53f8f39398e9d183b3cde616ccef4bfc8d31bd00b08392f356b4fff79441c4f677aca9c7b502627eca7a8538f3d36d5c333b614d043c90e033a2499de6bcda0b1acb8375e8f769a31fb8340b0d2cb2fafc2a2cd8eb679dafb77a25497a765c4922c2a01433262d4c2052b3eee5af4d6174e7b44962406733753f651d0f03", shop_name: "elu.sk", shop_logo: "https://y1.sk/t/s/130x50/59355.jpg", product_price: "249,49 €", product_shipping: "0,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(){ pmaWidgetInstance614b8efe0067a2ef59e19980.initWidget("614b8efe0067a2ef59e19980"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }