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