var pmaWidgetInstance60a75dc20067a2ef59b0c5c3 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=24af8e0c50d12d96894609f69e586a8e:e294485852450ae1b1e8b9f4867b8e0eda59ae00506b083010e6c1dc2628c1776cc6ba189647ebd3b2d44cdd6e3e4b1299c442b51f16bfcdc9695423d0b439ac3f12cb5f2b7fb614a0ed42842a738f85d6e2ac8f5b354c19f16efeedf8f5388a0f47b2750808e7669079456951d4e7f9644e9019d6e6efac62a12bc1cdb3a87b3fe7c6f6b954ce757c04d3cf43d832a60e81c18c46872b40cb31b373d9f4300672589816a3a1cd0c4060570641f7f85f2a2e5fc421fce61605cc25fb4bdcfd5624c978c1738f97dd39f71f14922122f2", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "310,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(){ pmaWidgetInstance60a75dc20067a2ef59b0c5c3.initWidget("60a75dc20067a2ef59b0c5c3"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }