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