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