var pmaWidgetInstance5fc90418d9685ed272326e7a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=316053fd0e86a6c813adac7835c680dc:f52056a5655a826f2fac3903b8409a14fa3a3ec1c21a30edf022888c229cb938231560da454550586c39c080b6c512d85b3fbc2c1a40d65fb46efe29b3bfe366108c8c5a5c4be750a11c8eb2a38b82c6d1c6fbdba6ddd0f9ec5b0ca0a5f3e89ecac3d77c9a4dd0a170dc88db140d9d5bcd1f1e72030c46806a6710146e6d452d9875bb457a7ae3c84da0ae4fb287de88e45024e2616561f290d77d221d6cb7cea546270ba1216263039e1efc623d841b217bb1b551e2ebf3ce8a5a64919617e8", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "749,00 €", product_shipping: "3,99 €", product_availability: "", 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(){ pmaWidgetInstance5fc90418d9685ed272326e7a.initWidget("5fc90418d9685ed272326e7a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }