var pmaWidgetInstance5fcf6721d9685ed272343c37 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=93f4db6dedf621be8ca4f7863ba980f1:3e721bd5ab197d9af4848c8b60edcd094d7e8d1bef3c6f6c9787350f1e8f6d146ede87fe5663670a2346961a3b53a71c8251ed2a311ae081ba43edc8b752f65975a3f9597dd68567591a9045a0969c03764ebd3612989e70824407d61a1f20c45423e6326f6e74dec9f3e0191e21d45a60b450ed92fc345f2c546285f6571834f8c231ff32db5b642e897a41fd55742298b8a3d7fd3594eaaa5e95e0ea1e2984bc3098bce7d7c22ec2bf94d3ed4a8be8e0a53b601a62a2e5bb5d36b7679307f9", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "27,19 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance5fcf6721d9685ed272343c37.initWidget("5fcf6721d9685ed272343c37"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }