var pmaWidgetInstance6102b0760067a2ef59980704 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9f445842f972633114dd197b29ec00db:9e0d27dee5bd88ba0aa4169c4d40f720aad4f32087961667fff6c05e99a493ec931e201344036d2f53c7820400b4323c157db279643609e8ffc92d9aac24d4d7e44d9aaf1d9fd0cf907ca01a9d426bfb886174e6bb84f74605fa887932bb5c904bf998fe2ef4f21401919368dfbb6ad9e2b86b670acc3fdb61bf614a4548fd3bf240b83163536effac19abdefb48026a974f5bcf4df93928fd24847b506ee67d8419af310a33d44a10234cdf1add4a6479613c8decab02d60c86519c4610e18c2e5fecf714bf3f555ab865e95eb16a8c", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "730,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(){ pmaWidgetInstance6102b0760067a2ef59980704.initWidget("6102b0760067a2ef59980704"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }