var pmaWidgetInstance603f5248d9685ed272d6546f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=77ee51be0c382cee9fae59ca6ae05358:1e854f808d969722ab872ddccf5d1db3d8a5e6ee66982eb7d5d8e70a4494e36fb0a50632b891c625ded708f724f90a6ef43f39c6b5d5db34e3c0d4ef3200c6bee8e21f1ffaec8cf2ff6ba1d389ada7e46d657005144bbfbd468a8a60802c9c8afb8b3df94a5332af3526f3c58e169474cd4d2cf6c17b914fc5276e68e86d6aea79b0b3544275e041174a227a78a019d8c8c2e36b76109f5febde14ad0a6e6913d7efcca6229398fde69897075892294d5c53ff94ba9f59f31b8e1d0b7c408677e752ab9729f7ffd168ad5765406b102b", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "689,90 €", product_shipping: "", 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(){ pmaWidgetInstance603f5248d9685ed272d6546f.initWidget("603f5248d9685ed272d6546f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }