//FUNCTION VALIDATE EMAIL ID
function ValidateEmail(Email)
	{
		var atCharPresent = false;
		var dotPresent = false;
		for ( var Idx = 0; Idx < Email.length; Idx++ )
	    {
		if ( Email.charAt ( Idx ) == '@' )
		atCharPresent = true;
			if ( Email.charAt ( Idx ) == '.' )
				dotPresent = true;
		}
		if ( !atCharPresent || !dotPresent )
			return false;
		return true;
	}





// FUNCTION VALIDATE ALL FIELDS
function Validate()
{

//TO CHECK USERID

	if (pass.mUID.value=="" || pass.mUID.value.length<6 || pass.mUID.value.length>10) 
	{
	alert( "Please enter the UserID. Minimum 6chrs Maximum 10chr" );
	pass.mUID.focus();
	return false;
	}
	
// Check E-mail 

	if ( pass.emailid.value == "" )
		{
			alert( "Please enter e-mail ID." );
			pass.emailid.focus( );
			return false;
		}
	else
		{
			if ( !ValidateEmail( pass.emailid.value ) )
			{
				alert( "Invalid E-mail " + pass.emailid.value );
				pass.emailid.focus( );
				return false;
			}
			for ( var Idx = 0; Idx < pass.emailid.value.length; Idx++ )
			{
				if ( pass.emailid.value.charAt(Idx) == '	' 
					|| pass.emailid.value.charAt(Idx) == ' '
					|| pass.emailid.value.charAt(Idx) == ','
					|| pass.emailid.value.charAt(Idx) == '/' 
					|| pass.emailid.value.charAt(Idx) == '\\' 
					|| pass.emailid.value.charAt(Idx) == ';' )
				{
					alert( "Blanks or other invalid characters are not allowed in the e-mail ID.\nPlease enter only one e-mail ID." );
					pass.emailid.focus( );
					return false;
				}
			}
		}


//------------------------------------------------------------------------------------------------------------ email - checking end here



}




