<!--
re = /\w{1,}/;


//-----------------
// trimming strings
//-----------------
function rtrim(str)
	{
	return str.replace( /\s*$/, "" );
	}
function trim(str)
	{
	return( (""+str).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') );
	}

var errmsg=""
var errno=0





/*----------------------------
  validating applicants login 
-----------------------------*/
function validateApplicantsLogin(form1)
	{
	errmsg=""
	errno=0

	errno+=validate5(form1.ap_applicantsCode)
	errno+=validate5(form1.ap_applicantsPassword)

	if (errno!=0)
		{
		alert("Please enter valid User Id (Application No) and Password")
		return false;
		}
	form1.submit();
	}


/*-----------------------------------
  validating authorized user's login 
------------------------------------*/
function validateAULogin(form1)
	{
	errmsg=""
	errno=0

	errno+=validate5(form1.us_userId)
	errno+=validate5(form1.us_userPassword)

	if (errno!=0)
		{
		alert("Please enter valid User Id  and Password")
		return false;
		}
	form1.submit();
	}

function validateChangeAUPassword(form1)
	{
	errmsg=""
	errno=0
	if (form1.us_userPasswordNew.value != form1.us_userPasswordConfirm.value)
		{
		alert("New password should match")
		return false;
		}

	errno+=validate5(form1.us_userPassword)
	errno+=validate5(form1.us_userPasswordNew)
	errno+=validate5(form1.us_userPasswordConfirm)
	
		

	if (errno!=0)
		{
		alert("Please check the required fields")
		return false;
		}
	form1.submit();
	}

function validateChangeAppPassword(form1)
	{
	errmsg=""
	errno=0
	if (form1.ap_applicantsPasswordNew.value != form1.ap_applicantsPasswordConfirm.value)
		{
		alert("New password should match")
		return false;
		}

	errno+=validate5(form1.ap_applicantsPassword)
	errno+=validate5(form1.ap_applicantsPasswordNew)
	errno+=validate5(form1.ap_applicantsPasswordConfirm)
	
		

	if (errno!=0)
		{
		alert("Please check the required fields")
		return false;
		}
	form1.submit();
	}

//-->


