var pmaWidgetInstance60c3264f0067a2ef59f43f14 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7352e00ee6dc8d74593f7e741a5a73fe:942f177af5a2e92822ed0ab1cb50f96c47e39486bfb7dd86918a56a4961a604b598773c1eb04a9139e33426a6b508ded4cee990bfee2e8260fbb92b55368032e1edf3451ee6aa3d68f995328eefc02f354163a70d39b6ffbc1cfd1819b4783154c013ce726412273650636b0d5ee4b1005bc16259471876f5a82e7e0c980956187c496283cc9212628b5bcc37f72176058d434dde73e4529935e68c85156abcbaa80143a50dacfedab5a15ba3703006227c554457cdc2e2d611faea8fed61d77a0d750ede1dceeffc2275666b4e1618e", shop_name: "Alpensport", shop_logo: "https://y1.sk/t/s/130x50/56734.jpg", product_price: "77,67 €", 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(){ pmaWidgetInstance60c3264f0067a2ef59f43f14.initWidget("60c3264f0067a2ef59f43f14"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }