var pmaWidgetInstance6017cebfd9685ed27299739f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4a30387681b345785bb3204d44d9d820:304e82e7b1885944d78aa59d1c383fe84336d23ac5faa4b4958364f62074c0bd3e3cb9fc5610424a07916ad4d79892e3205840cc165331e020f490a3501386c02089b0c1a6dbe235fb6e24c78876091043b5801ee265f24dc9f7b5b89df3d568e79a77f717d6d260795479580ce6b495d13e02df0d8a271cc2b4ea425af21055bb3b76bbc5c0dd617e584067cc9936b50b4d4e5aeb712e86ca3220b703ff56047db3469a4ff081b71d36c91d5e9fe9ad10cf7fc0afed2d3efb0eb43bc0199125808fef5cc4b4022f3719cfdac55c89a2", shop_name: "protein-gainer.sk", shop_logo: "https://y1.sk/t/s/130x50/51061.jpg", product_price: "19,51 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance6017cebfd9685ed27299739f.initWidget("6017cebfd9685ed27299739f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }