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