var pmaWidgetInstance6129e7e30067a2ef593f54ae = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=43a79e2bdc261c610679f4f133bec862:20812d5d8f25bf3aa481f585604c9811187cc00e6182e7307aa99ae0a68e04e817c3b0748f52ae7f6ee2fb0141ff2254d68b6958094e1a105c9f172f992f3bad10e886f737559ffbd3fd89e35eefd0e5ce90ee364ba51b954f390a227d6cf1bcdec36ad95d6e1dfa0d6f62b7dd9a7421873506b01636067cae3ea979113de238af8e2069b31ec3746f97785caccf641329c5935caccf22a381586eea9849b686eb7454d027dd9413a4213a95f8aedc5665a39a2f3b3e5f13ae4ccba437d624c4e9aaa3ca652a9df25d3d111ed63be0b4", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "512,39 €", 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(){ pmaWidgetInstance6129e7e30067a2ef593f54ae.initWidget("6129e7e30067a2ef593f54ae"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }