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