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