function log_chk(theform){

if (document.login.rid.value== "") {
       alert("Please type your valid Email Id");
      document.login.rid.focus();
       return false;
     }
else if (document.login.pwd.value == "") {
        alert("Please type your Password");
        document.login.pwd.focus();
		 return false;
		 }
	 else {

          if (document.login.rid.value != "")
			  
		  {
         var MailId = document.login.rid;
         var Attu = MailId.value.indexOf("@");
         var Pottu = MailId.value.lastIndexOf(".");
         var Gaali = MailId.value.indexOf(" ");
         if ((Attu < 1) ||  ((Gaali > -1) && (Gaali < MailId.value.length-1)) ||
	         (Pottu <= Attu+1) || (Pottu == MailId.value.length-1)) 
			 
		    {
	         alert("Please type your valid Email Id");
			 return false;
			 }
			else
			 document.login.submit();
         }

		  }

		  }

		  function nsearch(){
		     document.quick.submit();
		  }
		  function search(){
		     document.ps.submit();
		  }
           function label()
		   {
			   location.href="profile/madvSearch.php";
		   }
		   function label1()
		   {
			   location.href="profile/special.php";
		   }
		   function label2()
		   {
			   location.href="profile/professional.php";
		   }
		   function laksh()
		   {
               alert("Hai, How are you?");
           }

     function checkEnter(e){ //e is event object passed from function invocation
   var characterCode //literal character code will be stored in this variable

if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}

if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
if (document.login.rid.value== "") {
       alert("Please type your valid Email Id");
      document.login.rid.focus();
       return false;
     }
else if (document.login.pwd.value == "") {
        alert("Please type your Password");
        document.login.pwd.focus();
		 return false;
		 }


else {

          if (document.login.rid.value != ""){
         var MailId = document.login.rid;
         var Attu = MailId.value.indexOf("@");
         var Pottu = MailId.value.lastIndexOf(".");
         var Gaali = MailId.value.indexOf(" ");
         if ((Attu < 1) ||  ((Gaali > -1) && (Gaali < MailId.value.length-1)) ||
	         (Pottu <= Attu+1) || (Pottu == MailId.value.length-1))
			 {
	         alert("Please type your valid Email Id");
			 return false;
			 }
			else
			 document.login.submit();
         }
}


return false 
}
else{
return true 
}

}

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll
win = window.open(mypage,myname,settings)
}

 function label()
		   {
			   location.href="madvSearch.php";
		   }
		   function label1()
		   {
			   location.href="special.php";
		   }
		   function label2()
		   {
			   location.href="professional.php";
		   }
		   function invis()
		 {
			 document.ps.uid.value="";
		 }
          function maximum(value)
		  {
			 var max=document.quick.toage.value;
		     var min=document.quick.fromage.value;
			 var sex=document.quick.sex.value;
              
			  if(sex=="")
	         {
				alert("Please select the gender");
				document.quick.sex.focus();
				return false;
	         }
			  if(min>=max)
			  {
				 alert("please select the age greater than From");
				 document.quick.toage.focus();
				 return false;
              }
		  }		 
              
function search(){
	if(document.ps.uid.value=="Enter Profile ID")
	{
		alert("Please enter the Profile id");
		document.ps.uid.value="";
		document.ps.uid.focus();
		return false;
	}
	else if(document.ps.uid.value==" ")
	{
		alert("Please enter the Profile id");
		document.ps.uid.value="";
		document.ps.uid.focus();
		return false;
	}
	else
		     document.ps.submit();
		  }

//Age validation for maximum and minimum
function validation()
		 {



			  myOption = -1;
				for (i=document.advance.chevdosham.length-1; i > -1; i--) 
			   {
					if (document.advance.chevdosham[i].checked) 
						{
							myOption = i;
							i = -1;
						}
			   }
					if (myOption == -1) 
					{
					alert("You must select type of chevodasam");
					return false;
					}

             myOption1 = -1;
				for (i=document.advance.sex.length-1; i > -1; i--) 
			   {
					if (document.advance.sex[i].checked) 
						{
							myOption1 = i;
							i = -1;
						}
			   }
					if (myOption1 == -1) 
					{
					alert("You must select the Gender");
					return false;
					}

				
             myOption = -1;
				for (i=document.advance.foodhabit.length-1; i > -1; i--) 
			   {
					if (document.advance.foodhabit[i].checked) 
						{
							myOption = i;
							i = -1;
						}
			   }
					if (myOption == -1) 
					{
					alert("You must select a Food habbit");
					return false;
					}
              var min=document.advance.fage.value;
              var max=document.advance.tage.value;
			   var from=document.advance.fheight.value;
			    var to=document.advance.theight.value;
			  			
                  if(min>max)
			 {
					  alert ("Please enter the values in Appropriate Order  in Age [For example 18 to 25]");
                              return false;
			 }
                 if(from>to)
			 {
                      alert ("Please enter the values in Appropriate Order in Height [For example 4ft - 121cm to 7ft - 213]");
					  return false;
             }


	 }

function save()
{
myOption = -1;
				for (i=document.advance.chevdosham.length-1; i > -1; i--) 
			   {
					if (document.advance.chevdosham[i].checked) 
						{
							myOption = i;
							i = -1;
						}
			   }
					if (myOption == -1) 
					{
					alert("You must select type of chevodasam");
					return false;
					}
				
             myOption = -1;
				for (i=document.advance.foodhabit.length-1; i > -1; i--) 
			   {
					if (document.advance.foodhabit[i].checked) 
						{
							myOption = i;
							i = -1;
						}
			   }
			    myOption1 = -1;
				for (i=document.advance.sex.length-1; i > -1; i--) 
			   {
					if (document.advance.sex[i].checked) 
						{
							myOption1 = i;
							i = -1;
						}
			   }
					if (myOption1 == -1) 
					{
					alert("You must select the Gender");
					return false;
					}
					if (myOption == -1) 
					{
					alert("You must select a Food habbit");
					return false;
					}
              var min=document.advance.fage.value;
              var max=document.advance.tage.value;
			   var from=document.advance.fheight.value;
			    var to=document.advance.theight.value;
			  			
                  if(min>max)
			 {
					  alert ("Please enter the values in Appropriate Order  in Age [For example 18 to 25]");
                              return false;
			 }
                 if(from>to)
			 {
                      alert ("Please enter the values in Appropriate Order in Height [For example 4ft - 121cm to 7ft - 213]");
					  return false;
             }


	
}


function saver()
{
	myOption = -1;
				for (i=document.advance.chevdosham.length-1; i > -1; i--) 
			   {
					if (document.advance.chevdosham[i].checked) 
						{
							myOption = i;
							i = -1;
						}
			   }
					if (myOption == -1) 
					{
					alert("You must select type of chevodasam");
					return false;
					}
				
             myOption = -1;
				for (i=document.advance.foodhabit.length-1; i > -1; i--) 
			   {
					if (document.advance.foodhabit[i].checked) 
						{
							myOption = i;
							i = -1;
						}
			   }
					if (myOption == -1) 
					{
					alert("You must select a Food habbit");
					return false;
					}
              var min=document.advance.fage.value;
              var max=document.advance.tage.value;
			   var from=document.advance.fheight.value;
			    var to=document.advance.theight.value;
			  			
                  if(min>max)
			 {
					  alert ("Please enter the values in Appropriate Order  in Age [For example 18 to 25]");
                              return false;
			 }
                 if(from>to)
			 {
                      alert ("Please enter the values in Appropriate Order in Height [For example 4ft - 121cm to 7ft - 213]");
					  return false;
             }

    var text1=document.advance.textsave.value;
	if(text1=="")
	{
	alert("Please enter the Name to Save the Search");	
	document.advance.textsave.focus();
	return false;	
	}
}

function check1()
{    
	
	document.spec.mstatus.disabled=false;
}
function check()
{
	 
	document.spec.mstatus.disabled=true;
}

function check3()
{    
	
	document.spec.spcauses.disabled=false;
}
function check4()
{
	  
	document.spec.spcauses.disabled=true;
}
function prof()
		 {
			
              var min=document.spec.fage.value;
              var max=document.spec.tage.value;
			 if(min>max)
			 {
					  alert ("Please enter the values in Appropriate Order  in Age [For example 18 to 25]");
                              return false;
			 }
			 var pro=document.spec.profess.value;
			 if(pro=="select")
			 {
                 alert("Please Select Desired Profession of your partner that you looking for");
				 return false;
             }
                
	 }
//Photo upload
			  function alls()
				{
                     var i=1;
					 var r=3;
					  var t=2;
					  var first= document.image.file1.value;
					  var second= document.image.file2.value;
					  var third= document.image.file3.value;
					    if((first=="")&&(second=="")&&(third==""))
					{
                          alert("Please select atleast one file");
						  return false;
					}  
					if((first=="")&&(second!=""))
					{
                          alert("Please select in the first file");
						  return false;
					}
					if((first=="")&&(third!=""))
					{
                          alert("Please select in the first file");
						  return false;
					}
             myOption = -1;
				for (i=document.image.viewphoto.length-1; i > -1; i--) 
			   {
					
					if (document.image.viewphoto[i].checked) 
						{
							myOption = i;
							i = -1;
						}
			   }
					if (myOption == -1) 
					{
					alert("You must any one of the option");
					return false;
					}
		
					
			}


//Blinking
function blinking_header()
{
if (!document.getElementById('blink').style.color)
	{
	document.getElementById('blink').style.color="red"
	}
if (document.getElementById('blink').style.color=="red")
	{
	document.getElementById('blink').style.color="black"
	}
else
	{
	document.getElementById('blink').style.color="red"
	}
timer=setTimeout("blinking_header()",100)
}
function stoptimer()
{
clearTimeout(timer)
}

 // form validation for basic info

function save_bas(pm) {
     var remove=/[^a-zA-Z]/
     var t=document.basic.pname.value;
     if(t.match(remove))
	{
					alert("Please Enter Valid Profilename");
					return false;
    }
          var len=document.basic.pass.value;
		 var length=len.length;
             myOption = -1;
				for (i=document.basic.gen.length-1; i > -1; i--) 
			   {
					if (document.basic.gen[i].checked) 
						{
							myOption = i;
							i = -1;
						}
			   }
					if (myOption == -1) 
					{
					alert("You must select a gender");
					return false;
					}

       if (document.basic.pcreater.value == "Select") {
           alert("Please Enter Profile Creater Name ");
           document.basic.pcreater.focus();
		   return false;
	       }
	  else if (document.basic.pname.value == "") {
           alert("Please Enter Profile Name");
           document.basic.pname.focus();
		    return false;
	     }

     
    else if (document.basic.dobday.value == "DD") {
           alert("Please Select your Date of Birth");
           document.basic.dobday.focus();
		   return false;
		 }
     else if (document.basic.dobmon.value == "MM") {
          alert("Please Select your Month of Birth");
          document.basic.dobmon.focus();
		  return false;
		 }
     else if (document.basic.dobyr.value == "YY") {
         alert("Please Select your Year of Birth");
         document.basic.dobyr.focus();
		 return false;
		 }
     else if (document.basic.religion.value == "Select") {
        alert("Please Enter your Religion");
        document.basic.religion.focus();
		 return false;
		 }
	else if (document.basic.country.value == "Select") {
          alert("Please Select your Country");
         document.basic.country.focus();
		 return false;
		 }
     else if (document.basic.pemail.value == "") {
         alert("Please Enter your Valid Email");
         document.basic.pemail.focus();
		 return false;
          }
   else if (document.basic.pass.value == "") {
        alert("Please Enter your Password");
        document.basic.pass.focus();
		 return false;
		 }

     else  if(length<4)
	{
          alert("Password should be minimum four characters");
		  return false;
	}


   else if (document.basic.rpass.value == "") {
         alert("Please Enter Confirm Password");
         document.basic.rpass.focus();
		 return false;
		 }
 else if (document.basic.pass.value != document.basic.rpass.value) {
        alert("Please type the password correctly");
         document.basic.rpass.focus();
		 return false;
		 }

		 else {

          if (document.basic.pemail.value != ""){
         var MailId = document.basic.pemail;
         var Attu = MailId.value.indexOf("@");
         var Pottu = MailId.value.lastIndexOf(".");
         var Gaali = MailId.value.indexOf(" ");
         if ((Attu < 1) ||  ((Gaali > -1) && (Gaali < MailId.value.length-1)) ||
	         (Pottu <= Attu+1) || (Pottu == MailId.value.length-1)) {
	         alert("Please Enter Your Valid E-mail id");
			 return false;
			 }
			else
			  return true;
         }

		  }

		  }

//Validation for career
function save_car(theform) {
var abc =document.career.occup.value;
   if (document.career.educaty.value == "Select") {
        alert("Please select education category");
        document.career.educaty.focus();
		 return false;
		  }
  else if (document.career.educaty.value == "Others" && document.career.educaty1.value == "") {
		  alert("please type your education category");
		  document.career.educaty1.focus();
		  return false;
		  }
  else if (document.career.occup.value == "Select") {
		  alert("please enter your occupation");
		  document.career.occup.focus();
		  return false;
		  }
   else if (document.career.occup.value == "Others" && document.career.occup1.value == "") {
		  alert("please type your occupation");
		  document.career.occup1.focus();
		  return false;
		  }

     if(abc!="Not Working")
		{
         if (document.career.annincome.value == "Select") {
         alert("Please enter annual income");
         document.career.annincome.focus();
		 return false;
	 }
		 else if (document.career.working_in_state.value == "Select") {
     alert("Please Enter Working In");
     document.career.working_in_state.focus();
		 return false;
		 }
   
       }
         		  }

//if it is not working it won't validate salary
function formhandlerc(career)
{
	var abc =document.career.occup.value;
	if(abc=="Not Working")
	{
		document.career.annincome.disabled=true;
		document.career.working_in.readOnly=true;
		document.career.working_in_state.disabled=true;
		document.career.mincome_detail.readOnly=true;
		document.career.workstate.disabled=true;
	}
	if(abc!="Not Working")
	{
		document.career.annincome.disabled=false;
		document.career.working_in.readOnly=false;
		document.career.working_in_state.disabled=false;
		document.career.mincome_detail.readOnly=false;
		document.career.workstate.disabled=false;
	}

	if(abc=="Others")
	{
		document.career.occup1.readOnly=false;
	}
	if(abc!="Others")
	{
		document.career.occup1.readOnly=true;
	}
}
function abcd(career)
{
	if(document.career.educaty.value=="Others")
	{
		document.career.educaty1.readOnly=false;
	}
	if(document.career.educaty.value!="Others")
	{
		document.career.educaty1.readOnly=true;
	}

}


 // form validation for personal
 //special charachter validation
function save_per(theform)
	
{
var remove=/[^~`|^]/;//unwanted symbol validation
  var remove1=/[^a-zA-Z.]/
         var nam=document.personal.name.value;
          
var t=document.personal.contadd.value;
var s=document.personal.permadd.value;
if (document.personal.name.value== "") {
alert("Please Enter your Name");
document.personal.name.focus();
   return false;
   }
       if(nam.match(remove1))
	{
					alert("Please Enter Valid name. Special characters are not allowed");
						return false;
    }

   else if (document.personal.mstatus.value== "Select") {
alert("Please Enter Your Maritial Status");
document.personal.mstatus.focus();
   return false;
   }
else if (document.personal.citizenship.value== "Select") {
alert("Please Enter Your Citizenship");
document.personal.citizenship.focus();
   return false;
   }
else if (document.personal.contadd.value=="") {
alert("Please Enter Your Contact Address");
document.personal.contadd.focus();
    return false;
    }
        
            else if(!t.match(remove))
	{
					alert("Please Enter Valid Contact Address")
						return false;
    }


else if (document.personal.permadd.value=="") {
alert("Please Enter Your Permanent Address");
document.personal.permadd.focus();
    return false;
    }
	    else if(!s.match(remove))
	{
					alert("Please Enter Valid Permanent Address")
						return false;
    }

else if (document.personal.contphone.value=="") {
alert("Please Enter Your Phone number");
document.personal.contphone.focus();
    return false;
    }
//phone number validation
     if (document.personal.contphone.value!="")
	 {

           var digits = "0123456789";
			var phoneNumberDelimiters = "()- ";
			var validWorldPhoneChars = phoneNumberDelimiters + "+";
			var minDigitsInIPhoneNumber = 10;

			function isInteger(s)
			{   var i;
				for (i = 0; i < s.length; i++)
				{   
					// Check that current character is number.
					var c = s.charAt(i);
					if (((c < "0") || (c > "9"))) return false;
				}
				// All characters are numbers.
				return true;
			}

			function stripCharsInBag(s, bag)
			{   var i;
				var returnString = "";
				// Search through string's characters one by one.
				// If character is not in bag, append to returnString.
				for (i = 0; i < s.length; i++)
				{   
					// Check that current character isn't whitespace.
					var c = s.charAt(i);
					if (bag.indexOf(c) == -1) returnString += c;
				}
				return returnString;
				//alert("lllllllll".returnString);
			}

				function checkInternationalPhone(strPhone)
				{
					s=stripCharsInBag(strPhone,validWorldPhoneChars);
					return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
				}

	var Phone=document.personal.contphone
	
	if ((Phone.value==null)||(Phone.value=="")){
		alert("Please Enter Your Phone Number")
		Phone.focus()
		return false
	}
	if (checkInternationalPhone(Phone.value)==false){
		alert("Please Enter a Valid Phone Number")
		Phone.value=""
		Phone.focus()
		return false
	}
	 }
	
 if (document.personal.myself.value=="") {
alert("Please enter few words About Yourself");
document.personal.myself.focus();
    return false;
    }
   else {
   document.personal.submit();
   }
  }

function formHandler(personal){
var abc = document.personal.mstatus.value;

if(abc!="never married")
{
	 document.personal.childrens[1].checked=true;
     document.personal.childrens[0].disabled=false;
     document.personal.childrens[1].disabled=false;
     document.personal.nochild.disabled=false;
	 document.personal.Childstatus[0].disabled=false;
     document.personal.Childstatus[1].disabled=false;
}
if(abc=="never married")
{
	 document.personal.childrens[0].checked=true;
     document.personal.childrens[0].disabled=true;
     document.personal.childrens[1].disabled=true;
     document.personal.nochild.disabled=true;
	 document.personal.Childstatus[0].disabled=true;
     document.personal.Childstatus[1].disabled=true;
  }



}

//to enable and disanable child 
function formHandler1(personal){
         

        document.personal.nochild.disabled=true;
	    document.personal.Childstatus[0].disabled=true;
        document.personal.Childstatus[1].disabled=true;
}
function formHandler2(personal){

        document.personal.nochild.disabled=false;
	    document.personal.Childstatus[0].disabled=false;
        document.personal.Childstatus[1].disabled=false;
}
//to control 150 words
function maximumm()
		{
              var g=document.personal.myself.value.length;
			  if(g>150)
			{
				   				document.personal.next.focus();
			}
		}

function checks()
{
if (document.forgot.pwd.value== "") {
       alert("Please enter old password");
      document.forgot.pwd.focus();
       return false;
     }

if (document.forgot.pass.value== "") {
       alert("Please enter your password");
      document.forgot.pass.focus();
       return false;
     }
	 if (document.forgot.cpass.value== "") {
       alert("Please enter your Confirm password");
      document.forgot.cpass.focus();
       return false;
     }
	 if(document.forgot.cpass.value.length<4)
	{
          alert("Password should be minimum four characters");
		        document.forgot.cpass.focus();

		  return false;
	}
	 if (document.forgot.pass.value!=document.forgot.cpass.value) {
       alert("Missmatch Password");
	   document.forgot.cpass.value="";
      document.forgot.cpass.focus();
       return false;
     }
	 
		
}
function cheque(pm) {

			    if(document.login.number.value=="")
					{
					alert("You must enter a Check number");
					document.login.number.focus();
					return false;
					}
				if(document.login.bank_name.value=="")
					{
					alert("You must enter a Bank Name");
					document.login.bank_name.focus();
					return false;
					}	
				if(document.login.Branch_name.value=="")
					{
					alert("You must enter a Branch Name");
					document.login.Branch_name.focus();
					return false;
					}	
				if(document.login.amount.value=="")
					{
					alert("You must enter a Amount");
					document.login.amount.focus();
					return false;
					}				
		
				var removes=/[^a-zA-Z](^\s*|\s*$)/
                var t=document.login.Branch_name.value;
				if(t.match(removes))
				{
					alert("Please Enter Valid Branch name");
					return false;
                }
				var ba=document.login.bank_name.value;
				if(ba.match(removes))
				{
					alert("Please Enter Valid Bank name");
					return false;
                }
			
				var remove1=/[^0-9]/
       			var t1=document.login.number.value;
             	 if(t1.match(remove1))
				{
					alert("Please Enter Valid Check number");
					document.login.number.focus();
					return false;
    			}
				
				var remove1=/[^0-9]/
       			var t1=document.login.amount.value;
             	 if(t1.match(remove1))
				{
					alert("Please Enter Valid Amount");
					document.login.amount.focus();
					return false;
    			}
			
			 if (document.login.email.value != ""){
         var MailId = document.login.email;
         var Attu = MailId.value.indexOf("@");
         var Pottu = MailId.value.lastIndexOf(".");
         var Gaali = MailId.value.indexOf(" ");
         if ((Attu < 1) ||  ((Gaali > -1) && (Gaali < MailId.value.length-1)) ||
	         (Pottu <= Attu+1) || (Pottu == MailId.value.length-1)) {
	         alert("Please Enter Your Valid E-mail id");
			 document.login.email.focus();
			 return false;
			 }
			else
			  return true;
         }
				
			
	
}
function go()
{
location=document.forms[0].gowhere.value
}

//Validation for DD
function ddvalid(pm) {
			    if(document.login.number.value=="")
					{
					alert("You must enter a DD number");
					document.login.number.focus();
					return false;
					}
				if(document.login.bank_name.value=="")
					{
					alert("You must enter a Bank Name");
					document.login.bank_name.focus();
					return false;
					}	
				if(document.login.Branch_name.value=="")
					{
					alert("You must enter a Branch Name");
					document.login.Branch_name.focus();
					return false;
					}	
				if(document.login.amount.value=="")
					{
					alert("You must enter a Amount");
					document.login.amount.focus();
					return false;
					}				
				var removes=/[^a-zA-Z](^\s*|\s*$)/
                var t=document.login.Branch_name.value;
				if(t.match(removes))
				{
					alert("Please Enter Valid Branch name");
					return false;
                }
				var ba=document.login.bank_name.value;
				if(ba.match(removes))
				{
					alert("Please Enter Valid Bank name");
					return false;
                }
				var remove1=/[^0-9]/
       			var t1=document.login.number.value;
             	 if(t1.match(remove1))
				{
					alert("Please Enter Valid DD number");
					document.login.number.focus();
					return false;
    			}
				
				var remove1=/[^0-9]/
       			var t1=document.login.amount.value;
             	 if(t1.match(remove1))
				{
					alert("Please Enter Valid Amount");
					document.login.amount.focus();
					return false;
    			}
				
						
	
}

//validation for family
function maximumf()
		{
              var g=document.family.abtfamily.value.length;
			  if(g>150)
			{
				  
			document.family.ftype.focus();
			return false;
			}
		}
 // form validation
 function save_fam(theform) {

if (document.family.fvalue.value == "Select") {
alert("please selet your family value");
document.family.fvalue.focus();
return false;
   }
  if(document.family.ftype.value == "Select") {
   alert("please selet your family type");
   document.family.ftype.focus();
   return false;
   }
  if(document.family.native.value == "") {
   alert("please enter the city");
   document.family.native.focus();
   return false;
   }
  if(document.family.native.value.length > 0) 
		{ 
	   var spChar1 = "0123456789!#$%^&*()+=[]\\\;,/{}|\":<>?~`";
				for(var i = 0;i < document.family.native.value.length; i++) 
				{ 
					if(spChar1.indexOf(document.family.native.value.charAt(i)) != -1) 
					{ 
					alert("City has special characters or numeric values."); 
					document.family.native.focus(); 
					return false; 
					} 
				}
		}

   if(document.family.fstatus.value == "Select") {
   alert("please select your family status");
   document.family.fstatus.focus();
   return false;
   }
  if(document.family.abtfamily.value == "") {
   alert("please tell abt your family");
   document.family.abtfamily.focus();
   return false;
   }
    
	 }

// form validation for religion
 function save_rel(thefirm) {

if (document.religion.caste.value == "Select") {
        alert("Please Enter Your Caste");
        document.religion.caste.focus();
        return false;
     }
  else if (document.religion.caste.value == "Other Caste" && document.religion.caste1.value == "") {
        alert("Please type Your Caste");
        document.religion.caste1.focus();
        return false;
     }
  else if(document.religion.mtongue.value == "Select") {
     alert("Please Enter Your Mother Tongue");
     document.religion.mtongue.focus();
      return false;
   }
  else if (document.religion.mtongue.value == "others" && document.religion.mtongue12.value == "") {
        alert("Please type Your Mother Tongue");
        document.religion.mtongue12.focus();
        return false;
     }
  else if(document.religion.raasi.value == "Select") {
     alert("Please Enter Your Raasi");
     document.religion.raasi.focus();
      return false;
   }
   else if(document.religion.att_hor.disabled==false)
	 {
		 if (document.religion.att_hor.value == "") {
        alert("Please Attach Horoscope");
        document.religion.caste.focus();
        return false;
		}
	 }
	 if (document.religion.att_hor.value != "")
		 {
	  var files = document.getElementsByTagName("input");

		if (document.religion.att_hor.type == "file" && document.religion.att_hor.value.indexOf(".gif")  != -1) 
		{
		  //alert("Wrong File extension.Please upload .gif,.jpg,.png,.bmp"); 
		  return true;
		 }
		 else if (document.religion.att_hor.type == "file" && document.religion.att_hor.value.indexOf(".jpg")  != -1) 
		{
			return true;
		}
		else if (document.religion.att_hor.type == "file" && document.religion.att_hor.value.indexOf(".jpeg")  != -1) 
		{
			return true;
		}
		else if (document.religion.att_hor.type == "file" && document.religion.att_hor.value.indexOf(".png")  != -1) 
		{
			return true;
		}
		else if (document.religion.att_hor.type == "file" && document.religion.att_hor.value.indexOf(".bmp")  != -1) 
		{
			return true;
		}
		else
		{
			alert("Wrong file extention.Please upload only .jpeg,.jpg,.gif,.bmp,.png")
				return false;
		}
	  }
}
function clk_yesrno(religion)
{
	alert("hai");
}
function clk_caste(religion)
{
	if(document.religion.caste.value=="Other Caste")
	{
		document.religion.caste1.disabled=false;
	}
	if(document.religion.caste.value!="Other Caste")
	{
		document.religion.caste1.disabled=true;
		document.religion.caste1.value="";
	}
}

function clk_mtongues(religion)
{
	if(document.religion.mtongue.value=="others")
	{
		document.religion.mtongue1.disabled=false;
	}
	if(document.religion.mtongue.value!="others")
	{
		document.religion.mtongue1.disabled=true;
		document.religion.mtongue1.value="";
	}
}
function clk_mtongue(religion)
{
	if(document.religion.mtongue.value=="others")
	{
		document.religion.mtongue12.disabled=false;
	}
	if(document.religion.mtongue.value!="others")
	{
		document.religion.mtongue12.disabled=true;
		document.religion.mtongue12.value="";
	}
}

function test()
{
	if (document.career.educaty.value == "Others") {
		document.career.educaty1.disabled=false;
	}
	if(document.career.educaty.value!="Others")
	{
		document.career.educaty1.disabled=true;
		document.career.educaty1.value="";
	}
}
function occu()
{
	if (document.career.occup.value == "Others") {
		document.career.occup1.disabled=false;
	}
	if(document.career.occup.value!="Others")
	{
		document.career.occup1.disabled=true;
		document.career.occup1.value="";
	}
}
function clk_hor_yes(religion)
{
	document.religion.att_hor.disabled=false;
}
function clk_hor_no(religion)
{
	document.religion.att_hor.disabled=true;
}
function clk_dos_yes(religion)
{
	document.religion.sel_dosham.disabled=false;
}
function clk_dos_no(religion)
{
	document.religion.sel_dosham.disabled=true;
}
//Validation for pre_partner

// form validation
 function check_pre(theform) {
	 var spChar1 = "0123456789!#$%^*()+=[]\\\;,/{}|\":<>?~`";
     if (theform.message.value == "") {
     alert("Please enter few words about your partner");
     theform.message.focus();
		 return false;
				 }
				 
				 
if(theform.news.value=="select")
{
	alert("Please select How do you know about Praptham.com");
	theform.news.focus();
	return false;
}	 
if(theform.news.value=="Others")
{
    if(theform.news1.value=="")
	{
	 alert("Please enter How do you know about Praptham.com");
	theform.news1.focus();
	return false;
	}
}
if(theform.message.value.length > 0) 
		{ 
				for(var i = 0;i < theform.message.value.length; i++) 
				{ 
					if(spChar1.indexOf(theform.message.value.charAt(i)) != -1) 
					{ 
					alert("How to know about has special characters or numeric values."); 
					theform.news.message.focus(); 
					return false; 
					} 
				}
		}
strhC1 = theform.C1.checked;
		if (strhC1 == false)
		{
			alert("Please read the terms and conditions.Click the Checkbox to proceed");
			theform.C1.focus();
			return false;
		}
}



//login
		  function maximumpre()
		{
              var g=document.partner.message.value.length;
			  if(g>150)
			{
				document.partner.save_pref.focus();
			}
		}

function clk_news()
{
if(document.partner.news.value=="Others")
{
document.partner.news1.disabled=false;
}
if(document.partner.news.value!="Others")
{
document.partner.news1.disabled=true;
}
}


