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