// JavaScript Document
function Validate() {

// make sure field is not blank

// make sure field is not blank
if (document.Form1.name.value=="") {
alert("please, Enter First Name");
document.Form1.name.focus();
return false;
}
/////////
var listCheck=document.Form1.dobmonth.selectedIndex;
if (listCheck=="0"){
alert("Please Select Month");
document.Form1.dobmonth.focus();
return false;
}
//////////////
var listCheck=document.Form1.dobday.selectedIndex;
if (listCheck=="0"){
alert("Please Select Date");
document.Form1.dobday.focus();
return false;
}
var listCheck=document.Form1.dobyear.selectedIndex;
if (listCheck=="0"){
alert("Please Select Year");
document.Form1.dobyear.focus();
return false;
}
var radiocheck=false;
for(i=0;i<document.Form1.gender.length;i++){
if(document.Form1.gender[i].checked){
radiocheck=true;
}
}
if(!radiocheck){
alert("select the Gender");
document.Form1.gender[0].focus();
return false;

}
var radiocheck=false;
for(i=0;i<document.Form1.marital_status.length;i++){
if(document.Form1.marital_status[i].checked){
radiocheck=true;
}
}
if(!radiocheck){
alert("select the Marital Status");
document.Form1.marital_status[0].focus();
return false;

}
var listCheck=document.Form1.sub_caste.selectedIndex;
if (listCheck=="0"){
alert("Please Select Sub Caste");
document.Form1.sub_caste.focus();
return false;
}
var listCheck=document.Form1.country.selectedIndex;
if (listCheck=="0"){
alert("Please Select Country");
document.Form1.country.focus();
return false;
}
var listCheck=document.Form1.citizenship.selectedIndex;
if (listCheck=="0"){
alert("Please Select Citizenship");
document.Form1.citizenship.focus();
return false;
}

var radiocheck=false;
for(i=0;i<document.Form1.resident_status.length;i++){
if(document.Form1.resident_status[i].checked){
radiocheck=true;
}
}
if(!radiocheck){
alert("select the Resident Status");
document.Form1.resident_status[0].focus();
return false;

}

var radiocheck=false;
for(i=0;i<document.Form1.employed.length;i++){
if(document.Form1.employed[i].checked){
radiocheck=true;
}
}
if(!radiocheck){
alert("select the employed");
document.Form1.employed[0].focus();
return false;

} 
var email=/^[a-z0-9_.-]+@[a-z]+\.[a-z]+/;
var valid_mail=document.Form1.email.value;
if(email.test(valid_mail)!=true){
alert("please enter  valid email id");
document.Form1.email.focus();
return false;
}

 if (Form1.password1.value == "") {
   alert("Password can not be empty");
      return false; 
   }
   if (Form1.password1.value.length <5)
{
alert("Please enter at least 5 characters in the \"Password\" field.");
Form1.password1.focus();
return (false);
}
   if (Form1.password2.value == "") {
   alert("Please Enter Confirm Password ");
      return false; 
   }
      
	  // check if both password fields are the same
if (Form1.password1.value != Form1.password2.value) {
   alert("Password and Password Confirmation Did Not Match");
   return false; 
   }


if ( document.Form1.terms.checked == false )
    {
        alert ( "Please check the Terms & Conditions box." );
       document.Form1.terms.focus();
return false;
    }


//****************************************************************
}
//**************************************************************************
function enabledmenu1(){
document.Form1.no_of_children.disabled=true;
}
function enabledmenu2(){
document.Form1.no_of_children.disabled=false;
}
function enabledmenu3(){
document.Form1.no_of_children.disabled=false;
}
function enabledmenu4(){
document.Form1.no_of_children.disabled=false;
}
function enableradio(){
if(document.Form1.no_of_children.value==0){
for(i=0;i<2;i++){
document.Form1.children_living_status[i].disabled=true;
//document.Form1.children_living_status[1].disabled=true;
}
}
else{
document.Form1.children_living_status[0].disabled=false;
document.Form1.children_living_status[1].disabled=false;
}
}
//**************************************2nd page****************************************