//Validation for check box.(delete)
var formblock;
var forminputs;
function chvalidation(name) {
	
   var count=0;
	formblock= document.getElementById('form_id');
forminputs = formblock.getElementsByTagName('input');
for (i = 0; i < forminputs.length; i++) 
	{
	var regex = new RegExp(name, "i");
	if (regex.test(forminputs[i].getAttribute('name'))) 
    {
		 if(forminputs[i].checked == true)
		{
		count=2;
		}
    }
}
	if(count!=2)
	{

  alert("You must select atleast one profile");
	return false;
	}
}

 function validshow()
		  {
                        
                     myOption = -1;
				for (i=document.interest.subject.length-1; i > -1; i--) 
			   {
					if (document.interest.subject[i].checked) 
						{
							myOption = i;
							i = -1;
						}
			   }
					if (myOption == -1) 
					{
					alert("Please select your interest type");
					return false;
					}



		  }

//Feedback
function check_feed(the)
{
	if(document.feedbk.fname.value == "")
	{
		alert("Please fill Your Name");
		return false;
	}

	else if(document.feedbk.femail.value == "")
	{
		alert("Please fill Your Mail Id");
		return false;
	}
	else if(document.feedbk.fcontent.value == "")
	{
		alert("Please fill Your Feedback");
		return false;
	}

	 else if(document.feedbk.fname.value != "")
	{
			 var remove=/[^a-zA-Z]/
			 var t=document.feedbk.fname.value;
			 if(t.match(remove))
			 {
					alert("Please Enter Valid name");
					document.feedbk.fname.focus()
					return false;
			}
	}
}

function checkMailId(mailids)
{
var arr = new Array('.com','.net','.org','.biz','.coop','.info','.museum','.name','.pro'
,'.edu','.gov','.int','.mil','.ac','.ad','.ae','.af','.ag','.ai','.al',
'.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw','.az','.ba','.bb',
'.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm','.bn','.bo','.br','.bs',
'.bt','.bv','.bw','.by','.bz','.ca','.cc','.cd','.cf','.cg','.ch','.ci',
'.ck','.cl','.cm','.cn','.co','.cr','.cu','.cv','.cx','.cy','.cz','.de',
'.dj','.dk','.dm','.do','.dz','.ec','.ee','.eg','.eh','.er','.es','.et',
'.fi','.fj','.fk','.fm','.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh',
'.gi','.gl','.gm','.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy',
'.hk','.hm','.hn','.hr','.ht','.hu','.id','.ie','.il','.im','.in','.io',
'.iq','.ir','.is','.it','.je','.jm','.jo','.jp','.ke','.kg','.kh','.ki',
'.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li','.lk',
'.lr','.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg','.mh','.mk',
'.ml','.mm','.mn','.mo','.mp','.mq','.mr','.ms','.mt','.mu','.mv','.mw',
'.mx','.my','.mz','.na','.nc','.ne','.nf','.ng','.ni','.nl','.no','.np',
'.nr','.nu','.nz','.om','.pa','.pe','.pf','.pg','.ph','.pk','.pl','.pm',
'.pn','.pr','.ps','.pt','.pw','.py','.qa','.re','.ro','.rw','.ru','.sa',
'.sb','.sc','.sd','.se','.sg','.sh','.si','.sj','.sk','.sl','.sm','.sn',
'.so','.sr','.st','.sv','.sy','.sz','.tc','.td','.tf','.tg','.th','.tj',
'.tk','.tm','.tn','.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug',
'.uk','.um','.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu',
'.ws','.wf','.ye','.yt','.yu','.za','.zm','.zw');
var mai = mailids;
var val = true;

var dot = mai.lastIndexOf(".");
var ext = mai.substring(dot,mai.length);
var at = mai.indexOf("@");
var dom = dot - at;
var sp = mai.indexOf(" ");

if(dom >= 4 && at >1 && sp == -1)
{
for(var i=0; i<arr.length; i++)
{
if(ext == arr[i])
{
val = true;
break;
}
else
{
	
val = false;
}
}
if(val == false)
{
alert("Your maild "+mai+" is not corrrrect");
document.feedbk.femail.focus()
return false;
}
}
else
{
alert("Your maild "+mai+" is not correct");
document.feedbk.femail.focus()
return false;
}
return true;
}

