var pmaWidgetInstance63eb8ee94218328905a4116a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6fbc6619cec80155812e0c56ce0777f4:8f4f74a04fffe19f3ed713eaf0a52a33002ae723238e141cc6bf6a39e08876eab77d3e5bce466f270baabd4d80698fc39c5728c39349cc05813d30da56520f19c5768f87693c17c638b038bc8ae70b417b9a48923733b602eb4ef67af12a197a18c0da8fd7e4e4ae1924dba316da8f2d8d16a248cb9cafc8d1a086fd91bb41ad433f77963211cdb7ddd5aa1a2a7e86279d02fd33a89e06492fc1779f76d15f2e8e807a2c563a0d1a6438efed7f162f53338222e2520b93276d4a635060cf9e4ecac0d359ad0e8f3dc68a58df8a1ea43f", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "269,00 €", 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(){ pmaWidgetInstance63eb8ee94218328905a4116a.initWidget("63eb8ee94218328905a4116a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }