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