var pmaWidgetInstance603e2a12d9685ed2722c46ed = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7b78193b0f897203844fdf615617c983:d89a31f5d9bec96cccafc6820ca37cbb626d9dc0f2d4f6deee58147904b0487f08084631dc024d0d80686c144e49c0ed779fa049ed7846c1871c998e4f07261bec911c97c3c7fae8f950d1d289f18c5e797f1c9b8a2a22e250bc26550cc68fc64de58bf0682abbbc7f82e46db05af92488870f2df9edc5aadd652194b9e1bef71a7423af3f36ab630a50e12e1c796ef3817bc0fdc7e6384a3ea6eef67fd95d6ff97794e31afebc9eeafeafb193ff90a484a7cc0d591c6821c7581f50c1fa01ca", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "16,91 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance603e2a12d9685ed2722c46ed.initWidget("603e2a12d9685ed2722c46ed"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }