// JavaScript Document
function validate()
{ 
//**************************Name***********************/
if (document.registraion.Name.value=="")
	{
	alert("Enter Your Name");
	document.registraion.Name.focus();
	return false;
	}
//************************Surname***************************/
	 
if (document.registraion.Surname.value=="")
	{
	alert("Enter Your Surname");
	document.registraion.Surname.focus();
	return false;
	}
//************************FName***************************/
	 
if (document.registraion.FName.value=="")
	{
	alert("Enter Your Father Name");
	document.registraion.FName.focus();
	return false;
	}
 
// ***********************  User Id    **********************************
	if (document.registraion.userid.value=="")
	{
	alert("enter first userid ID");
	document.registraion.userid.focus();
	return false;
	}
		
	if (!document.registraion.userid.value.match(/^[A-Za-z0-9_]+$/))
	{
		alert("Don't use Special Charecter");
		document.registraion.userid.focus();
		return false;
	}
//************   E-mail  ************************************************
	if (document.registraion.email2.value=="")
	{
	alert("enter first email ID");
	document.registraion.email2.focus();
	return false;
	}
	
	var id=document.registraion.email2.value;
	if (id.indexOf("@")==-1 || id.indexOf(".")==-1)
	{
	alert("Plz Enter Valid email2 ID ");
	document.registraion.email2.focus();
	return false;
	}

// ***********************  password    **********************************
	if (document.registraion.password.value=="" )  
	{
	alert("Plz enter password ");
	document.registraion.password.focus();
	return false;
	}     
	var myString=document.registraion.password.value;
	if ( (myString.length<6) ||( myString.length>12))
	{
	alert("Plz enter password between 6-12 char");
	document.registraion.password.focus();
	return false;
	}     
// ***********************  Re- password    **********************************
	if (document.registraion.repass.value=="")
	{
	alert("enter first re-type password ");
	document.registraion.repass.focus();
	return false;
	} 

	if (document.registraion.password.value!=document.registraion.repass.value )
	{
	alert("Please Re-type password currect"); 
	document.registraion.repass.focus();
	return false;
	}
	if (document.registraion.Gender.value=="" )
	{
	alert("Please Select Gender"); 
	document.registraion.Gender.focus();
	return false;
	}
	if(document.registraion.seccode.value=="")
	{
		alert("Enter your security code, which is given below on image.");
		document.registraion.seccode.focus();
		return false;
	}
 
 if(document.registraion.accept.checked==false)
		{
			alert("Please checked the checkbox for agree to the jangrashaadi terms of use");
			document.registraion.accept.focus();
			return false;	
		}
	
}	
//**********************************************************************/

function validate2()
{ 
//**************************Postedby***********************/
if (document.registraion2.postedby.value=="")
	{
		alert("Select Profile Postedby");
		document.registraion2.postedby.focus();
		return false;
	}
//**************************Postedby***********************/
if (document.registraion2.MarStatus.value=="selected")
	{
		alert("Select Marital Status");
		document.registraion2.MarStatus.focus();
		return false;
	}	
 
 //**************************Postedby***********************/
if (document.registraion2.height.value=="selected")
	{
		alert("Select Height");
		document.registraion2.height.focus();
		return false;
	}	
 //**************************Postedby***********************/
if (document.registraion2.body_type.value=="selected")
	{
		alert("Select Body type");
		document.registraion2.body_type.focus();
		return false;
	}
 //**************************Postedby***********************/
if (document.registraion2.body_complexion.value=="selected")
	{
		alert("Select Complexion");
		document.registraion2.body_complexion.focus();
		return false;
	}
 //**************************Postedby***********************/
if (document.registraion2.specialcases.value=="")
	{
		alert("Select Special cases");
		document.registraion2.specialcases.focus();
		return false;
	}
	
 //**************************Postedby***********************/
if (document.registraion2.aboutmyself.value=="")
	{
		alert("Enter About Your Self");
		document.registraion2.aboutmyself.focus();
		return false;
	}	
  //**************************Postedby***********************/
if (document.registraion2.Manglik.value=="")
	{
		alert("Select Manglik");
		document.registraion2.Manglik.focus();
		return false;
	}
  if (document.registraion2.gotra.value=="")
	{
		alert("Enter Your Gotra");
		document.registraion2.gotra.focus();
		return false;
	}
	if (document.registraion2.Phone1.value=="")
	{
		alert("Enter Your Mobile Number");
		document.registraion2.Phone1.focus();
		return false;
	}
	if (isNaN(document.registraion2.Phone1.value))
	{
	alert("Enter Numeric Value Only.");
	document.registraion2.Phone1.focus();
	return false;
	}
var myStringm=document.registraion2.Phone1.value;
	if ( myStringm.length!=10)
	{
	alert("Enter Mobile 10 digit Number");
	document.registraion2.Phone1.focus();
	return false;
	}  

	

//************************Surname***************************/
}
function validate_step3()
{ 
//**************************Name***********************/
if (document.registraion3.unmarriedbro.value=="")
	{
	alert("Select Your Unmarried Number of Brothers");
	document.registraion3.unmarriedbro.focus();
	return false;
	}
if (document.registraion3.marriedbro.value=="")
	{
	alert("Select Your married Number of Brothers");
	document.registraion3.marriedbro.focus();
	return false;
	}	
if (document.registraion3.unmarriedsis.value=="")
	{
	alert("Select Your Unmarried Number of Sisters");
	document.registraion3.unmarriedsis.focus();
	return false;
	}
if (document.registraion3.marriedsis.value=="")
	{
	alert("Select Your married Number of Sisters");
	document.registraion3.marriedsis.focus();
	return false;
	}	
if (document.registraion3.g_mother.value=="")
	{
	alert("Enter Your Gotra (mother)");
	document.registraion3.g_mother.focus();
	return false;
	}	

if (document.registraion3.g_gmoth.value=="")
	{
	alert("Enter Your Gotra (Grand Mother)");
	document.registraion3.g_gmoth.focus();
	return false;
	}
if (document.registraion3.g_naani.value=="")
	{
	alert("Enter Your Gotra (Naani)");
	document.registraion3.g_naani.focus();
	return false;
	}	
if (document.registraion3.aboutpartner.value=="")
	{
	alert("Enter About Your Partner ");
	document.registraion3.aboutpartner.focus();
	return false;
	}
	
}

/***************** login*******************/

function member_vali()
{
	if(document.for_log.userid.value=="")
	{
	alert ("Enter Your Name");
	document.for_log.userid.focus();
	return false;
	}
	
	if(document.for_log.pass.value=="")
	{
	alert ("Please Enter Password ");
	document.for_log.pass.focus();
	return false;
	}
}
/*********************************************/
/***************** login*******************/

function member_lvali()
{
	if(document.for_log1.userid.value=="")
	{
	alert ("Enter Your Name");
	document.for_log1.userid.focus();
	return false;
	}
	
	if(document.for_log1.pass.value=="")
	{
	alert ("Please Enter Password ");
	document.for_log1.pass.focus();
	return false;
	}
}
/**********************send ******************/
function mess_validate()
{

	
	if(document.newad.Subject.value=="")
	{
		alert('Subject fiels can not be empty');
		document.newad.Subject.focus();
		return false;
	}
 	
}
/*****************************************/
function comp_idate()
{

	if(document.newad.ToFrndList.value=="")
	{
		alert('Please Enter the User Id');
		document.newad.ToFrndList.focus();
		return false;
	}
	if(document.newad.Subject.value=="")
	{
		alert('Subject fiels can not be empty');
		document.newad.Subject.focus();
		return false;
	}
}
/*********************contact us**********/

function contus(){
if(document.con_form.con_name.value=="")
{
	alert("Please Enter Your Name.");
	document.con_form.con_name.focus();
	return false;
}
if (!isEmailAddr(document.con_form.con_email.value))
  		{
			alert("Please enter a complete Email address in the form: yourname@yourdomain.com.");
			document.con_form.con_email.focus();
			return false;
		}
if (document.con_form.con_mobile.value=="")
	{
	alert("Enter First Mobile No");
	document.con_form.con_mobile.focus();
	return false;
	}

if (isNaN(document.con_form.con_mobile.value))
	{
	alert("Enter Numeric Value Only.");
	document.con_form.con_mobile.focus();
	return false;
	}
var myStringm=document.con_form.con_mobile.value;
	if ( myStringm.length!=10)
	{
	alert("Enter Mobile 10 digit Number");
	document.con_form.con_mobile.focus();
	return false;
	}  

 	 
}				

 function isEmailAddr(con_email)
	{
	  var result = false;
	  var theStr = new String(con_email);
	  var index = theStr.indexOf("@");
	  if (index > 0)
	  {
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1))
		result = true;
	  }
	  return result;
	}	 

/******************forget password********************/
function valiem(){
 if (document.fgpass.EmailId.value=="")
	{
	alert("Enter first Email Id ");
	document.fgpass.EmailId.focus();
	return false;
	} 
 
 }
/******************************************************/
function validate4(){
if (document.edit_pro.Phone1.value=="")
	{
		alert("Enter Your Mobile Number");
		document.edit_pro.Phone1.focus();
		return false;
	}
	if (isNaN(document.edit_pro.Phone1.value))
	{
	alert("Enter Numeric Value Only.");
	document.edit_pro.Phone1.focus();
	return false;
	}
var myStringm=document.edit_pro.Phone1.value;
	if ( myStringm.length!=10)
	{
	alert("Enter Mobile 10 digit Number");
	document.edit_pro.Phone1.focus();
	return false;
	}  
}
function chpass_fu()
   {
   if (document.chpass.currentpassword.value=="")
	{
	alert("Please Enter Current Password");
	document.chpass.currentpassword.focus();
	return false;
	}
	
	if (document.chpass.newpassword.value=="" )  
	{
	alert("Please Enter Password ");
	document.chpass.newpassword.focus();
	return false;
	}     
	     
// ***********************  Re- password    **********************************
	if (document.chpass.re_typepassword.value=="")
	{
	alert("Enter First Re-Type Password ");
	document.chpass.re_typepassword.focus();
	return false;
	} 

	if (document.chpass.newpassword.value!=document.chpass.re_typepassword.value )
	{
	alert("Please Re-Type Password Currect"); 
	document.chpass.re_typepassword.focus();
	return false;
	}

}
