<!--
// Function to validate User Name
// Arguments   : 1. User : Value of the field containing User Name or String Constant.
// Return Value: true if valid, false otherwise.
// Note : 	Usernames will be used to create mail IDs. So, directory will also 
//		be created with the same name. So, validating for:
//		1.	No Spl character other than underscore.
//		2.	Should have more than 1 char and less than 16 char.
//		3.	No embeded space.

function isValidUserName(User)
{	
	m=new String(User);
	var userLength=m.length
	var isValid=0
	
	if(userLength<5 || userLength>15)
	{	return false;		
	}
	
	// Scanning the Username
	for(ctr=0;ctr<=userLength;ctr++)
	{	if (m.charAt(ctr)=='~')		{	isValid=1;	}	
		else if (m.charAt(ctr)=='`')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='!')	{	isValid=1;	}	
		else if (m.charAt(ctr)==' ') 	{	isValid=1;	}
		else if (m.charAt(ctr)=='@')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='#')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='$')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='%')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='^')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='&')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='*')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='(')	{	isValid=1;	}	
		else if (m.charAt(ctr)==')')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='-')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='+')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='=')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='|')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='\\')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='{')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='}')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='[')	{	isValid=1;	}	
		else if (m.charAt(ctr)==']')	{	isValid=1;	}	
		else if (m.charAt(ctr)==':')	{	isValid=1;	}	
		else if (m.charAt(ctr)==';')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='"')	{	isValid=1;	}	
		else if (m.charAt(ctr)=="'")	{	isValid=1;	}	
		else if (m.charAt(ctr)=='<')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='>')	{	isValid=1;	}	
		else if (m.charAt(ctr)==',')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='.')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='?')	{	isValid=1;	}	
		else if (m.charAt(ctr)=='/')	{	isValid=1;	}	

		if(isValid==1)
		{	return false;	}
	}
	return true;
}

//-->

