
function confirmDelete(anchor)
 {
    if (confirm('Are you sure you want to delete?'))
    {
      anchor.href += '&confirm=1';
      return true;
    }
    return false;
 }


//-----form validation and data validation-----

//check and validate the form fields
//in a sequence order from top to bottom.

function validate_signup_form()
{
 var signup_form = document.user_signup_form;

 if (signup_form.frm_first_name.value == "")
	{
		alert("* You must enter your first name.");
		signup_form.frm_first_name.focus();
		return false;
	}
	else
	{
		//test for any non digit characters in the first name
		var firstRegExp = /^(\D)*$/;
		if (!(firstRegExp.test(signup_form.frm_first_name.value)))
		{
			alert("invalid first name");
  			signup_form.frm_first_name.focus(); 
  			signup_form.frm_first_name.select();
  			return false; 
		}
	}
	
  			
	if (signup_form.frm_surname.value == "")
	{
		alert("* You must enter your surname.");
		signup_form.frm_surname.focus();
		return false;
	}
	else
    {
		//test for any non digit characters in the family name		
		var famRegExp = /^(\D)*$/;
		if (!(famRegExp.test(signup_form.frm_surname.value)))
		{
			alert("invalid surname.");
  			signup_form.frm_surname.focus(); 
  			signup_form.frm_surname.select();
  			return false; 
		}
	}
	
	
	if ((signup_form.frm_gender.value == "0")||(signup_form.frm_gender.value == ""))
	{
		alert("* You must select your gender.");
		signup_form.frm_gender.focus();
		return false;
	}
	

	if (signup_form.frm_birth_year.value == "0")
	{
		alert("* You must select your birth year.");
		signup_form.frm_birth_year.focus();
		return false;
	}
	
	
	if (signup_form.frm_country_living.value == "0")
	{
		alert("* You must select your living country.");
		signup_form.frm_country_living.focus();
		return false;
	}
	
	
	if (signup_form.frm_maritial_status.value == "0")
	{
		alert("* You must select your marital status.");
		signup_form.frm_maritial_status.focus();
		return false;
	}

	
  if (signup_form.frm_email.value == "")
	{
		signup_form.frm_email.focus();
		alert("* You must enter your email address.");
		return false;
	}
	else
	{
		//test for standard email format
		var emailRegExp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
 		if (!(emailRegExp.test(signup_form.frm_email.value)))
 		{
 			alert("invalid email address.");
  			signup_form.frm_email.focus(); 
  			signup_form.frm_email.select();
  			return false; 
  		}
	}
	
	
  if (signup_form.frm_password.value == "")
	{
		alert("* You must enter a password.");
		signup_form.frm_password.focus();
		return false;
	}		
	
  if (signup_form.frm_password_retype.value == "")
	{
		alert("* You must retype the password.");
		signup_form.frm_password_retype.focus();
		return false;
	}	
	else
	{
 		if (signup_form.frm_password_retype.value != signup_form.frm_password.value)
 		{
 			alert("* Retyped password doesn't match with the password.");
  			signup_form.frm_password_retype.focus(); 
  			signup_form.frm_password_retype.select();
  			return false; 
  		}
	}

	
	if (signup_form.frm_hear_us.value == "0")
	{
		alert("* You must select how did you hear us.");
		signup_form.frm_hear_us.focus();
		return false;
	}
	
	
	
}




function validate_update_form()
{
 var update_form = document.user_update_form;
 
 if (update_form.frm_first_name.value == "")
	{
		alert("* You must enter your first name.");
		update_form.frm_first_name.focus();
		return false;
	}
	else
	{
		//test for any non digit characters in the first name
		var firstRegExp = /[\@\.\-\+\*\~\&\?\,]/;
		if ((firstRegExp.test(update_form.frm_first_name.value)))
		{
			alert("invalid first name");
  			update_form.frm_first_name.focus(); 
  			update_form.frm_first_name.select();
  			return false; 
		}
	}
	
  			
	if (update_form.frm_surname.value == "")
	{
		alert("* You must enter your surname.");
		update_form.frm_surname.focus();
		return false;
	}
	else
	{
		//test for any non digit characters in the family name		
		var famRegExp = /[\@\.\-\+\*\~\&\?\,]/;
		if ((famRegExp.test(update_form.frm_surname.value)))
		{
			alert("invalid surname.");
  			update_form.frm_surname.focus(); 
  			update_form.frm_surname.select();
  			return false; 
		}
	}
	
	
	if ((update_form.frm_gender_id.value == "0")||(update_form.frm_gender_id.value == ""))
	{
		alert("* You must select your gender.");
		update_form.frm_gender_id.focus();
		return false;
	}
	
	
	if (update_form.frm_marital_status.value == "0")
	{
		alert("* You must select your marital status.");
		update_form.frm_marital_status.focus();
		return false;
	}

    if (update_form.frm_email.value == "")
	{
		update_form.frm_email.focus();
		alert("* You must enter your email address.");
		return false;
	}
	else
	{
		//test for standard email format
		var emailRegExp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
 		if (!(emailRegExp.test(update_form.frm_email.value)))
 		{
 			alert("invalid email address.");
  			update_form.frm_email.focus(); 
  			update_form.frm_email.select();
  			return false; 
  		}
	}
	
		
  if (update_form.frm_password.value == "")
	{
		alert("* You must enter a password.");
		update_form.frm_password.focus();
		return false;
	}	

}



function validate_email_form()
{
 var update_email = document.email_update_form;
  if (update_email.frm_new_email.value == "")
	{
		update_email.frm_new_email.focus();
		alert("* You must enter your email address.");
		return false;
	}
	else
	{
		//test for standard email format
		var emailRegExp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
 		if (!(emailRegExp.test(update_email.frm_new_email.value)))
 		{
 			alert("invalid email address.");
  			update_email.frm_new_email.focus(); 
  			update_email.frm_new_email.select();
  			return false; 
  	}
	}
 
}


function validate_reg_veri_form()
{
 var veri_form = document.reg_veri_form;
  if (veri_form.frm_temp_id.value == "")
	{
		veri_form.frm_temp_id.focus();
		alert("* You must enter the confirmation code.");
		return false;
	}
}


function validate_email_veri_form()
{
 var veri_form = document.email_veri_form;
  if (veri_form.frm_temp_id.value == "")
	{
		veri_form.frm_temp_id.focus();
		alert("* You must enter the verification code.");
		return false;
	}
}



function validate_password_form()
{
 var pass_form = document.password_update_form;
  if (pass_form.frm_password.value == "")
	{
		pass_form.frm_password.focus();
		alert("* You must enter a password.");
		return false;
	}
}



function validate_update_marit_form()
{
 var matriad_form = document.update_matriad_frm;


	if (matriad_form.frm_age.value == "0")
	{
		alert("* Please select the age.");
		matriad_form.frm_age.focus();
		return false;
	}


	if (matriad_form.frm_marital_status.value == "0")
	{
		alert("* Please select the marital status.");
		matriad_form.frm_marital_status.focus();
		return false;
	}
	
	
	if (matriad_form.frm_religion.value == "0")
	{
		alert("* Please select the religion.");
		matriad_form.frm_religion.focus();
		return false;
	}
	
	
	if (matriad_form.frm_living_country.value == "0")
	{
		alert("* Please select the living country.");
		matriad_form.frm_living_country.focus();
		return false;
	}
	
	
	if (matriad_form.frm_resident_status.value == "0")
	{
		alert("* Please select the resident status.");
		matriad_form.frm_resident_status.focus();
		return false;
	}
	
	if (matriad_form.frm_educa.value == "0")
	{
		alert("* Please select the education.");
		matriad_form.frm_educa.focus();
		return false;
	}
	
	if (matriad_form.frm_educa_in.value == "0")
	{
		alert("* Please select the education in.");
		matriad_form.frm_educa_in.focus();
		return false;
	}
	
	if (matriad_form.frm_occup.value == "0")
	{
		alert("* Please select the occupation.");
		matriad_form.frm_occup.focus();
		return false;
	}
	
	if ( !matriad_form.frm_bodytype[0].checked && !matriad_form.frm_bodytype[1].checked && !matriad_form.frm_bodytype[2].checked)
	{
		alert( "Please select the body type." );
		matriad_form.frm_bodytype[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_complexion[0].checked && !matriad_form.frm_complexion[1].checked && !matriad_form.frm_complexion[2].checked)
	{
		alert( "Please select the complexion." );
		matriad_form.frm_complexion[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_smoke[0].checked && !matriad_form.frm_smoke[1].checked && !matriad_form.frm_smoke[2].checked)
	{
		alert( "Please select an option from smoke." );
		matriad_form.frm_smoke[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_drink[0].checked && !matriad_form.frm_drink[1].checked && !matriad_form.frm_drink[2].checked)
	{
		alert( "Please select an option from drink." );
		matriad_form.frm_drink[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_diet[0].checked && !matriad_form.frm_diet[1].checked)
	{
		alert( "Please select an option from diet." );
		matriad_form.frm_diet[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_health[0].checked && !matriad_form.frm_health[1].checked && !matriad_form.frm_health[2].checked)
	{
		alert( "Please select an option from health." );
		matriad_form.frm_health[0].focus();
		return false;
	}
	
	
	if (matriad_form.frm_star.value == "0")
	{
		alert("* Please select an option from star.");
		matriad_form.frm_star.focus();
		return false;
	}
	
	if (matriad_form.frm_raasi.value == "0")
	{
		alert("* Please select an option from raasi.");
		matriad_form.frm_raasi.focus();
		return false;
	}
	
	if ( !matriad_form.frm_horoscope[0].checked && !matriad_form.frm_horoscope[1].checked)
	{
		alert( "Please select an option from horoscope match." );
		matriad_form.frm_horoscope[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_chevvai[0].checked && !matriad_form.frm_chevvai[1].checked && !matriad_form.frm_chevvai[2].checked)
	{
		alert( "Please select an option from chevvai at 7th house." );
		matriad_form.frm_chevvai[0].focus();
		return false;
	}
	
	if (matriad_form.frm_other_details.value == "")
	{
		alert("* Please tell few words about the bride/groom.");
		matriad_form.frm_other_details.focus();
		return false;
	}
	
	if (matriad_form.frm_age_from.value == "0")
	{
		alert("* Please select a minimum age from the preferred partner section.");
		matriad_form.frm_age_from.focus();
		return false;
	}
	
	if (matriad_form.frm_age_to.value == "0")
	{
		alert("* Please select a maximum age from the preferred partner section.");
		matriad_form.frm_age_to.focus();
		return false;
	}
	
	if (matriad_form.frm_height_from.value == "0")
	{
		alert("* Please select a minimum height from the preferred partner section.");
		matriad_form.frm_height_from.focus();
		return false;
	}
	
	if (matriad_form.frm_height_to.value == "0")
	{
		alert("* Please select a maximum height from the preferred partner section.");
		matriad_form.frm_height_to.focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_status[0].checked && !matriad_form.frm_p_status[1].checked)
	{
		alert( "Please select the marital status of the preferred partner." );
		matriad_form.frm_p_status[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_children[0].checked && !matriad_form.frm_p_children[1].checked && !matriad_form.frm_p_children[2].checked && !matriad_form.frm_p_children[3].checked)
	{
		alert( "Please select a children option in the preferred partner section." );
		matriad_form.frm_p_children[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_religion[0].checked && !matriad_form.frm_p_religion[1].checked)
	{
		alert( "Please select a religion option in the preferred partner section." );
		matriad_form.frm_p_religion[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_cast[0].checked && !matriad_form.frm_p_cast[1].checked && !matriad_form.frm_p_cast[2].checked)
	{
		alert( "Please select a cast option in the preferred partner section." );
		matriad_form.frm_p_cast[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_educa[0].checked && !matriad_form.frm_p_educa[1].checked && !matriad_form.frm_p_educa[2].checked && !matriad_form.frm_p_educa[3].checked)
	{
		alert( "Please select an education option in the preferred partner section." );
		matriad_form.frm_p_cast[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_bodytype[0].checked && !matriad_form.frm_p_bodytype[1].checked && !matriad_form.frm_p_bodytype[2].checked && !matriad_form.frm_p_bodytype[3].checked)
	{
		alert( "Please select an education option in the preferred partner section." );
		matriad_form.frm_p_bodytype[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_complexion[0].checked && !matriad_form.frm_p_complexion[1].checked && !matriad_form.frm_p_complexion[2].checked && !matriad_form.frm_p_complexion[3].checked)
	{
		alert( "Please select a complexion option in the preferred partner section." );
		matriad_form.frm_p_complexion[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_smoke[0].checked && !matriad_form.frm_p_smoke[1].checked && !matriad_form.frm_p_smoke[2].checked && !matriad_form.frm_p_smoke[3].checked)
	{
		alert( "Please select a smoke option in the preferred partner section." );
		matriad_form.frm_p_smoke[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_drink[0].checked && !matriad_form.frm_p_drink[1].checked && !matriad_form.frm_p_drink[2].checked && !matriad_form.frm_p_drink[3].checked)
	{
		alert( "Please select a drink option in the preferred partner section." );
		matriad_form.frm_p_drink[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_diet[0].checked && !matriad_form.frm_p_diet[1].checked && !matriad_form.frm_p_diet[2].checked)
	{
		alert( "Please select a diet option in the preferred partner section." );
		matriad_form.frm_p_diet[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_health[0].checked && !matriad_form.frm_p_health[1].checked && !matriad_form.frm_p_health[2].checked)
	{
		alert( "Please select a health option in the preferred partner section." );
		matriad_form.frm_p_health[0].focus();
		return false;
	}
	
	if (matriad_form.frm_preferences.value == "")
	{
		alert("* Please tell few words about the preferred partner.");
		matriad_form.frm_preferences.focus();
		return false;
	}
}



function validate_matriad_form()
{

 var matriad_form = document.matriad_frm;

 //if (matriad_form.frm_relationship.value == "0")
	//{
		//alert("* You must select your relationship.");
		//matriad_form.frm_relationship.focus();
		//return false;
	//}
	
	
	if (matriad_form.frm_age.value == "0")
	{
		alert("* Please select the age.");
		matriad_form.frm_age.focus();
		return false;
	}


	if (matriad_form.frm_marital_status.value == "0")
	{
		alert("* Please select the marital status.");
		matriad_form.frm_marital_status.focus();
		return false;
	}
	
	
	if (matriad_form.frm_religion.value == "0")
	{
		alert("* Please select the religion.");
		matriad_form.frm_religion.focus();
		return false;
	}
	
	
	if (matriad_form.frm_living_country.value == "0")
	{
		alert("* Please select the living country.");
		matriad_form.frm_living_country.focus();
		return false;
	}
	
	
	if (matriad_form.frm_resident_status.value == "0")
	{
		alert("* Please select the resident status.");
		matriad_form.frm_resident_status.focus();
		return false;
	}
	
	if (matriad_form.frm_educa.value == "0")
	{
		alert("* Please select the education.");
		matriad_form.frm_educa.focus();
		return false;
	}
	
	if (matriad_form.frm_educa_in.value == "0")
	{
		alert("* Please select the education in.");
		matriad_form.frm_educa_in.focus();
		return false;
	}
	
	if (matriad_form.frm_occup.value == "0")
	{
		alert("* Please select the occupation.");
		matriad_form.frm_occup.focus();
		return false;
	}
	
	if ( !matriad_form.frm_bodytype[0].checked && !matriad_form.frm_bodytype[1].checked && !matriad_form.frm_bodytype[2].checked)
	{
		alert( "Please select the body type." );
		matriad_form.frm_bodytype[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_complexion[0].checked && !matriad_form.frm_complexion[1].checked && !matriad_form.frm_complexion[2].checked)
	{
		alert( "Please select the complexion." );
		matriad_form.frm_complexion[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_smoke[0].checked && !matriad_form.frm_smoke[1].checked && !matriad_form.frm_smoke[2].checked)
	{
		alert( "Please select an option from smoke." );
		matriad_form.frm_smoke[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_drink[0].checked && !matriad_form.frm_drink[1].checked && !matriad_form.frm_drink[2].checked)
	{
		alert( "Please select an option from drink." );
		matriad_form.frm_drink[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_diet[0].checked && !matriad_form.frm_diet[1].checked)
	{
		alert( "Please select an option from diet." );
		matriad_form.frm_diet[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_health[0].checked && !matriad_form.frm_health[1].checked && !matriad_form.frm_health[2].checked)
	{
		alert( "Please select an option from health." );
		matriad_form.frm_health[0].focus();
		return false;
	}
	
	
	if (matriad_form.frm_star.value == "0")
	{
		alert("* Please select an option from star.");
		matriad_form.frm_star.focus();
		return false;
	}
	
	if (matriad_form.frm_raasi.value == "0")
	{
		alert("* Please select an option from raasi.");
		matriad_form.frm_raasi.focus();
		return false;
	}
	
	if ( !matriad_form.frm_horoscope[0].checked && !matriad_form.frm_horoscope[1].checked)
	{
		alert( "Please select an option from horoscope match." );
		matriad_form.frm_horoscope[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_chevvai[0].checked && !matriad_form.frm_chevvai[1].checked && !matriad_form.frm_chevvai[2].checked)
	{
		alert( "Please select an option from chevvai at 7th house." );
		matriad_form.frm_chevvai[0].focus();
		return false;
	}
	
	if (matriad_form.frm_other_details.value == "")
	{
		alert("* Please tell few words about the bride/groom.");
		matriad_form.frm_other_details.focus();
		return false;
	}
	
	if (matriad_form.frm_age_from.value == "0")
	{
		alert("* Please select a minimum age from the preferred partner section.");
		matriad_form.frm_age_from.focus();
		return false;
	}
	
	if (matriad_form.frm_age_to.value == "0")
	{
		alert("* Please select a maximum age from the preferred partner section.");
		matriad_form.frm_age_to.focus();
		return false;
	}
	
	if (matriad_form.frm_height_from.value == "0")
	{
		alert("* Please select a minimum height from the preferred partner section.");
		matriad_form.frm_height_from.focus();
		return false;
	}
	
	if (matriad_form.frm_height_to.value == "0")
	{
		alert("* Please select a maximum height from the preferred partner section.");
		matriad_form.frm_height_to.focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_status[0].checked && !matriad_form.frm_p_status[1].checked)
	{
		alert( "Please select the marital status of the preferred partner." );
		matriad_form.frm_p_status[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_children[0].checked && !matriad_form.frm_p_children[1].checked && !matriad_form.frm_p_children[2].checked && !matriad_form.frm_p_children[3].checked)
	{
		alert( "Please select a children option in the preferred partner section." );
		matriad_form.frm_p_children[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_religion[0].checked && !matriad_form.frm_p_religion[1].checked)
	{
		alert( "Please select a religion option in the preferred partner section." );
		matriad_form.frm_p_religion[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_cast[0].checked && !matriad_form.frm_p_cast[1].checked && !matriad_form.frm_p_cast[2].checked)
	{
		alert( "Please select a cast option in the preferred partner section." );
		matriad_form.frm_p_cast[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_educa[0].checked && !matriad_form.frm_p_educa[1].checked && !matriad_form.frm_p_educa[2].checked && !matriad_form.frm_p_educa[3].checked)
	{
		alert( "Please select an education option in the preferred partner section." );
		matriad_form.frm_p_cast[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_bodytype[0].checked && !matriad_form.frm_p_bodytype[1].checked && !matriad_form.frm_p_bodytype[2].checked && !matriad_form.frm_p_bodytype[3].checked)
	{
		alert( "Please select an education option in the preferred partner section." );
		matriad_form.frm_p_bodytype[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_complexion[0].checked && !matriad_form.frm_p_complexion[1].checked && !matriad_form.frm_p_complexion[2].checked && !matriad_form.frm_p_complexion[3].checked)
	{
		alert( "Please select a complexion option in the preferred partner section." );
		matriad_form.frm_p_complexion[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_smoke[0].checked && !matriad_form.frm_p_smoke[1].checked && !matriad_form.frm_p_smoke[2].checked && !matriad_form.frm_p_smoke[3].checked)
	{
		alert( "Please select a smoke option in the preferred partner section." );
		matriad_form.frm_p_smoke[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_drink[0].checked && !matriad_form.frm_p_drink[1].checked && !matriad_form.frm_p_drink[2].checked && !matriad_form.frm_p_drink[3].checked)
	{
		alert( "Please select a drink option in the preferred partner section." );
		matriad_form.frm_p_drink[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_diet[0].checked && !matriad_form.frm_p_diet[1].checked && !matriad_form.frm_p_diet[2].checked)
	{
		alert( "Please select a diet option in the preferred partner section." );
		matriad_form.frm_p_diet[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_health[0].checked && !matriad_form.frm_p_health[1].checked && !matriad_form.frm_p_health[2].checked)
	{
		alert( "Please select a health option in the preferred partner section." );
		matriad_form.frm_p_health[0].focus();
		return false;
	}
	
	if (matriad_form.frm_preferences.value == "")
	{
		alert("* Please tell few words about the preferred partner.");
		matriad_form.frm_preferences.focus();
		return false;
	}
	
}



function validate_matriad_myself_form()
{

 var matriad_form = document.matriad_frm;

 //if (matriad_form.frm_relationship.value == "0")
	//{
		//alert("* You must select your relationship.");
		//matriad_form.frm_relationship.focus();
		//return false;
	//}
	
	
	if (matriad_form.frm_age.value == "0")
	{
		alert("* Please select your age.");
		matriad_form.frm_age.focus();
		return false;
	}

	if (matriad_form.frm_height.value == "0")
	{
		alert("* YPlease select your height.");
		matriad_form.frm_height.focus();
		return false;
	}

	if (matriad_form.frm_marital_status.value == "0")
	{
		alert("* Please select your marital status.");
		matriad_form.frm_marital_status.focus();
		return false;
	}
	
	if ( !matriad_form.frm_children[0].checked && !matriad_form.frm_children[1].checked && !matriad_form.frm_children[2].checked)
	{
		alert( "Please select an option from children." );
		matriad_form.frm_children[0].focus();
		return false;
	}
	
	if (matriad_form.frm_religion.value == "0")
	{
		alert("* Please select your religion.");
		matriad_form.frm_religion.focus();
		return false;
	}
	
	
	if (matriad_form.frm_living_country.value == "0")
	{
		alert("* Please select your living country.");
		matriad_form.frm_living_country.focus();
		return false;
	}
	
	
	if (matriad_form.frm_resident_status.value == "0")
	{
		alert("* Please select your resident status in the living country.");
		matriad_form.frm_resident_status.focus();
		return false;
	}
	
	if (matriad_form.frm_educa.value == "0")
	{
		alert("* Please select your education.");
		matriad_form.frm_educa.focus();
		return false;
	}
	
	if (matriad_form.frm_educa_in.value == "0")
	{
		alert("* Please select your education in.");
		matriad_form.frm_educa_in.focus();
		return false;
	}
	

	if (matriad_form.frm_occup.value == "0")
	{
		alert("* Please select your occupation.");
		matriad_form.frm_occup.focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_bodytype[0].checked && !matriad_form.frm_bodytype[1].checked && !matriad_form.frm_bodytype[2].checked)
	{
		alert( "Please select your body type." );
		matriad_form.frm_bodytype[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_complexion[0].checked && !matriad_form.frm_complexion[1].checked && !matriad_form.frm_complexion[2].checked)
	{
		alert( "Please select your complexion." );
		matriad_form.frm_complexion[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_smoke[0].checked && !matriad_form.frm_smoke[1].checked && !matriad_form.frm_smoke[2].checked)
	{
		alert( "Please select an option from smoke." );
		matriad_form.frm_smoke[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_drink[0].checked && !matriad_form.frm_drink[1].checked && !matriad_form.frm_drink[2].checked)
	{
		alert( "Please select an option from drink." );
		matriad_form.frm_drink[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_diet[0].checked && !matriad_form.frm_diet[1].checked)
	{
		alert( "Please select an option from diet." );
		matriad_form.frm_diet[0].focus();
		return false;
	}
	
	
	if ( !matriad_form.frm_health[0].checked && !matriad_form.frm_health[1].checked && !matriad_form.frm_health[2].checked)
	{
		alert( "Please select an option from health." );
		matriad_form.frm_health[0].focus();
		return false;
	}
	
	
	if (matriad_form.frm_star.value == "0")
	{
		alert("* Please select an option from star.");
		matriad_form.frm_star.focus();
		return false;
	}
	
	if (matriad_form.frm_raasi.value == "0")
	{
		alert("* Please select an option from raasi.");
		matriad_form.frm_raasi.focus();
		return false;
	}
	
	if ( !matriad_form.frm_horoscope[0].checked && !matriad_form.frm_horoscope[1].checked)
	{
		alert( "Please select an option from horoscope match." );
		matriad_form.frm_horoscope[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_chevvai[0].checked && !matriad_form.frm_chevvai[1].checked && !matriad_form.frm_chevvai[2].checked)
	{
		alert( "Please select an option from chevvai at 7th house." );
		matriad_form.frm_chevvai[0].focus();
		return false;
	}
	
	if (matriad_form.frm_other_details.value == "")
	{
		alert("* Please tell few words about you.");
		matriad_form.frm_other_details.focus();
		return false;
	}
	
	if (matriad_form.frm_age_from.value == "0")
	{
		alert("* Please select a minimum age from the preferred partner section.");
		matriad_form.frm_age_from.focus();
		return false;
	}
	
	if (matriad_form.frm_age_to.value == "0")
	{
		alert("* Please select a maximum age from the preferred partner section.");
		matriad_form.frm_age_to.focus();
		return false;
	}
	
	if (matriad_form.frm_height_from.value == "0")
	{
		alert("* Please select a minimum height from the preferred partner section.");
		matriad_form.frm_height_from.focus();
		return false;
	}
	
	if (matriad_form.frm_height_to.value == "0")
	{
		alert("* Please select a maximum height from the preferred partner section.");
		matriad_form.frm_height_to.focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_status[0].checked && !matriad_form.frm_p_status[1].checked)
	{
		alert( "Please select the marital status of the preferred partner." );
		matriad_form.frm_p_status[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_children[0].checked && !matriad_form.frm_p_children[1].checked && !matriad_form.frm_p_children[2].checked && !matriad_form.frm_p_children[3].checked)
	{
		alert( "Please select a children option in the preferred partner section." );
		matriad_form.frm_p_children[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_religion[0].checked && !matriad_form.frm_p_religion[1].checked)
	{
		alert( "Please select a religion option in the preferred partner section." );
		matriad_form.frm_p_religion[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_cast[0].checked && !matriad_form.frm_p_cast[1].checked && !matriad_form.frm_p_cast[2].checked)
	{
		alert( "Please select a cast option in the preferred partner section." );
		matriad_form.frm_p_cast[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_educa[0].checked && !matriad_form.frm_p_educa[1].checked && !matriad_form.frm_p_educa[2].checked && !matriad_form.frm_p_educa[3].checked)
	{
		alert( "Please select an education option in the preferred partner section." );
		matriad_form.frm_p_cast[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_bodytype[0].checked && !matriad_form.frm_p_bodytype[1].checked && !matriad_form.frm_p_bodytype[2].checked && !matriad_form.frm_p_bodytype[3].checked)
	{
		alert( "Please select an education option in the preferred partner section." );
		matriad_form.frm_p_bodytype[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_complexion[0].checked && !matriad_form.frm_p_complexion[1].checked && !matriad_form.frm_p_complexion[2].checked && !matriad_form.frm_p_complexion[3].checked)
	{
		alert( "Please select a complexion option in the preferred partner section." );
		matriad_form.frm_p_complexion[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_smoke[0].checked && !matriad_form.frm_p_smoke[1].checked && !matriad_form.frm_p_smoke[2].checked && !matriad_form.frm_p_smoke[3].checked)
	{
		alert( "Please select a smoke option in the preferred partner section." );
		matriad_form.frm_p_smoke[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_drink[0].checked && !matriad_form.frm_p_drink[1].checked && !matriad_form.frm_p_drink[2].checked && !matriad_form.frm_p_drink[3].checked)
	{
		alert( "Please select a drink option in the preferred partner section." );
		matriad_form.frm_p_drink[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_diet[0].checked && !matriad_form.frm_p_diet[1].checked && !matriad_form.frm_p_diet[2].checked)
	{
		alert( "Please select a diet option in the preferred partner section." );
		matriad_form.frm_p_diet[0].focus();
		return false;
	}
	
	if ( !matriad_form.frm_p_health[0].checked && !matriad_form.frm_p_health[1].checked && !matriad_form.frm_p_health[2].checked)
	{
		alert( "Please select a health option in the preferred partner section." );
		matriad_form.frm_p_health[0].focus();
		return false;
	}
	
	if (matriad_form.frm_preferences.value == "")
	{
		alert("* Please tell few words about the preferred partner.");
		matriad_form.frm_preferences.focus();
		return false;
	}
	
}



function validate_matriad_relation_form()
{

 var matriad_form = document.matriad_frm;

 if (matriad_form.frm_relationship.value == "0")
	{
		alert("* You must select an option.");
		matriad_form.frm_relationship.focus();
		return false;
	}
	
}


function validate_add_photo_form()
{
 var addphoto_form = document.add_photo_frm;

 if (addphoto_form.title.value == "")
	{
        alert("* You must enter title.");
		addphoto_form.title.focus();
		return false;
	}
	
  if (addphoto_form.frm_spt.value == "0")
	{
		alert("* You must select an option from “show this photo to”.");
		addphoto_form.frm_spt.focus();
		return false;
	}
	
	
  if (addphoto_form.file.value == "")
	{
		alert("* You must upload a photo.");
		addphoto_form.file.focus();
		return false;
	}
}



function validate_add_matri_horos_form()
{
 var addphoto_form = document.add_horos_frm;

  if (addphoto_form.file.value == "")
	{
		alert("* You must browse an image.");
		addphoto_form.file.focus();
		return false;
	}
}


function validate_add_matri_photo_form()
{
 var addphoto_form = document.add_matri_photo_frm;

  if (addphoto_form.file.value == "")
	{
		alert("* You must browse an image.");
		addphoto_form.file.focus();
		return false;
	}
}


function validate_edit_photo_form()
{
 var editphoto_form = document.edit_photo_frm;

 if (editphoto_form.title.value == "")
	{
        alert("* You must enter title.");
		editphoto_form.title.focus();
		return false;
	}
	
  if (editphoto_form.frm_spt.value == "0")
	{
		alert("* You must select an option from “show this photo to”.");
		editphoto_form.frm_spt.focus();
		return false;
	}
}


function validate_search_form()
{
 var search_form = document.search_frm;

 if ((search_form.frm_search_name.value == "")&&(search_form.frm_search_town.value == "")&&(search_form.frm_birth_year.value == "0"))
	{
        alert("* Either one should be entered.");
		return false;
	}
}



//function validate_matri_gender_form()
//{
// var matri_gender_form = document.matri_gender_frm;

 //if (matri_gender_form.frm_gender.value == "")
//	{
  //      alert("* You must choose “Female” or “Male”.");
		//return false;
//	}
//}





//function validate_place_search_form()
//{
 //var place_search_form = document.place_search_frm;

 //if (place_search_form.frm_place_name.value == "")
	//{
     //   alert("* Place name should not be empty.");
	//	return false;
	//}
//}