var pmaWidgetInstance60dee6740067a2ef59d73139 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=53e2dfa5f5ee9b6263e4f93d92565e6a:9dc0f93d5ac73eb1efe4f1ead8a4aead6f69fa240530a208d66cadbc853efefa1ca43be01ebf04907172286c9636eb9516e326b3400bedd2aa3c96aa024e32cdc1d28ee91cf00b7bb332dd5a20723790d5bc47214b120e01cab15f700b30c736d651f8f4156acfdb43f456ddb6b18f5e07564bcc6db3793264da68f548c381d3267f8144f3c175dad2ce7407e52a546a5168257f925c57761b8992f8bca7cc98a3dc4ecc88294673aefc56f71688ed4605530b33fa4e683bb31bfecdd10732e9b50ed50610ed95d035065da7c2a8cc36", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "350,90 €", product_shipping: "", 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(){ pmaWidgetInstance60dee6740067a2ef59d73139.initWidget("60dee6740067a2ef59d73139"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }