var pmaWidgetInstance603e33c2d9685ed27245d472 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=64c63aa916e1a1d117f3cdb321e8408b:e5d173c2677da3c338a7a5e8b3e9b4a9a398865b7e98a4d4ddb672646efe036010bb8c4d11bff34f07488397a7d15cc5b28ab95b831f1ac702de3ca2574abe554f41fa551ffbadd55c65eb329a1d21002a973476f8f258c8ffd1fd9581b8f3a3c9cc31ecacf42eda27de9e968abef7d95f5a4a18e916d51310ede5374adc5c16f790645b2dd33c52a1d7f998ea2045e173a40693fed5243b0f6944176dbe52cf6a1cb9ac0f649601cbff4aeefec5c278171ece116e8c3181649484bf253cd834", shop_name: "knihyprekazdeho.sk", shop_logo: "https://y1.sk/t/s/130x50/56613.jpg", product_price: "5,95 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance603e33c2d9685ed27245d472.initWidget("603e33c2d9685ed27245d472"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }