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