var pmaWidgetInstance63fdffde421832890561e6b9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5015693bb515a607bfa943af519d78c2:cccc8a83312ab96bc048b1dcb256516d4b67e42bfb0b647d338d79c33acc9f0efb454298475f8cb99ee72b96bd2d18f757f5c4ac24b979ec489e3f582401f3bc359e3f6ea99c4782609bd600300d3fb2d2410b40b2457b3c4c2275cfb48614a451a0c7ce6f2df48fdceb2acc954412c18f4befdd3255613f594d3b7b2495489c2c23ba5f39ff2bf8a631b91a0679661400836a794d6228e389652ddba7d0615de9743b55b3060dbbedfe4f21e02f0e15b710bae71fa37015be901861583eaf1a7426a701ac810383986ce3b1848f188e", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "467,10 €", 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); } }