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