var pmaWidgetInstance60119ad0d9685ed272c9f6fd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=36696bd1edfb565d25732843df0c031a:05cbd86a00bac91a12565eb3d85ee74e7abb567aaa8f3dbd350eea541714e7a7701c6662deff090746a04fc8409afe4f2a041cb01840a23f9407fc1f520bd09fb9d856724d0ec3ae3d79be7e8ba8ff639d516ecefb450e59d8c935f2a0d74e0121e97169934e02651f42192caa6fc53e962ee564669f189565c4c14633e6533cf1623dc712d20725af8be3811b307a58ea7343f6340844362daf0ab7f89fa0b3fddbb55cb9e76b8a6d85163e5c6605d7f4e7fd6ecf1b27dd06eb3f5a485543f7", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "19,40 €", 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(){ pmaWidgetInstance60119ad0d9685ed272c9f6fd.initWidget("60119ad0d9685ed272c9f6fd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }