var pmaWidgetInstance64084eaa4218328905635a74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7cd5c0e10e4fa5742cc535348190a2c3:d0aefaaf2caed45a5c2db6c8e4a1890f93bedb7bec3aeadc7dc5700ab57a3782a5c56a6a4871e9e7622453aa3a7bfe3164d3debdd87c1ce394a02ece65b9198bce45030a6704db86af6a7b860f5b1c75587c2162889f2880dfedf078143a905c9be3f81e7b31a2f8bd3ab3c888bf838f485276ec1f106d7505c06b2f7be55b8b159cd821df7af03566fbc2063356eba470c157bf81db17b57e4893f1cff61daf2c282cd3239f6532b6e7bd2c61e6f894fa386d37de5796efde42c3dda15377552a5d542042bb42f8d86a03bfcc21d394", shop_name: "bagport.sk", shop_logo: "https://y1.sk/t/s/130x50/58028.jpg", product_price: "170,95 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance64084eaa4218328905635a74.initWidget("64084eaa4218328905635a74"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }