var pmaWidgetInstance63612e3dac365ae374a140aa = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8505c8e2211c8752c5d431c83dfaee19:622e66dded08fd67120d39bd4b941f1217a3dacedaf25c3cddd72442c934efbfdaff161dd4b603851b39b5ab0eaa46e4b9e2ba26fb5289fc9ba2a9d75e70499f318615a2eb206cd2b027d700a957ee9858828dd5d9dabcda12525fa0f8fca4dbc57c9613bf259eb91e9e46b0f45fa3e3a5990c55363c6513fd73f09ea40b26abc2d60179e054663929233c6a8efe9cdbdd3005e92c086b9fcde1bff49efd3ac1f0b981b099e36dc3e72bc679b9dc941d56a036fc13850fd2aac3d9ceff0ecf1e8cf2889b31e84bad19f429614e5696a1", shop_name: "pneunaj.com", shop_logo: "https://y1.sk/t/s/130x50/52071.jpg", product_price: "161,09 €", 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(){ pmaWidgetInstance63612e3dac365ae374a140aa.initWidget("63612e3dac365ae374a140aa"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }