<!--
function ValidateNo( NumStr, String )
{
	for( var Idx = 0; Idx < NumStr.length; Idx ++ )
 	{
		var Char = NumStr.charAt( Idx );
		var Match = false;
		for( var Idx1 = 0; Idx1 < String.length; Idx1 ++)
		{
			 if( Char == String.charAt( Idx1 ) )
			 Match = true;
		}
		if ( !Match )
		return false;
	}
       	return true;
}


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 to validate all the inputs
function Validate()
{

	var myForm = this.document.frm_registration;

/* -----------------------------Check User Name ---------------------------- */	
	// Check user_name
	if ( myForm.user_name.value == "" )
	{
		alert( "Please enter the User Name." );
		myForm.user_name.focus( );
		return false;
	}
	
	for ( var Idx = 0; Idx < myForm.user_name.value.length; Idx++ )
	{
		if ( myForm.user_name.value.charAt(Idx) == '	'
			|| myForm.user_name.value.charAt(Idx) == ' '
			|| myForm.user_name.value.charAt(Idx) == ','
			|| myForm.user_name.value.charAt(Idx) == '/'
			|| myForm.user_name.value.charAt(Idx) == '\\'
			|| myForm.user_name.value.charAt(Idx) == ';' )
		{
			alert( "Invalid characters in the User Name." );
			myForm.user_name.focus( );
			return false;
		}
	}
	
/* -----------------------------Check Password ---------------------------- */
	// Check Password
	if ( myForm.password.value == "" )
	{
		alert( "Please choose 'password'." );
		myForm.password.focus( );
		return false;
	}
	
	//Check confirm_password
	if ( myForm.confirm_password.value == "" )
	{
		alert( "Please confirm password." );
		myForm.confirm_password.focus( );
		return false;
	}

	//Check if password and confirm_password match
	if ( myForm.password.value != myForm.confirm_password.value )
	{
		alert( "Password did not match." );
		myForm.password.value = "";
		myForm.confirm_password.value = "";

		myForm.password.focus( );

		return false;
	}

	tempPassword = myForm.password.value;

	goodPassword = 1;

	for( var idx=0; idx< tempPassword.length; idx++ )
	{
		ch = tempPassword.charAt(idx);

		if( !((ch>='a') && (ch<='z')) && !((ch>='A') && (ch<='Z')) && !((ch>=0) && (ch <=9)) )
		{
			goodPassword = 0;
			break;
		}
	}

	if( goodPassword ==0 )
	{
		alert( "Password should comprise only numbers and digits." );
		myForm.password.value="";
		myForm.confirm_password.value="";
		myForm.password.focus();
		return false;
	}
/* -----------------------------Check Member Name ---------------------------- */
	//Check member Name
	if( myForm.memebr_name.value == "" )
	{
		alert( "Please enter the Member Name." );
		myForm.memebr_name.focus( );
		return false;
	}	

/* -----------------------------Check First Name ---------------------------- 
	//Check First Name
	if( myForm.fname.value == "" )
	{
		alert( "Please enter the First Name." );
		myForm.fname.focus( );
		return false;
	}
*/

/* -----------------------------Check Last Name ---------------------------- 
	//Check Last Name
	if( myForm.lname.value == "" )
	{
		alert( "Please enter the Last Name." );
		myForm.lname.focus( );
		return false;
	}
*/

/* -----------------------------Check Email  ------------------------------------- */	
	// Check email
	if ( myForm.email.value == "" )
	{
		alert( "Please enter Email Address" );
		myForm.email.focus( );
		return false;
	}
	else
	{
		if ( !ValidateEmail( myForm.email.value ) )
		{
			alert( "Enter a valid Email address :- " + myForm.email.value );
			myForm.email.focus( );
			return false;
		}
		for ( var Idx = 0; Idx < myForm.email.value.length; Idx++ )
		{
			if ( myForm.email.value.charAt(Idx) == '	'
				|| myForm.email.value.charAt(Idx) == ' '
				|| myForm.email.value.charAt(Idx) == ','
				|| myForm.email.value.charAt(Idx) == '/'
				|| myForm.email.value.charAt(Idx) == '\\'
				|| myForm.email.value.charAt(Idx) == ';' )
			{
				alert( "Invalid characters in the Email Address" );
				myForm.email.focus( );
				return false;
			}
		}
	}	

/* ----------------------------------Check Age ------------------------------------ 
	//Check age is entered
	if (myForm.age.value=="")
	{
		alert("Please enter the Age!");
		myForm.age.focus();
		return false;
	}

	//Check if age is number
	if( !ValidateNo( myForm.age.value, "0123456789" ) )
	{
		alert("Age should be a number:- " + myForm.age.value);
		myForm.age.focus( );
		return false;
	}
*/

/* ---------------------Check phone ----------------------- 	
	//Check phone
	if( myForm.phone.value == "" )
	{
		alert( "Phone No is blank." );
		myForm.phone.focus( );
		return false;
	}
*/

/* ---------------------Check address ----------------------- 	
	//Check address
	if( myForm.address.value == "" )
	{
		alert( "Address is blank." );
		myForm.address.focus( );
		return false;
	}
*/
	
/* ---------------------Check City ----------------------- 	
	//Check city
	if( myForm.city.value == "" )
	{
		alert( "City is blank." );
		myForm.city.focus( );
		return false;
	}
*/

/* ---------------------Check State ----------------------- 	
	//Check state
	if( myForm.state.value == "" )
	{
		alert( "State is blank." );
		myForm.state.focus( );
		return false;
	}
*/

/* ---------------------Check zip ----------------------- 	
	//Check zip
	if( myForm.zip.value == "" )
	{
		alert( "Zip is blank." );
		myForm.zip.focus( );
		return false;
	}
*/

/* ---------------------Check photo ----------------------- 	
	//Check if uppic is enterd if the gender is female i.e. 'F'
	if (myForm.gender.value == "F")
	{
		if( myForm.uppic.value == "" )
		{
			alert( "Please select your photo" );
			myForm.uppic.focus( );
			return false;
		}
	}
*/
/* ---------------------Check about yourself ----------------------- 	
	//Check about
	if( myForm.about.value == "" )
	{
		alert( "Please tell us something about yourself" );
		myForm.about.focus( );
		return false;
	}
*/
/* ------------------------Check is_adult ---------------------------- 	
	//Check about
	if(!myForm.is_adult.checked)
	{
		alert( "You must be over age of 18 to signup!" );
		myForm.is_adult.focus( );
		return false;
	}
*/	
}
//-->