var lingFORGOTPASS=new Object();lingFORGOTPASS.SHOW_FORM=0;lingFORGOTPASS.SHOW_SENDING=1;lingFORGOTPASS.SHOW_SENT=2;lingFORGOTPASS.displayLoginArea=function(A){switch(A){case lingFORGOTPASS.SHOW_FORM:showElement("tblForm");hideElement("divSent");hideElement("divSending");xGetElementById("txtEmail").focus();break;case lingFORGOTPASS.SHOW_SENDING:hideElement("tblForm");hideElement("divSent");showElement("divSending");break;case lingFORGOTPASS.SHOW_SENT:hideElement("tblForm");showElement("divSent");hideElement("divSending");break}};lingFORGOTPASS.doSendEmailCB=function(){var B=this.req.responseXML.documentElement;if(B.tagName=="SUCCESS"){lingFORGOTPASS.displayLoginArea(lingFORGOTPASS.SHOW_SENT)}else{if(B.tagName=="FAILURE"){var A=parseInt(B.getAttribute("code"));if(A==-1500){alert(lingRESOURCES.write("Common.emailNotFound","The specified email could not be found - please check the email address and try again!"))}lingFORGOTPASS.displayLoginArea(lingFORGOTPASS.SHOW_FORM);xGetElementById("txtEmail").focus()}}};lingFORGOTPASS.doSendEmail=function(){var C=xGetElementById("txtEmail").value;C=trim(C);var D=false;if(C.length>=5){var A=C.indexOf("@");if(A>0&&A<C.length-3){var B=C.lastIndexOf(".");if(B>A&&B<C.length-1){D=true;lingAPI.sendPassword(C,lingFORGOTPASS.doSendEmailCB)}}}if(!D){alert(lingRESOURCES.write("Common.badEmail",'"{0}" is not a valid email address!',false,[C]));xGetElementById("txtEmail").focus()}else{lingFORGOTPASS.displayLoginArea(lingFORGOTPASS.SHOW_SENDING)}};
