function checkFields()
{
	missinginfo = ""

	if (document.form.txtFname.value == "" || document.form.txtFname.value == "First Name")
	{
		//missinginfo +="\n          - First Name"
		alert("Please Enter First Name");
		document.form.txtFname.focus();
		return false;
	}
	else
	{
	if(isNaN(document.form.txtFname.value.charAt(0))!=true)
	{
		//missinginfo +="\n	-First Name Should Start with a character"
		alert("First Name Should Start with a character");
		document.form.txtFname.focus();
		return false;
			
	}
	}
	if (document.form.txtLname.value == "" || document.form.txtLname.value == "Last Name")
	{
		//missinginfo +="\n          - Last Name"
		alert("Please Enter Last Name");
		document.form.txtLname.focus();
		return false;
				
	}
	else
	{
	if(isNaN(document.form.txtLname.value.charAt(0))!=true)
	{
		//missinginfo +="\n	-Last Name Should Start with a character"
		alert("Last Name Should Start with a character");
		document.form.txtLname.focus();
		return false;
		
	}
	}
	if (document.form.ddlGender.options[document.form.ddlGender.selectedIndex].value == "Select"||document.form.ddlGender.options[document.form.ddlGender.selectedIndex].value == "")
	{
		//missinginfo +="\n          - Gender"
		alert("Please Select Gender");
		document.form.ddlGender.focus();
		return false;
				
	}
/*	if (document.form.ddlDay.options[document.form.ddlDay.selectedIndex].value == "Day" || document.form.ddlDay.options[document.form.ddlDay.selectedIndex].value == "")
	{
		missinginfo +="\n          - Day"
	}
	if (document.form.ddlMonth.options[document.form.ddlMonth.selectedIndex].value == "Month" || document.form.ddlMonth.options[document.form.ddlMonth.selectedIndex].value == "")
	{
		missinginfo +="\n          - Month"
	}
	if (document.form.ddlYear.options[document.form.ddlYear.selectedIndex].value == "Year" || document.form.ddlYear.options[document.form.ddlYear.selectedIndex].value == "")
	{
		missinginfo +="\n          - Year"
	}*/
	if (document.form.ddlDay.options[document.form.ddlDay.selectedIndex].value == "Day" || document.form.ddlMonth.options[document.form.ddlMonth.selectedIndex].value == "Month" || document.form.ddlYear.options[document.form.ddlYear.selectedIndex].value == "Year")
	{
		//missinginfo +="\n          - Date of Birth"
		alert("Please Select Date of Birth");
		document.form.ddlDay.focus();
		return false;
	}
/*=========================================================================================*/
var dob=new Date();
var date=dob.getDate();
var month=dob.getMonth() + 1;
var year=dob.getFullYear();

var cmbmonth=parseInt(document.getElementById("ddlMonth").options[document.getElementById("ddlMonth").selectedIndex].value);
var cmbday=parseInt(document.getElementById("ddlDay").options[document.getElementById("ddlDay").selectedIndex].value);
var cmbyear=parseInt(document.getElementById("ddlYear").options[document.getElementById("ddlYear").selectedIndex].value);

age=year-cmbyear;

if(cmbmonth>month)
{
age--;
}
if(cmbmonth==month && cmbday>=date)
{
age--;
}

if(age<18)
{
//missinginfo +="\n          -You are Under 18 years of age and are prohibited to register this site!"
alert("You are Under 18 years of age and are prohibited to register on this site!");
return false;

}

/*=========================================================================================*/

	if (document.form.ddlHeight.options[document.form.ddlHeight.selectedIndex].value == "Select Height"||document.form.ddlHeight.options[document.form.ddlHeight.selectedIndex].value == "")
	{
		//missinginfo +="\n          - Height"
		alert("Please Select Height");
		document.form.ddlHeight.focus();
		return false;
	}

	if (document.form.txtWeight.value == "")
	{
		//missinginfo +="\n          - Weight"
		alert("Please Enter Weight");
		document.form.txtWeight.focus();
		return false;
		
	}
	else
	{
	if (isNaN(document.form.txtWeight.value) == true)
	{
		//missinginfo +="\n          - Weight should be NUMERIC only"
		alert("Weight should be NUMERIC only");
		document.form.txtWeight.focus();
		return false;
	}
	}
	if (document.form.ddlMaritalStatus.options[document.form.ddlMaritalStatus.selectedIndex].value == "Select Marital Status"||document.form.ddlMaritalStatus.options[document.form.ddlMaritalStatus.selectedIndex].value == "")
	{
		//missinginfo +="\n          - Marital Status"
		alert("Please Select Marital Status");
		document.form.ddlMaritalStatus.focus();
		return false;
	}
	if (document.form.txtEmailID.value == "")
	{
		//missinginfo +="\n          - Email Id"
		alert("Please Enter Email ID");
		document.form.txtEmailID.focus();
		return false;
		
	}
	else
	{
	if(!IsEmail(document.getElementById('txtEmailID').value))
            {
                    alert('Please Enter a Valid Email ID');
                    document.getElementById('txtEmailID').focus();
                    return false;
            }
	
	}

	if (document.form.txtPassword.value == "")
	{
		//missinginfo +="\n          - Password"
		alert("Please Enter Password");
		document.form.txtPassword.focus();
		return false;
		
	}
	if(document.form.txtCPassword.value == "")
	{
		//missinginfo +="\n          - Confirm Password"
		alert("Please Enter Confirm Password");
		document.form.txtCPassword.focus();
		return false;
		 
	}
	for(i=0;i<document.form.txtPassword.value.length;i++)
	{
		if(document.form.txtPassword.value.charAt(i)==" ")
			{
				//missinginfo +="\n          - No Blank Spaces Allowed In Password"
				alert("No Blank Spaces Allowed In Password")
				document.form.txtPassword.focus();
				return false;
				break;
			}
	
	}

	if(document.form.txtPassword.value != document.form.txtCPassword.value)
	{
		//missinginfo +="\n          - Confirm Password Not Matching " 	
		alert("Confirm Password Not Matching");
		document.form.txtPassword.value=""
		document.form.txtCPassword.value=""
		document.form.txtPassword.focus();
		return false;
	}
	if (document.form.ddlMTongue.options[document.form.ddlMTongue.selectedIndex].value == "Select your Mother Tongue"||document.form.ddlMTongue.options[document.form.ddlMTongue.selectedIndex].value == "")
	{
		//missinginfo +="\n          - Mother Tongue"
		   alert("Please Select Mother Tongue")
				document.form.ddlMTongue.focus();
				return false;
		
	}
	else if(document.getElementById("mton").style.visibility == 'visible')
	{
	   
	  if(document.form.txtSpMTongue.value== "")
	  {	 
	       //missinginfo +="\n          -Your Other Mother Tounge"
	       alert("Please Select Other Mother Tongue")
				document.form.txtSpMTongue.focus();
				return false;
	  }  
	  
	}
	if (document.form.ddlCommunity.options[document.form.ddlCommunity.selectedIndex].value == "Select a Community"||document.form.ddlCommunity.options[document.form.ddlCommunity.selectedIndex].value == "")
	{
		//missinginfo +="\n          - Community"
		alert("Please Select Community")
		document.form.ddlCommunity.focus();
		return false;
	}
	else if(document.getElementById("commid").style.visibility == 'visible')
	{
	  
	  if(document.form.txtSpCommunity.value== "")
	  {	 
	         alert("Please Select Other Community")
				document.form.txtSpCommunity.focus();
				return false;
	  }  
	  
	}
	
	if (document.form.ddlIncome.options[document.form.ddlIncome.selectedIndex].value == "Select Income Range"||document.form.ddlIncome.options[document.form.ddlIncome.selectedIndex].value == "")
	{
		//missinginfo +="\n          - Annual Income"
		alert("Please Select Annual Income")
		document.form.ddlIncome.focus();
		return false;
	}
	
	/*if (document.form.ddlCountry.options[document.form.ddlCountry.selectedIndex].value == "Select Country"||document.form.ddlCountry.options[document.form.ddlCountry.selectedIndex].value == "")
	{
		missinginfo +="\n          - Country of Residence"
	}
	if (document.getElementById("trState1").style.display== "none" )//&& document.getElementById("trState").style..display== "none" )
	{
	alert('in');
	}
	else
	{
	if (document.form.ddlState.options[document.form.ddlState.selectedIndex].value == "Select State"||document.form.ddlState.options[document.form.ddlState.selectedIndex].value == "")
	{
		missinginfo +="\n          - State"
	}
	}*/
	
	if (isNaN(document.form.txtCity.value) == "")
	{
		//missinginfo +="\n          - Your Present Address"
		alert("Please Enter Your Present Address")
		document.form.txtCity.focus();
		return false;
		
	}
	/*else
	{
	if(isNaN(document.form.txtCity.value.charAt(0))!=true)
	{
		missinginfo +="\n	-City Should Start with a character"
	}
	}*/
	if (isNaN(document.form.txtWeight.value) == true)
	{
		//missinginfo +="\n          - Weight should be NUMERIC only"
		alert("Weight should be NUMERIC only")
		document.form.txtWeight.focus();
		return false;
		
	}
	if (document.form.txtCountryCode.value == "")
	{
		//missinginfo +="\n          - Country Code "
		alert("Please Enter Country Code")
		document.form.txtCountryCode.focus();
		return false;
	}
	else if(isNaN(document.form.txtCountryCode.value) == true)
	{
		//missinginfo +="\n          - Country Code should be NUMERIC only"
		alert("Country Code should be NUMERIC only")
		document.form.txtCountryCode.focus();
		return false;
		
	}
	if (document.form.txtAreaCode.value == "")
	{
		//missinginfo +="\n          - Area Code "
		alert("Please Enter Area Code")
		document.form.txtAreaCode.focus();
		return false;
		
	}
	else if(isNaN(document.form.txtAreaCode.value) == true)
	{
		//missinginfo +="\n          - Area Code should be NUMERIC only"
		alert("Area Code should be NUMERIC only")
		document.form.txtAreaCode.focus();
		return false;
		
	}
	if (document.form.txtTelNumber.value == "")
	{
	   //missinginfo +="\n          - Telephone no."
	   alert("Please Enter Telephone no")
		document.form.txtTelNumber.focus();
		return false;
	   
	}
	else if(isNaN(document.form.txtTelNumber.value) == true)
	{
		//missinginfo +="\n          - Telephone no. should be NUMERIC only"
		 alert("Telephone no. should be NUMERIC only")
		document.form.txtTelNumber.focus();
		return false;
	}
	if (isNaN(document.form.txtMobileACode.value) == true)
	{
		//missinginfo +="\n          - Mobile Area Code should be NUMERIC only"
		 alert("Mobile Area Code should be NUMERIC only")
		document.form.txtMobileACode.focus();
		return false;
	}
	if (isNaN(document.form.txtMNumber.value) == true)
	{
		//missinginfo +="\n          - Mobile no. should be NUMERIC only"
		 alert("Mobile no. should be NUMERIC only")
		document.form.txtMobileACode.focus();
		return false;
		 
	}
	

	/*if (missinginfo != "") 
		{
			missinginfo ="www.digambarjains.com \n_____________________________\n" +
			"You missed out the following:\n" +
			missinginfo + "\n_____________________________" +
			"\nPlease re-enter and submit again!";
			alert(missinginfo);
			return false;
		}
	else return true;*/
}
function IsEmail(email)
        {
            var blnresult=true;
            var strEmailRegExp=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	        if(!email.match(strEmailRegExp))
	        {
	            blnresult=false;
	        }
        		
	        return blnresult;

        }
function Check()
{

if(document.form.ddlCountry.value=="India")
{
document.getElementById("trState1").style.display="none";
document.getElementById("trState").style.display="";
}
else
{
document.getElementById("trState").style.display="none";
document.getElementById("trState1").style.display="";
}

}
function Hide()
{
document.getElementById("trState1").style.display="none";
}
function Focus()
{
if(document.form.txtFname.value == "First Name")
{
document.form.txtFname.value ='';
}
if(document.form.txtLname.value == "Last Name")
{
document.form.txtLname.value ='';
}
}

