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