
// Trim function in javascript 
function Trim(str)
{
    while (str.substring(0,1) == ' ') // check for white spaces from beginning
    {
        str = str.substring(1, str.length);
    }

    while (str.substring(str.length-1, str.length) == ' ') // check white space from end
    {
        str = str.substring(0,str.length-1);
    }
    return str;

}
// EOF Trim function 

// 
function ifcity_india_usa(obj)
{
	if(document.frm1.city.options[document.frm1.city.selectedIndex].text == '- Any in Indian city -')
	{
		document.frm1.city10.disabled = false;
	}
	else
	{
		document.frm1.city10.disabled = true;
	}

}		


function ifcountry_india_usa(obj)
{
	if(obj.options[obj.selectedIndex].text == 'India')
	{
		document.frm1.state.disabled = false;

		document.frm1.city.disabled = false;
document.frm1.city10.disabled = true;
		document.frm1.state10.value = ""; 

		document.frm1.state10.disabled = true; 

		return true;
	}
	else
	{
		document.frm1.state10.disabled = false; 

		document.frm1.city.disabled = true;

		document.frm1.city10.disabled = false; 
		
		document.frm1.city.value = "";
		
		document.frm1.state[0].selected = true;
		
		document.frm1.state.disabled = true;

		return true;
		}
}

function checkUser(frm1)
{	
	var msg = document.frm1.username.value;
	
	window.location ="process.php?username="+msg+"&check=check";	
}


//Function for form onSubmit
function Full(frm1)
{
	//alert("Hi");
	var validvalue = /[0-9]/g;
	var regExp = /^[A-Za-z\s,.()-;:']/;
	// login
	if((frm1.username.value=="")||(frm1.username.value.indexOf('@',0) != -1))
	{
		alert("You must enter a valid username.");

		frm1.username.focus();

		return(false);
	}
	
	//*************username id validation**********
	// require at least 4 characters in the username field
	var checkuname= Trim(frm1.username.value);
	frm1.username.value=checkuname;

	if (frm1.username.value.length < 4)
	{
		alert("Please enter at least 4 characters in the username.");

		frm1.username.focus();

		return (false);
	}

	// test if valid username,and must not have @ and .com


	//*************password validation**********

	// require at least 4 characters in the password field
	var checkpwd= Trim(frm1.password.value);
	frm1.password.value=checkpwd;
	
	if (frm1.password.value.length < 4)
	{
		alert("Please enter at least 4 characters in the pasword.");

		frm1.password.focus();

		return (false);
	}

	// check if both password fields are the same
	if (frm1.password.value != frm1.cpassword.value)
	{
		alert("The two passwords are not the same.");

		frm1.cpassword.focus();

		return (false);
	}
	//*********blank field******************************************


	// check to see if the field is blank
	var checkname= Trim(frm1.name.value);
	frm1.name.value=checkname;
	if((frm1.name.value=="")||(frm1.name.value.indexOf('@',0) !=-1))
	{
		alert("You must enter a valid name.");

		frm1.name.focus();

		return(false);
	}

			// test if valid name, must not have @ and .com
// BOF check name field content only text

	//var checkname= Trim(frm1.name.value);

    if (validvalue.test(frm1.name.value))
    {
    	alert("No numeric character is allowed.");
		frm1.name.focus();
        return false;
    }

	
// EOF check fathername field content only text
	

	

	//****************email validation**************
	

	// check if email field is blank
	var checkemail= Trim(frm1.email.value);
	frm1.email.value=checkemail;
	if (frm1.email.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");

		frm1.email.focus();

		return(false);
	}

	// test if valid email address, must have @ and .

	var checkEmail = "@.";

	var checkStr = frm1.email.value;

	var EmailValid = false;0000000000

	var EmailAt = false;

	var EmailPeriod = false;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);

			for (j = 0;  j < checkEmail.length;  j++)
			{
				if (ch == checkEmail.charAt(j) && ch == "@")
						EmailAt = true;

				if (ch == checkEmail.charAt(j) && ch == ".")
						EmailPeriod = true;

	  			if (EmailAt && EmailPeriod)
				break;

      	  		if (j == checkEmail.length)
				break;

			}

			// if both the @ and . were in the string
			if (EmailAt && EmailPeriod)
			{
					EmailValid = true
					break;
			}

	}

	if (!EmailValid)
	{
		alert("Invalid email ID ! Please enter your valid email ID.");

		frm1.email.focus();

		return(false);
	}


// Checking for address
	var checkaddr= Trim(frm1.address.value);
	frm1.address.value=checkaddr;
	
	if (frm1.address.value == "")
	{
		alert("You must specify your Address ");
		frm1.address.focus();
		return(false);
	}

	// test if valid address, must not have @ and .com

	var checkAddress = "@";

	var checkStr = frm1.address.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);

		for (j = 0;  j < checkAddress.length;  j++)
		{
			if (ch == checkAddress.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid address content ! Please enter your valid address.");
				frm1.address.focus();
				return(false);
		   }
		}  
    }

	

	//***************country*********

	// check if no drop down has been selected for country

	if (frm1.country.selectedIndex < 0)
	{
		alert("Please select one of the Country.");
		frm1.country.focus();
		return(false);
	}

	

	//*************not allowed first item **********

	// check if the first drop down is selected, if so, invalid selection in country

	if (frm1.country.selectedIndex == 0)
	{
		alert("Please select your country of Residence");

		frm1.country.focus();

		return(false);

	}

		
// Begining for State Check
	var checkstate = "@";
	var checkStr = frm1.state10.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkstate.length;  j++)
		{
			if (ch == checkstate.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid state content ! Please enter your valid state.");
				frm1.state10.focus();				
				return(false);
			}
		}  
     }

		
	if (frm1.state.selectedIndex == 0 && frm1.country.selectedIndex != 1  )
	{
	    if(frm1.state10.value==" " || frm1.state10.value =="" || frm1.state10.value =="  " )
		{
			alert("Please specify  State of residence");
			frm1.state10.focus();
			//frm1.state.focus();
			return(false);
		}
		
		var checkstate= frm1.state10.value;
        if (validvalue.test(frm1.state10.value))
        {
            alert("No numeric character is allowed.");
			frm1.state10.focus();
            return false;
        }

	}
		
	if (frm1.state.selectedIndex == 0 && frm1.country.selectedIndex == 1 )
	{
	    if(frm1.state.value=="" )
		{
			alert("Please specify  State of residence");
			frm1.state.focus();
			//frm1.state.focus();
			return(false);
		}
		
		var checkstate= frm1.state10.value;
        if (validvalue.test(frm1.state10.value))
        {
            alert("No numeric character is allowed.");
			frm1.state10.focus();
            return false;
        }

	}

	 if (frm1.state.selectedIndex > 0)
	 {
	    if(frm1.state10.value!="")
	    {
            alert("Please specify Your one State of residence");
			frm1.state.focus();
			return(false);
		}
     }

// Begining for City Check
	var checkcity = "@";
	var checkStr = frm1.city10.value;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkcity.length;  j++)
		{
			if (ch == checkcity.charAt(j) && ch == "@")
			{
				alert("'@' is Invalid city content ! Please enter your valid city.");
				frm1.city10.focus();				
				return(false);
			}
		}  
    }


	if (frm1.city.selectedIndex == 0 && frm1.country.selectedIndex != 1)
	{
	    if(frm1.city10.value=="" )
		{
			alert("You must enter a value for the City field");
			frm1.city10.focus();
			//frm1.city.focus();
			return(false);
		}
		
    	var check_city= frm1.city10.value;
		if (validvalue.test(frm1.city10.value))
    	{
	    	alert("No numeric character is allowed.");
			frm1.city10.focus();
	        return false;
	    }
	}	
	if (frm1.city.selectedIndex == 0 && frm1.country.selectedIndex == 1)
	{
	    if(frm1.city.value=="" )
		{
			alert("You must enter a value for the City field");
			frm1.city.focus();
			//frm1.city.focus();
			return(false);
		}
		
    
	}	
	
// Begin for Check Pin/Zip Code
	var checkzip= Trim(frm1.zip.value);
	frm1.zip.value=checkzip;
 	if (frm1.zip.value =="" || (frm1.zip.value.indexOf('@',0) != -1))
     {
     	alert("The pin/zip number contains invalid characters");
		frm1.zip.focus();
		return(false);
	}	


// Start for Phone Check
	var st=frm1.phone.value;
	var st_std=frm1.residence_std_phone.value;

	var off=frm1.officeno.value;
	var off_std=frm1.office_std_no.value;

	var Chars2 = "0123456789()-+";

	var stripped2 = st.replace(/[\(\)\.\-\ ]/g,'');

	var stripped22 = off.replace(/[\(\)\.\-\ ]/g,'');
	var stripped222 = off_std.replace(/[\(\)\.\-\ ]/g,'');

//strip out acceptable non-numeric characters;
	/*if (isNaN(parseInt(stripped2)))
	{
		if (isNaN(parseInt(stripped222)))
        {
		 	alert("Plz enter atleast one phone number.");
			frm1.office_std_no.focus();
			return (false);
		}
	}	*/  

	for (i =0; i <= off_std.length -1; i++) 
	{
		if (Chars2.indexOf(off_std.charAt(i)) == -1) 
		{
			alert("Office phone number std code is illegalcharacter");
			frm1.office_std_no.focus();
			return (false);
		}
	}

   	/*if (isNaN(parseInt(stripped2))) 
	{
		if (isNaN(parseInt(stripped22)))
        {
	 		alert("Plz enter atleast one phone number.");
			frm1.officeno.focus();
			return (false);
		}
	}	  */

	for (i =0; i <= off.length -1; i++) 
	{
		if (Chars2.indexOf(off.charAt(i)) == -1) 
		{
			alert("Office phone number is illegalcharacter");
			frm1.officeno.focus();
			return (false);
		}
	}
	
	for (i =0; i <= st_std.length -1; i++) 
	{
		if (Chars2.indexOf(st_std.charAt(i)) == -1) 
		{
			alert("Residence phone number std code is illegalcharacter");
			frm1.residence_std_phone.focus();
			return (false);
		}
	}

  	for (i =0; i <= st.length -1; i++) 
	{
		if (Chars2.indexOf(st.charAt(i)) == -1) 
		{
			alert("Res phone number is illegalcharacter");
			frm1.phone.focus();
			return (false);
		}
	}


// Begining for Mobile Check
	if(frm1.mobileno.value=="" )
	{
		alert("You must enter a mobile no.");
		frm1.mobileno.focus();
		return(false);
	}
	
	if (frm1.mobileno.value !="")
	{
		if (isNaN(frm1.mobileno.value))
		{	
			alert("Invalid mobileno content ! Please enter your valid mobileno.");
			frm1.mobileno.focus();
			return(false);
		}
	}  

// Begining for Fax Check
	if (frm1.fax.value !="")
	{
		if (isNaN(frm1.fax.value))
		{	
			alert("Invalid fax content ! Please enter your valid fax.");
			frm1.fax.focus();
			return(false);
	   }
	}  



	//*********** VALIDATION FOR PERSONAL frm1********************

	//***************drop down*********

	// check if no drop down has been selected for relationship
	if (frm1.relationship.selectedIndex <1)
	{
		alert("Please select one of the \"Relationship\" options.");
		frm1.relationship.focus();
		return (false);
	}


	// check if no drop down has been selected for gender
	if (frm1.gender.selectedIndex == 0)
	{
		alert("Please select one of the \"Gender\" options.");
		frm1.gender.focus();
		return (false);
	}



// check if no drop down has been selected for date
	if (frm1.date.selectedIndex == 0)
	{
		alert("Please select one of the \"Date \" options.");
		frm1.date.focus();
		return (false);
	}

	
	// check if blank value selected for date
	if (frm1.date.options[frm1.date.selectedIndex].value == "")
	{
		alert("Blank value can not be selected for \"Date \" options.");
		frm1.date.focus();
		return (false);
	}

	// check if no drop down has been selected for month
	if (frm1.month.selectedIndex == 0)
	{
		alert("Please select one of the \"Month \" options.");
		frm1.month.focus();
		return (false);
	}
	
	// check if blank value is selected for month
	if (frm1.month.options[frm1.month.selectedIndex].value  == "")
	{
		alert("Blank value can not be selected for \"Month \" options.");
		frm1.month.focus();
		return (false);
	}
	

	// check if no drop down has been selected for year
	if (frm1.birthyear.selectedIndex == 0)
	{
		alert("Please select one of the \"year \" options.");
		frm1.birthyear.focus();
		return (false);
	}

	if (frm1.birthyear.options[frm1.birthyear.selectedIndex].value == "")
	{
		alert("Blank value can not be selected for \"year \" options.");
		frm1.birthyear.focus();
		return (false);
	}

	// check if no drop down has been selected for marital status
	if (frm1.mstatus.selectedIndex == 0)
	{
		alert("Please select one of the \"Marital Status \" options.");
		frm1.mstatus.focus();
		return (false);
	}


// Begining for Fathername Check
	var checkfname= Trim(frm1.fathername.value);
	frm1.fathername.value=checkfname;
	
	var checkfathername = "@";
	var checkStr = frm1.fathername.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkfathername.length;  j++)
		{
			if (ch == checkfathername.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid fathername content ! Please enter your valid fathername.");
				frm1.fathername.focus();
				return(false);
			}
		}  
	}

	if (frm1.fathername.value == "")
	{
		alert("You must enter  father's name in the name field");
		frm1.fathername.focus();
		return (false);
	}

	var checkfathername= frm1.fathername.value;

    if (validvalue.test(frm1.fathername.value))
    {
    	alert("No numeric character is allowed.");
		frm1.fathername.focus();
        return false;
    }
// EOF check fathername field content only text

	
// check if no drop down has been selected for sect
	if (frm1.sect.selectedIndex == 0)
	{
		alert("Please select one of the \"Sampraday\" options.");
		frm1.sect.focus();
		return (false);
	}

	
// check for drop down has been selected for culture
	var checkculture1= "@";
	var checkStr = frm1.culture1.value;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkculture1.length;  j++)
		{
			if (ch == checkculture1.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid culture content! Please enter your valid culture.");
				frm1.culture1.focus();
				return(false);
			}
		}  
    }



// check if no drop down has been selected for culture
	if (frm1.culture.selectedIndex == 0)
	{
		if(frm1.culture1.value=="")
		{
			alert("You must enter a value for the culture field");
			frm1.culture.focus();
			return(false);
		}
		
		var checkculture1= frm1.culture1.value;
        if (validvalue.test(frm1.culture1.value))
        {
            alert("No numeric character is allowed.");
			frm1.culture1.focus();
            return false;
        }
	}	
		
	if (frm1.culture.selectedIndex > 0)
	{
		if(frm1.culture1.value !="")
		{
			alert("You must enter a value for the one culture field");
			frm1.culture1.focus();
			return(false);
		}
	}

//alert("Hi");

// Check for Gotra Self
	var checkg_self= "@";
	var checkStr = frm1.g_self.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkg_self.length;  j++)
		{
			if (ch == checkg_self.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid g_self content! Please enter your valid g_self.");
				frm1.g_self.focus();
				return(false);
			}
		}  
    }

  // check to see if self gotra field is blank
	var checkg_self= Trim(frm1.g_self.value);
	frm1.g_self.value=checkg_self;
	
	if (frm1.g_self.value == "")
	{
		alert("You must enterYour Gotra");
		frm1.g_self.focus();
		return (false);
	}

	var checkg_self= frm1.g_self.value;
    if (validvalue.test(frm1.g_self.value))
    {
    	alert("No numeric character is allowed.");
		frm1.g_self.focus();
        return false;
    }

// check to see mama gotra field
	var checkg_mama= Trim(frm1.g_mama.value);
	frm1.g_mama.value=checkg_mama;
	
	var checkg_mama= "@";

	var checkStr = frm1.g_mama.value;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkg_mama.length;  j++)
		{
			if (ch == checkg_mama.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid g_mama content! Please enter your valid g_mama.");
				frm1.g_mama.focus();
				return(false);
			}
		}
	}
// check to see if the field is blank
	if (frm1.g_mama.value == "")
	{
		alert("You must enter Your Mama's Gotra");
		frm1.g_mama.focus();
		return (false);
	}
	
	var checkg_mama= frm1.g_mama.value;

    if (validvalue.test(frm1.g_mama.value))
    {
        alert("No numeric character is allowed.");
		frm1.g_mama.focus();
        return false;
    }

          
// check if no drop down has been selected for height
	if (frm1.height.selectedIndex == 0)
	{
		alert("Please select Height.");
		frm1.height.focus();
		return (false);
	}


// check if no drop down has been selected for bodytype
	if (frm1.bodytype.selectedIndex == 0)
	{
		alert("Please select one of the \"body type\" options.");
		frm1.bodytype.focus();
		return (false);
	}


// check if bloodgroup
/*	if (frm1.bloodg.selectedIndex == 0)
	{
		alert("Please select one of the \"blood group\" options.");
		frm1.bloodg.focus();
		return (false);
	}*/


// check if no drop down has been selected for complexion
	if (frm1.complexion.selectedIndex == 0)
	{
		alert("Please select one of the \"complexion\" options.");
		frm1.complexion.focus();
		return (false);
	}

		  
		  
// Check field Time of birth
	/*var checktimeofbirth= "@";
	var checkStr = frm1.timeofbirth.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checktimeofbirth;  j++)
		{
			if (ch == checktimeofbirth.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid timeofbirth content! Please enter your valid timeofbirth.");
				frm1.timeofbirth.focus();
				return(false);
			}
		}  
    }*/


// Check field Place of birth
	var checkpob= Trim(frm1.placeofbirth.value);
	frm1.placeofbirth.value=checkpob;
	
	var checkplaceofbirth= "@";
	var checkStr = frm1.placeofbirth.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkplaceofbirth.length;  j++)
		{
			if (ch == checkplaceofbirth.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid placeofbirth content! Please enter your valid placeofbirth.");
				frm1.placeofbirth.focus();
				return(false);
			}
		}  
    }

	if (frm1.placeofbirth.value == "")
	{
		alert("You must enter a name in the  Placeofbirth field");
		frm1.placeofbirth.focus();
		return (false);
	}
	
	var checkplaceofbirth= frm1.placeofbirth.value;
    if (validvalue.test(frm1.placeofbirth.value))
    {
    	alert("No numeric character is allowed.");
		frm1.placeofbirth.focus();
        return false;
    }


// Check Native Place
	var checknplace= Trim(frm1.nativeplace.value);
	frm1.nativeplace.value=checknplace;
	
	var checknativeplace= "@";
	var checkStr = frm1.nativeplace.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checknativeplace.length;  j++)
		{
			if (ch == checknativeplace.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid nativeplace content! Please enter your valid nativeplace.");
				frm1.nativeplace.focus();
				return(false);
			}
		}  
    }

	// check to see if the field is blank
	if (frm1.nativeplace.value == "")
	{
		alert("You must enter a name in the Native Place field");
		frm1.nativeplace.focus();
		return (false);
	}

	var checknativeplace= frm1.nativeplace.value;
    if (validvalue.test(frm1.nativeplace.value))
    {
    	alert("No numeric character is allowed.");
		frm1.nativeplace.focus();
        return false;
    }

	
//Check field for Mother Tongue
	var checkmt= Trim(frm1.mothertongue.value);
	frm1.mothertongue.value=checkmt;
	
	var checkmothertongue= "@";
	var checkStr = frm1.mothertongue.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkmothertongue.length;  j++)
		{
			if (ch == checkmothertongue.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid mothertongue content! Please enter your valid mothertongue.");
				frm1.mothertongue.focus();
				return(false);
			}
		}  
    }

	// check to see if the field is blank
	if (frm1.mothertongue.value == "")
	{
		alert("You must enter a name in the Mother Tongue field");
		frm1.mothertongue.focus();
		return (false);
	}
	
	var checkmothertongue= frm1.mothertongue.value;
    if (validvalue.test(frm1.mothertongue.value))
    {
    	alert("No numeric character is allowed.");
		frm1.mothertongue.focus();
        return false;
    }

	
// check if no drop down has been selected for education
	if (frm1.edu.selectedIndex == 0)
	{
		alert("Please select one of the \"education \" options.");
		frm1.edu.focus();
		return (false);
	}

	// check if no drop down has been selected for education details
	var checkedud= Trim(frm1.edud.value);
	frm1.edud.value=checkedud;
	
	if (validvalue.test(frm1.edud.value))
    {
    	alert("No numeric character is allowed.");
		frm1.edud.focus();
        return false;
    }
	var checkedud= "@";
	var checkStr = frm1.edud.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkedud.length;  j++)
		{
			if (ch == checkedud.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid education content! Please enter your valid education.");
				frm1.edud.focus();
				return(false);
			}
		}  
    }

	if (frm1.edud.value=="")
	{
		alert("Please write one of the \"education details");
		frm1.edud.focus();
		return (false);
	}
	
	var checkedud= frm1.edud.value;
    for(var i = 0; i < checkedud.length; i++)
    {
    	if (!checkedud.charAt(i).match(regExp))
        {
            alert("Invalid Content!");
			frm1.edud.focus();
            return false;
        }
    }


// check if no drop down has been selected for occupation
	if (frm1.occupation.selectedIndex == 0)
	{
		alert("Please select one of the \"occupation \" options.");
		frm1.occupation.focus();
		return (false);
	}

// check for profession
	if (frm1.profession.selectedIndex == 0)
	{
		alert("Please select one of the profession options.");
		frm1.profession.focus();
		return (false);
	}
	
// Check for profession description
	var checksrv= Trim(frm1.service.value);
	frm1.service.value=checksrv;
	
	if (frm1.service.value == "")
	{
		alert("Pls.Specify about your Business/Services/Profession.");
		frm1.service.focus();
		return (false);
	}

	var checkservice= frm1.service.value;
    for(var i = 0; i < checkservice.length; i++)
    {
    	if (!checkservice.charAt(i).match(regExp))
        {
            alert("Invalid Content!");
			frm1.service.focus();
            return false;
       	}
    }

	var checkqualifications= "@";
	var checkStr = frm1.service.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkqualifications.length;  j++)
		{
			if (ch == checkqualifications.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid character Specify about your Business/Services/Profession.");
				frm1.service.focus();
				return(false);
			}
		}  
    }


// check if no drop down has been selected for annualincome
	if (frm1.annualincome.selectedIndex == 0)
	{
		alert("Please select one of the \"Annual Income\" options.");
		frm1.annualincome.focus();
		return (false);
	}


// check if no drop down has been selected for familyannualincome
	if (frm1.familyincome.selectedIndex == 0)
	{
		alert("Please select one of the \"family Annual Income\" options.");
		frm1.familyincome.focus();
		return (false);
	}


// check if no drop down has been selected for family values
	if (frm1.familyvalues.selectedIndex == 0)
	{
		alert("Please select one of the \"Family Values\" options.");
		frm1.familyvalues.focus();
		return (false);
	}

	

// check if no drop down has been selected for manglik
	if (frm1.manglik.selectedIndex == 0)
	{
		alert("Please select one of the \"manglik\" options.");
		frm1.manglik.focus();
		return (false);
	}
  

//***************VALIDATION FORMORE ABOUT YOU********************************	

// check to see if the field is blank

	var checkqual= Trim(frm1.qualifications.value);
	frm1.qualifications.value=checkqual;
	
	var checkqualifications= "@";
	var checkStr = frm1.qualifications.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkqualifications.length;  j++)
		{
			if (ch == checkqualifications.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid  educational qualifications and professional content! Please enter your valid educational qualifications and professional.");
				frm1.qualifications.focus();
				return(false);
			}
		}  
    }

	if (frm1.qualifications.value == "")
	{
		alert("Pls. write educational qualifications and professional or vocational training that you may have undergone.");
		frm1.qualifications.focus();
		return (false);
	}


// Check for Hobbies field

	var checkhobb= Trim(frm1.hobbies.value);
	frm1.hobbies.value=checkhobb;
	
	var checkhobbies= "@";
	var checkStr = frm1.hobbies.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkhobbies.length;  j++)
		{
			if (ch == checkhobbies.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid  Hobbies content! Please enter your valid Hobbies.");
				frm1.hobbies.focus();
				return(false);
			}
		}  
    }

	if ((frm1.hobbies.value == "")||(frm1.hobbies.value.indexOf('@',0) !=-1))
	{
		alert("You must enter valid Hobbies.");
		frm1.hobbies.focus();
		return (false);
	}
	
	var checkhobbies= frm1.hobbies.value;
    for(var i = 0; i < checkhobbies.length; i++)
    {
    	if (!checkhobbies.charAt(i).match(regExp))
        {
            alert("Invalid Content!");
			frm1.hobbies.focus();
            return false;
        }
    }
		  
		 

// Check for Personality field
	var checkpersnlty= Trim(frm1.personality.value);
	frm1.personality.value=checkpersnlty;
	
	if (frm1.personality.value == "")
	{
		alert("Pls. write personality.");
		frm1.personality.focus();
		return (false);
	}
	
	var checkpersonality= "@";
	var checkStr = frm1.personality.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkpersonality.length;  j++)
		{
			if (ch == checkpersonality.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid  personality content! Please enter your valid personality.");
				frm1.personality.focus();
				return(false);
			}
		}  
    }


// check to see if the field is blank

	var checkparents= Trim(frm1.parents.value);
	frm1.parents.value=checkparents;
	
	if (frm1.parents.value == "")
	{
		alert("Pls. write parents business.");
		frm1.parents.focus();
		return (false);
	}
	
	var checkparentss= "@";
	var checkStr = frm1.parents.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkparentss.length;  j++)
		{
			if (ch == checkparentss.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid  educational qualifications and professional content! Please enter your valid educational qualifications and professional.");
				frm1.parents.focus();
				return(false);
			}
		}  
    }


// Check for Unmarried Brothers
	if (frm1.unmarriedbro.selectedIndex == 0)
	{
		alert("Select number of unmarried brothers");
		frm1.unmarriedbro.focus();
		return (false);
	}

	if (isNaN(frm1.unmarriedbro.options[frm1.unmarriedbro.selectedIndex].value))
	{
		alert("Enter number of unmarried brothers");
		frm1.unmarriedbro.focus();
		return (false);
	}

// Check for Married Brothers
	if (frm1.marriedbro.selectedIndex == 0)
	{
		alert("Select number of married brothers");
		frm1.marriedbro.focus();
		return (false);
	}

	if (isNaN(frm1.marriedbro.options[frm1.marriedbro.selectedIndex].value))
	{
		alert("Enter number of married brothers");
		frm1.marriedbro.focus();
		return (false);
	}

	
// Check for Unmarried Sisters
	if (frm1.unmarriedsis.selectedIndex == 0)
	{
		alert("Select number of unmarried sisters");
		frm1.unmarriedsis.focus();
		return (false);
	}

	if (isNaN(frm1.unmarriedsis.options[frm1.unmarriedsis.selectedIndex].value))
	{
		alert("Enter number of unmarried sisters");
		frm1.unmarriedsis.focus();
		return (false);
	}


// Check for Married Sisters
	if (frm1.marriedsis.selectedIndex == 0)
	{
		alert("select number of married sisters");
		frm1.marriedsis.focus();
		return (false);
	}

	if (isNaN(frm1.marriedsis.options[frm1.marriedsis.selectedIndex].value))
	{
		alert("Enter number of married sisters");
		frm1.marriedsis.focus();
		return (false);
	}


// Check for 1st Nearest Relative
	if(frm1.near1.selectedIndex==0)
	{
        alert("Pls. select your 1st nearest relatives.");
		frm1.near1.focus();
		return (false);
	}

	var checknname= Trim(frm1.nearname1.value);
	frm1.nearname1.value=checknname;
	
	if (frm1.nearname1.value == "")
	{
		alert("Pls. write full name of your nearest relatives.");
		frm1.nearname1.focus();
		return (false);
	}
	
	var checknearname1= frm1.nearname1.value;
    for(var i = 0; i < checknearname1.length; i++)
    {
    	if (!checknearname1.charAt(i).match(regExp))
        {
            alert("Invalid Content!");
			frm1.nearname1.focus();
            return false;
        }
    }

	var checknearname1= "@";
	var checkStr = frm1.nearname1.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checknearname1.length;  j++)
		{
			if (ch == checknearname1.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid  nearname1 content! Please enter your valid nearname1.");
				frm1.nearname1.focus();
				return(false);
			}
		}  
    }

var checkncity1= Trim(frm1.nearcity1.value);
	frm1.nearcity1.value=checkncity1;
	
	if (frm1.nearcity1.value == "")
	{
	alert("Pls. write city name.");
	frm1.nearcity1.focus();
	return (false);
	}
	
	var checknearcity1= frm1.nearcity1.value;

    for(var i = 0; i < checknearcity1.length; i++)
    {
    	if (!checknearcity1.charAt(i).match(regExp))
        {
            alert("Invalid Content!");
			frm1.nearcity1.focus();
            return false;
        }
    }
	
	var checknearcity1= "@";
	var checkStr = frm1.nearcity1.value;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checknearcity1.length;  j++)
		{
			if (ch == checknearcity1.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid  nearcity1 content! Please enter your valid nearcity1.");
				frm1.nearcity1.focus();
				return(false);
			}
		}  
    }

var ph1= Trim(frm1.nearphone1.value);
	frm1.nearphone1.value=ph1;
	
var strng=frm1.nearphone1.value	;

	var stripped = strng.replace(/[\(\)\.\-\ ]/g, '');

//strip out acceptable non-numeric characters;

if (isNaN(parseInt(stripped))) 

{

   alert("The first relation phone number contains illegal characters.");

   frm1.nearphone1.focus();

	return (false);

}

var strng=frm1.nearphone1.value;

var Chars = "0123456789()-+ ";

  	if (frm1.nearphone1.value =="")

     	{

     	alert("Specify your first relation phone numbers");

	frm1.nearphone1.focus();

	return (false);

	}	

	for (i =0; i <= strng.length -1; i++) 

	{

		if (Chars.indexOf(strng.charAt(i)) == -1) 

		{

 			alert("Specify your first relation phone numbers");

			frm1.nearphone1.focus();

			return (false);

		}

	}
// Check for 2nd Nearest Relative
    if(frm1.near2.selectedIndex==0)
	{
        alert("Pls. select your 2nd nearest relatives.");
		frm1.near2.focus();
		return (false);
	}
	
	var checknname= Trim(frm1.nearname2.value);
	frm1.nearname2.value=checknname;
	
	if (frm1.nearname2.value == "")
	{
		alert("Pls. write full name of your nearest relatives.");
		frm1.nearname2.focus();
		return (false);
	}
	
	var checknearname2= frm1.nearname2.value;

    for(var i = 0; i < checknearname2.length; i++)
    {
    	if (!checknearname2.charAt(i).match(regExp))
        {
            alert("Invalid Content!");
			frm1.nearname2.focus();
            return false;
        }
    }

	var checknearname2= "@";
	var checkStr = frm1.nearname2.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checknearname2.length;  j++)
		{
			if (ch == checknearname2.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid  nearname2 content! Please enter your valid nearname2.");
				frm1.nearname2.focus();
				return(false);
			}
		}  
    }


	var checkncity2= Trim(frm1.nearcity2.value);
	frm1.nearcity2.value=checkncity2;
	
	if (frm1.nearcity2.value == "")
	{
		alert("Pls. write city name.");
		frm1.nearcity2.focus();
		return (false);
	}
	var checknearcity2= frm1.nearcity2.value;

    for(var i = 0; i < checknearcity2.length; i++)
    {
    	if (!checknearcity2.charAt(i).match(regExp))
        {
            alert("Invalid Content!");
			frm1.nearcity2.focus();
            return false;
        }
    }
	
	var checknearcity2= "@";
	var checkStr = frm1.nearcity2.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checknearcity2.length;  j++)
		{
			if (ch == checknearcity2.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid  nearcity2 content! Please enter your valid nearcity2.");
				frm1.nearcity2.focus();
				return(false);
			}
		}  
    }

var ph2= Trim(frm1.nearphone2.value);
	frm1.nearphone2.value=ph2;
	
var strng=frm1.nearphone2.value	;

	var stripped = strng.replace(/[\(\)\.\-\ ]/g, '');

//strip out acceptable non-numeric characters;

if (isNaN(parseInt(stripped))) 

{

   alert("The second relation phone number contains illegal characters.");

   frm1.nearphone2.focus();

	return (false);

}

var strng=frm1.nearphone2.value;

var Chars = "0123456789()-+ ";

  	if (frm1.nearphone2.value =="")

     		{

     		alert("Specify your second relation phone  numbers");

		frm1.nearphone2.focus();

		return (false);

		}	

	for (i =0; i <= strng.length -1; i++)

	 {

		if (Chars.indexOf(strng.charAt(i)) == -1) 

		{

 			alert("Specify your second relation phone number");

			frm1.nearphone2.focus();

			return (false);

		}

	}


// Check for 3rd Nearest Relative
	if(frm1.near3.selectedIndex==0)
	{
        alert("Pls. select your 3rd nearest relatives.");
		frm1.near3.focus();
		return (false);
	}

	var checknname= Trim(frm1.nearname3.value);
	frm1.nearname3.value=checknname;
	
	if (frm1.nearname3.value == "")
	{
		alert("Pls. write full name of your nearest relatives.");
		frm1.nearname3.focus();
		return (false);
	}

	var checknearname3= frm1.nearname3.value;

    for(var i = 0; i < checknearname3.length; i++)
    {
         if (!checknearname3.charAt(i).match(regExp))
         {
            alert("Invalid Content!");
			frm1.nearname3.focus();
            return false;
         }
    }
	
	var checknearname3= "@";
	var checkStr = frm1.nearname3.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checknearname3.length;  j++)
		{
			if (ch == checknearname3.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid  nearname3 content! Please enter your valid nearname3.");
				frm1.nearname3.focus();
				return(false);
			}
		}  
    }

var checkncity3= Trim(frm1.nearcity3.value);
	frm1.nearcity3.value=checkncity3;

if (frm1.nearcity3.value == "")

	{

	alert("Pls. write city name.");

	frm1.nearcity3.focus();

	return (false);

	}
	
	var checknearcity3= frm1.nearcity3.value;

          for(var i = 0; i < checknearcity3.length; i++)

          {

            if (!checknearcity3.charAt(i).match(regExp))

            {
            alert("Invalid Content!");
			frm1.nearcity3.focus();
              return false;

            }

          }

	var checknearcity3= "@";

	var checkStr = frm1.nearcity3.value;

		for (i = 0;  i < checkStr.length;  i++)

		{

			ch = checkStr.charAt(i);

				for (j = 0;  j < checknearcity3.length;  j++)

				{

					if (ch == checknearcity3.charAt(j) && ch == "@")

					{	

					alert("'@' is Invalid  nearcity3 content! Please enter your valid nearcity3.");

					frm1.nearcity3.focus();

					return(false);

				   }

				 }  

        }

var ph3= Trim(frm1.nearphone3.value);
	frm1.nearphone3.value=ph3;

var strng=frm1.nearphone3.value;

	var stripped = strng.replace(/[\(\)\.\-\ ]/g, '');

//strip out acceptable non-numeric characters;

if (isNaN(parseInt(stripped))) 

{

   alert("The third relation phone number contains illegal characters.");

	frm1.nearphone3.focus();

	return (false);

}

var strng=frm1.nearphone3.value;

var Chars = "0123456789()-+ ";

  	if (frm1.nearphone3.value =="")

     	{

     	alert("Specify your third relation phone numbers");

	frm1.nearphone3.focus();

	return (false);

	}	

	for (i =0; i <= strng.length -1; i++) {

		if (Chars.indexOf(strng.charAt(i)) == -1) 

		{

 	alert("Specify your third relation phone numbers");

	frm1.nearphone3.focus();

	return (false);

	}

}


// Check for 4th Nearest Relative
	if(frm1.near4.selectedIndex==0)
	{
        alert("Pls. select your 4th nearest relatives.");
		frm1.near4.focus();
		return (false);
	}

	var checknname= Trim(frm1.nearname4.value);
	frm1.nearname4.value=checknname;
	
	if (frm1.nearname4.value == "")
	{
		alert("Pls. write full name of your nearest relatives.");
		frm1.nearname4.focus();
		return (false);
	}
	
	var checknearname4= frm1.nearname4.value;

    for(var i = 0; i < checknearname4.length; i++)
    {
    	if (!checknearname4.charAt(i).match(regExp))
        {
            alert("Invalid Content!");
			frm1.nearname4.focus();
            return false;
        }
    }

	var checknearname4= "@";
	var checkStr = frm1.nearname4.value;

	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checknearname4.length;  j++)
		{
			if (ch == checknearname4.charAt(j) && ch == "@")
			{	
				alert("'@' is Invalid  nearname4 content! Please enter your valid nearname4.");
				frm1.nearname4.focus();
				return(false);
			}
		}  
     }

	var checkncity4= Trim(frm1.nearcity4.value);
	frm1.nearcity4.value=checkncity4;
	
if (frm1.nearcity4.value == "")

	{

	alert("Pls. write city name.");

	frm1.nearcity4.focus();

	return (false);

	}
var checknearcity4= frm1.nearcity4.value;

          for(var i = 0; i < checknearcity4.length; i++)

          {

            if (!checknearcity4.charAt(i).match(regExp))

            {
            alert("Invalid Content!");
			frm1.nearcity4.focus();
              return false;

            }

          }
	var checknearcity4= "@";

	var checkStr = frm1.nearcity4.value;

		for (i = 0;  i < checkStr.length;  i++)

		{

			ch = checkStr.charAt(i);

				for (j = 0;  j < checknearcity4.length;  j++)

				{

					if (ch == checknearcity4.charAt(j) && ch == "@")

					{	

					alert("'@' is Invalid  nearcity4 content! Please enter your valid nearcity4.");

					frm1.nearcity4.focus();

					return(false);

				   }

				 }  

        }



		//*************Phone validation**********
var ph4= Trim(frm1.nearphone4.value);
	frm1.nearphone4.value=ph4;
	
	var strng=frm1.nearphone4.value	;

	var stripped = strng.replace(/[\(\)\.\-\ ]/g, '');

//strip out acceptable non-numeric characters;

if (isNaN(parseInt(stripped))) 

{

   alert("The fourth relation phone number contains illegal characters.");

   frm1.nearphone4.focus();

	return (false);

}

  

var strng=frm1.nearphone4.value	;

var Chars = "0123456789()-+ ";

  	if (frm1.nearphone4.value =="")

     	{

     	alert("Specify your fourth relation phone numbers");

	frm1.nearphone4.focus();

	return (false);

	}	

	for (i =0; i <= strng.length -1; i++) 

	{

		if (Chars.indexOf(strng.charAt(i)) == -1) 

		{

	 	alert("Specify your fourth relation phone numbers");

		frm1.nearphone4.focus();

		return (false);

		}

	}

	// check if the first drop down is selected, if so, invalid selection in heard

	if (frm1.heard.selectedIndex == 0)

	{

	alert("Where did you hear about jain4jain.com from?");

	frm1.heard.focus();

	return (false);

	}

	// check if Terms is blank

	if (frm1.acceptterms.checked == false)

	{

	alert("Pls. select the box  to accept the Terms and Conditions of Services provided by jain4jain.com.");

	frm1.acceptterms.focus();

	return (false); 

	}	



}


