var pmaWidgetInstance62f6184a524818ceae139215 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c58948f6a5fd8d664ba5836cdf83e723:656a3fac182e6a9cfc4e433132bc64e216fa1748270151da11b89a406d04b5e8cd304d055529ebc92b24762cf8ab0930a2478941967372e86f0575dfb06a2f34c4b50da4cc5d2664af0258ac7e60b8b761733cb8f23916193d59ba10f17f6751089d1672558b13abbc0b3aa7a1670d3a74f2215789aeb78cacdabbb33a50d6b6a3796bf20f49cdb0ab7c3df89656e11a0b1a16af44d6686d3a1805a43e7cee2589c63132f11936aa883e09db94f577b3a89fe230269bfa4abf804e81087da0dd", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "56,70 €", product_shipping: "4,90 €", 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(){ pmaWidgetInstance62f6184a524818ceae139215.initWidget("62f6184a524818ceae139215"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }