SG_MsgRegEntSeqAnswer="";var aUserMsg=new Array();function FV_FormVal(oForm){var sTmp,oTmp,bOk=true;if(oForm.submitted)return false;oForm.alertuser=true;var oElems=oForm.elements;var nLen=oElems.length;for(var i=0;i<nLen;i++){oTmp=oElems[i];if(typeof(oTmp.valme)=="undefined")continue;bOk=oTmp.valme();if(!bOk)break}if(bOk){oForm.submitted=true;oForm.elements["xSubmit"].disabled=true}return bOk}function FV_FieldVal(oField){var bOk=true;var sFldName=oField.name;var oForm=oField.form;var sValue;var sType=sFldName.charAt(0).toLowerCase();switch(sType){case "s":switch(sFldName){case "sUsername":sValue=oField.value;bOk=(sValue.length>=nMinLenUsername&&sValue.length<=nMaxLenUsername);if(!bOk){if(oForm.alertuser){FV_ShowMessage(SG_MsgLogEntUserLen);oForm.alertuser=false;oField.focus()}break}bOk=(FV_StripCharsNotInBag(sValue,SG_sInUserAllow)==sValue);if(!bOk){if(oForm.alertuser){FV_ShowMessage(SG_MsgLogEntUserChars+"\n"+SG_sInUserAllow);oForm.alertuser=false;oField.focus()}}break;case "sPassword":sValue=oField.value;bOk=(sValue.length>=nMinLenPassword&&sValue.length<=nMaxLenPassword);if(!bOk){if(oForm.alertuser){FV_ShowMessage(SG_MsgLogEntPassLen);oForm.alertuser=false;oField.focus()}break}bOk=(FV_StripCharsNotInBag(sValue,SG_sInUserAllow)==sValue);if(!bOk){if(oForm.alertuser){FV_ShowMessage(SG_MsgLogEntPassChars+"\n"+SG_sInUserAllow);oForm.alertuser=false;oField.focus()}}break;case "sNewpass":sValue=oField.value;sValueOriginal=oField.form.elements["sPassword"].value;bOk=(sValue==sValueOriginal);if(!bOk){if(oForm.alertuser){FV_ShowMessage(SG_MsgPwdDifferent);oForm.alertuser=false;oField.focus()}break}break;default:bOk=!FV_IsBlank(oField.value);if(!bOk){if(oForm.alertuser){FV_ShowMessage(aUserMsg[sFldName]);oForm.alertuser=false;oField.focus()}break}}break;case "n":switch(sFldName){case "nDobday":case "nDobmonth":case "nDobyear":var oDay=oForm.elements["nDobday"];var oMonth=oForm.elements["nDobmonth"];var oYear=oForm.elements["nDobyear"];var sDay=FV_Trim(oDay.value);var sMonth=FV_Trim(oMonth.value);var sYear=FV_Trim(oYear.value);if(sDay==""||sYear==""){if(oForm.alertuser){bOk=false;FV_ShowMessage(sMsgRegEntDoB);oForm.alertuser=false;(sDay=="")?oDay.focus():oYear.focus();break}else{bOk=false;break}}bOk=FV_IsValidDate(sYear,sMonth,sDay,1);if(!bOk){if(oForm.alertuser){FV_ShowMessage(sMsgRegEntDoB);oForm.alertuser=false;oField.focus()}break}var bToYoung=false;var dToday=new Date();var dYearDiff=dToday.getFullYear()-parseInt(sYear);var dMonthDiff=(dToday.getMonth()+1)-parseInt(sMonth);var dDayDiff=dToday.getDate()-parseInt(sDay);if(dYearDiff<18){bToYoung=true}else{if(dYearDiff==18){if(dMonthDiff<0){bToYoung=true}else{if(dMonthDiff==0){if(dDayDiff<0)bToYoung=true}}}}bOk=!bToYoung;if(!bOk){if(oForm.alertuser){FV_ShowMessage(SG_sMsgEntTooYoung);oForm.alertuser=false;oField.focus()}break}break;default:bOk=(FV_IsFloat(oField.value)||FV_IsInteger(oField.value));if(!bOk){if(oForm.alertuser){FV_ShowMessage(aUserMsg[sFldName]);oForm.alertuser=false;oField.focus()}break}}break}return bOk}function SetupOnLoad(){FV_SetupForm("forgotpassform");aUserMsg["sAnswer"]=SG_MsgRegEntSeqAnswer}DomLoaded.load(SetupOnLoad);