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