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