	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 ResetValues( )
	{
		var Mm_registerform = this.document.Mm_registerform;
		Mm_registerform.txtname.value = "";
		Mm_registerform.txtgender.value = "";
		
		Mm_registerform.txtage.value = "";
		
		Mm_registerform.txtmaritalstatus.value = "";
		Mm_registerform.txteducation.value = "";
		Mm_registerform.txtreligion.value = "";
		Mm_registerform.txtmt.value = "";
		
		Mm_registerform.txtcaste.value = "";
		
		Mm_registerform.txtcomplexion.value = "";
		//Mm_registerform.txtfood.value = "";
		//Mm_registerform.EMAIL.value = "";
		//Mm_registerform.EMAILconfirm.value = "";
		//Mm_registerform.txtaddress.value = "";
		//Mm_registerform.txtphoneno.value = "";
		//Mm_registerform.txtcity.value = "";
		//Mm_registerform.txtstate.value = "";
		
		
		
		//Mm_registerform.txtseekingfor.value = "";
		//Mm_registerform.aboutyourself.value = "";
		//Mm_registerform.txtp.value = "";
		//Mm_registerform.txtcp.value = "";
		//Mm_registerform. txtregisterby.value = "";
		//Mm_registerform. txtrefer.value = "";
		//Mm_registerform.txtaccept.value = "";
		return true;
	}
	// Function to validate all the inputs
	function Validate(  )
	{
		var Mm_registerform = this.document.Mm_registerform;
		
// Check the Name field
		if ( Mm_registerform.txtname.value == "" )
		{
			alert( "Please enter your name." );
			Mm_registerform.txtname.focus( );
			return false;
		}
		// Check gender field
		if ( !Mm_registerform.txtgender[0].checked && !Mm_registerform.txtgender[1].checked)
		{
			alert( "Please select the gender." );
			Mm_registerform.txtgender[0].focus( );
			return false;
		}
	// Check the Age field		
if ( Mm_registerform.txtage.selectedIndex == 0 )
		{
			alert( "Please select the age." );	
			Mm_registerform.txtage.focus( );
			return false;
		}
	
		
		// Check marital status field
		if ( Mm_registerform.txtmaritalstatus.selectedIndex == 0 )
		{
			alert( "Please select marital status." );	
			Mm_registerform.txtmaritalstatus.focus( );
			return false;
		}
		
		// Check the Education field
		if ( Mm_registerform.txteducation.selectedIndex == 0 )
		{
			alert( "Please select the education status." );	
			Mm_registerform.txteducation.focus( );
			return false;
		}
		
		// Check religion field
		if ( Mm_registerform.txtreligion.selectedIndex == 0 )
		{
			alert( "Please select the religion." );	
			Mm_registerform.txtreligion.focus( );
			return false;
		}
		
// Check mother tonque field
		if ( Mm_registerform.txtmt.selectedIndex == 0 )
		{
			alert( "Please select the mother tonque." );	
			Mm_registerform.txtmt.focus( );
			return false;
		}
// Check caste field
		if ( Mm_registerform.txtcaste.selectedIndex == 0 )
		{
			alert( "Please select the caste." );	
			Mm_registerform.txtcaste.focus( );
			return false;
		}
		
		
		// Check the food habits field
		if ( Mm_registerform.txtfood.selectedIndex == 0 )
		{
			alert( "Please select your food habits." );	
			Mm_registerform.txtfood.focus( );
			return false;
		}
		
		// Check the Complexon field
		if ( Mm_registerform.txtcomplexion.selectedIndex == 0 )
		{
			alert( "Please select the complexion." );	
			Mm_registerform.txtcomplexion.focus( );
			return false;
		}
		
		
		return true;
	}
	
