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