GRONO.doubleLoadPrevent("login");document.addEventListener("DOMContentLoaded",function(){var O,I,M,B,A;var N=GRONO.$("#popup_1");if(N){O=new GRONO.Overlay(N,{context:window,center:true})}var F=GRONO.$id("popup_3");if(F){I=new GRONO.Overlay(F,{context:window,center:true})}var P=GRONO.$id("popup_4");if(P){M=new GRONO.Overlay(P,{context:window,center:true})}var G=GRONO.$id("popup_pleasewait");if(G){B=new GRONO.Overlay(G,{context:window,center:true})}var H=GRONO.$id("popup_message");if(H){A=new GRONO.Overlay(H,{context:window,center:true})}var R=GRONO.$id("c-lost-password-email");var E=function(){if(O){O.hide()}if(I){I.hide()}if(M){M.hide()}return false};GRONO.$showLoginPopup=function(S){if(O&&O.isVisible){return }E();if(O){O.show()}var T=GRONO.$id("login_dest_id");if(T){T.value=S}};var J=function(U){E();A.show();var T='<span class="wrapper">OK'+GRONO.conf.buttonDecoration+"</span></button>";var S=GRONO.dom.builder.button({"class":"submit",type:"button"},"");S.innerHTML=T;GRONO.dom.replaceContent(GRONO.$id("popup_message_id"),GRONO.dom.builder.h1(U),S);S.addEventListener("click",function(){A.hide()},false)};var K=function(T){T.preventDefault();var S=R.value;I.hide();B.show();var U=new GRONO.Xhr("/pub/remind/");U.addEventListener("success",function(W){var V=setInterval(function(){if(!B.inProgress){B.hide();J(W);R.value="";clearInterval(V)}},50)});U.post({email:S})};var C=function(T){T.preventDefault();var S=GRONO.$id("lostinvit_email_id").value;M.hide();B.show();var U=new GRONO.Xhr("/pub/remind/");U.addEventListener("success",function(W){var V=setInterval(function(){if(!B.inProgress){B.hide();J(W);GRONO.$id("lostinvit_email_id").value="";clearInterval(V)}},50)});U.post({email:S})};document.matchAll("button.lost-password").forEach(function(S){S.addEventListener("click",function(){E();I.show();R.focus()},false)});if(!GRONO.local.isBabelFish&&false){var D=GRONO.$$("a, area"),L;D.forEach(function(S){if(L=S.getAttribute("href")){if(!/(^([a-z]+:|\/pub\/|\/find\/userpublic\/|\/users\/index|\.|\?|\/panel\/support|\/lang|#))|(^\/?$)/.test(GRONO.str.trim(L))){S.addEventListener("click",function(T){T.preventDefault();GRONO.$showLoginPopup(S.href)},false)}}});document.matchAll("button.notForAnonymous").forEach(function(S){S.addEventListener("click",function(T){T.preventDefault();GRONO.$showLoginPopup(S.href)},false)})}if(O){document.matchAll("div.login button.cancel").forEach(function(S){S.addEventListener("click",function(){O.hide()},false)})}if(F){document.matchSingle("div.lost-password form").addEventListener("submit",K,false);document.matchSingle("div.lost-password button.cancel").addEventListener("click",function(){I.hide()},false)}if(P){GRONO.$("#lostinvit_id").addEventListener("submit",C,false);P.matchSingle("button.cancel").addEventListener("click",function(){M.hide()},false);var Q=document.matchSingle("button.lost-invitation");if(Q){Q.addEventListener("click",function(){E();M.show()},false)}}},false);