var pmaWidgetInstance634fcd76ac365ae374642480 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f50893074d5dffed9036afa9b65a06d8:41b65d7615a2ba810eff72d3c25e417da92f9191ee534cdcb96fdb1e450ec82f5d9c895765cdfb2915a2a610dcf1b96550a8cd99a74af58e0579759dd852d34ec6417f4e99f7aefb7025257bde4d5b001e23f4c0f08cc8b38272f20702e9eebcc0e58184cdc83ae763d4d1df9fecf2f9566eaf48c10c76daac25042338474e4aff83a0cf5767c14ef6fad4e8d6cbdcf7bef357badc9a8746b67801145a4ad7a61ddcbc6cf200d60fc039fc47865bd364ef49ff49fe312ca7db66f068f5e722e1", shop_name: "boukal.sk", shop_logo: "https://y1.sk/t/s/130x50/5806.jpg", product_price: "569,22 €", product_shipping: "", 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(){ pmaWidgetInstance634fcd76ac365ae374642480.initWidget("634fcd76ac365ae374642480"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }