function validate(formName){
	//alert("formName"+formName);
	
	//Muhurtham
	if(formName == 'aksharabhyasam'){
		return aksharabhyasam();
	}else if(formName == 'annaprasana'){
		return annaprasana();
	}else if(formName == 'bhoomipooja'){
		return bhoomipooja();
	}else if(formName == 'newbusiness'){
		return newbusiness();
	}else if(formName == 'buyhouse'){
		return buyhouse();
	}else if(formName == 'buylandsproperty'){
		return buylandsproperty();
	}else if(formName == 'engagement'){
		return engagement();
	}else if(formName == 'gruhapravesam'){
		return gruhapravesam();
	}else if(formName == 'jobvisaintrvw'){
		return jobvisaintrvw();
	}else if(formName == 'mangalsutra'){
		return mangalsutra();
	}else if(formName == 'marriage'){
		return marriage();
	}else if(formName == 'namakaranam'){
		return namakaranam();
	}else if(formName == 'newjob'){
		return newjob();
	}else if(formName == 'operation'){
		return operation();
	}else if(formName == 'pranapratheestha'){
		return pranapratheestha();
	}else if(formName == 'templeconst'){
		return templeconst();
	}
}


//*************************************************************************************
//******************** AKSHARABHYASAM ***********************************************
//*************************************************************************************
function aksharabhyasam(){
	if (document.aksharabhyasam.firstname.value == "")
	{
		alert("Please enter your First Name");
		document.aksharabhyasam.firstname.focus();
		return (false);
	}
	if (document.aksharabhyasam.lastname.value == "")
	{
		alert("Please enter your Last Name");
		document.aksharabhyasam.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0;  i < document.aksharabhyasam.gender.length;  i++)
	{
		if (document.aksharabhyasam.gender[i].checked)
			radioSelected = true;
		}
	if (!radioSelected)
	{
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.aksharabhyasam.month.selectedIndex <= 0)
	{
		alert("Please select valid Month.");
		document.aksharabhyasam.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.aksharabhyasam.date.selectedIndex <= 0)
	{
		alert("Please select a valid Date.");
		document.aksharabhyasam.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.aksharabhyasam.year.selectedIndex <= 0)
	{
		alert("Please select a valid Year.");
		document.aksharabhyasam.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.aksharabhyasam.hour.selectedIndex <= 0)
	{
		alert("Please select valid Hours.");
		document.aksharabhyasam.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.aksharabhyasam.minutes.selectedIndex <= 0)
	{
		alert("Please select valid Minutes.");
		document.aksharabhyasam.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.aksharabhyasam.am_pm.selectedIndex <= 0)
	{
		alert("Please select either the time of birth as AM or PM.");
		document.aksharabhyasam.am_pm.focus();
		return (false);
	}
	if (document.aksharabhyasam.city.value == "")
	{
		alert("Please enter your City of Birth");
		document.aksharabhyasam.city.focus();
		return (false);
	}
	if (document.aksharabhyasam.nearcity.value == "")
	{
		alert("Please enter your nearest City of Birth");
		document.aksharabhyasam.nearcity.focus();
		return (false);
	}
	if (document.aksharabhyasam.country.value == "")
	{
		alert("Please enter your Country of Birth");
		document.aksharabhyasam.country.focus();
		return (false);
	}
	if (document.aksharabhyasam.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.aksharabhyasam.currentcountry.focus();
		return (false);
	}
	if (document.aksharabhyasam.email_id.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		document.aksharabhyasam.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.aksharabhyasam.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.aksharabhyasam.email_id.focus();
		return (false);
	}
}
//*************************************************************************************
//******************** ANNAPRASANA ***********************************************
//*************************************************************************************
function annaprasana(){
	if (document.annaprasana.firstname.value == "")
	{
		alert("Please enter your First Name");
		document.annaprasana.firstname.focus();
		return (false);
	}
	if (document.annaprasana.lastname.value == "")
	{
		alert("Please enter your Last Name");
		document.annaprasana.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0;  i < document.annaprasana.gender.length;  i++)
	{
		if (document.annaprasana.gender[i].checked)
			radioSelected = true;
		}
	if (!radioSelected)
	{
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.annaprasana.month.selectedIndex <= 0)
	{
		alert("Please select valid Month.");
		document.annaprasana.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.annaprasana.date.selectedIndex <= 0)
	{
		alert("Please select a valid Date.");
		document.annaprasana.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.annaprasana.year.selectedIndex <= 0)
	{
		alert("Please select a valid Year.");
		document.annaprasana.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.annaprasana.hour.selectedIndex <= 0)
	{
		alert("Please select valid Hours.");
		document.annaprasana.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.annaprasana.minutes.selectedIndex <= 0)
	{
		alert("Please select valid Minutes.");
		document.annaprasana.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.annaprasana.am_pm.selectedIndex <= 0)
	{
		alert("Please select either the time of birth as AM or PM.");
		document.annaprasana.am_pm.focus();
		return (false);
	}
	if (document.annaprasana.city.value == "")
	{
		alert("Please enter your City of Birth");
		document.annaprasana.city.focus();
		return (false);
	}
	if (document.annaprasana.nearcity.value == "")
	{
		alert("Please enter your nearest City of Birth");
		document.annaprasana.nearcity.focus();
		return (false);
	}
	if (document.annaprasana.country.value == "")
	{
		alert("Please enter your Country of Birth");
		document.annaprasana.country.focus();
		return (false);
	}
	if (document.annaprasana.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.annaprasana.currentcountry.focus();
		return (false);
	}
	if (document.annaprasana.email_id.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		document.annaprasana.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.annaprasana.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.annaprasana.email_id.focus();
		return (false);
	}
}
//*************************************************************************************
//******************** BHOOMI POOJA ***********************************************
//*************************************************************************************
function bhoomipooja(){
	if (document.bhoomipooja.firstname.value == "")
	{
		alert("Please enter your First Name");
		document.bhoomipooja.firstname.focus();
		return (false);
	}
	if (document.bhoomipooja.lastname.value == "")
	{
		alert("Please enter your Last Name");
		document.bhoomipooja.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0;  i < document.bhoomipooja.gender.length;  i++)
	{
		if (document.bhoomipooja.gender[i].checked)
			radioSelected = true;
		}
	if (!radioSelected)
	{
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.bhoomipooja.month.selectedIndex <= 0)
	{
		alert("Please select valid Month.");
		document.bhoomipooja.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.bhoomipooja.date.selectedIndex <= 0)
	{
		alert("Please select a valid Date.");
		document.bhoomipooja.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.bhoomipooja.year.selectedIndex <= 0)
	{
		alert("Please select a valid Year.");
		document.bhoomipooja.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.bhoomipooja.hour.selectedIndex <= 0)
	{
		alert("Please select valid Hours.");
		document.bhoomipooja.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.bhoomipooja.minutes.selectedIndex <= 0)
	{
		alert("Please select valid Minutes.");
		document.bhoomipooja.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.bhoomipooja.am_pm.selectedIndex <= 0)
	{
		alert("Please select either the time of birth as AM or PM.");
		document.bhoomipooja.am_pm.focus();
		return (false);
	}
	if (document.bhoomipooja.city.value == "")
	{
		alert("Please enter your City of Birth");
		document.bhoomipooja.city.focus();
		return (false);
	}
	if (document.bhoomipooja.nearcity.value == "")
	{
		alert("Please enter your nearest City of Birth");
		document.bhoomipooja.nearcity.focus();
		return (false);
	}
	if (document.bhoomipooja.country.value == "")
	{
		alert("Please enter your Country of Birth");
		document.bhoomipooja.country.focus();
		return (false);
	}
	if (document.bhoomipooja.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.bhoomipooja.currentcountry.focus();
		return (false);
	}
	if (document.bhoomipooja.email_id.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		document.bhoomipooja.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.bhoomipooja.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.bhoomipooja.email_id.focus();
		return (false);
	}
}

//*************************************************************************************
//******************** NEW BUSINESS ***********************************************
//*************************************************************************************
function newbusiness(){
	if (document.newbusiness.firstname.value == "")
	{
		alert("Please enter your First Name");
		document.newbusiness.firstname.focus();
		return (false);
	}
	if (document.newbusiness.lastname.value == "")
	{
		alert("Please enter your Last Name");
		document.newbusiness.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0;  i < document.newbusiness.gender.length;  i++)
	{
		if (document.newbusiness.gender[i].checked)
			radioSelected = true;
		}
	if (!radioSelected)
	{
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.newbusiness.month.selectedIndex <= 0)
	{
		alert("Please select valid Month.");
		document.newbusiness.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.newbusiness.date.selectedIndex <= 0)
	{
		alert("Please select a valid Date.");
		document.newbusiness.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.newbusiness.year.selectedIndex <= 0)
	{
		alert("Please select a valid Year.");
		document.newbusiness.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.newbusiness.hour.selectedIndex <= 0)
	{
		alert("Please select valid Hours.");
		document.newbusiness.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.newbusiness.minutes.selectedIndex <= 0)
	{
		alert("Please select valid Minutes.");
		document.newbusiness.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.newbusiness.am_pm.selectedIndex <= 0)
	{
		alert("Please select either the time of birth as AM or PM.");
		document.newbusiness.am_pm.focus();
		return (false);
	}
	if (document.newbusiness.city.value == "")
	{
		alert("Please enter your City of Birth");
		document.newbusiness.city.focus();
		return (false);
	}
	if (document.newbusiness.nearcity.value == "")
	{
		alert("Please enter your nearest City of Birth");
		document.newbusiness.nearcity.focus();
		return (false);
	}
	if (document.newbusiness.country.value == "")
	{
		alert("Please enter your Country of Birth");
		document.newbusiness.country.focus();
		return (false);
	}
	if (document.newbusiness.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.newbusiness.currentcountry.focus();
		return (false);
	}
	if (document.newbusiness.email_id.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		document.newbusiness.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.newbusiness.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.newbusiness.email_id.focus();
		return (false);
	}
}

//*************************************************************************************
//******************** BUYING HOUSE ***********************************************
//*************************************************************************************
function buyhouse(){
	if (document.buyhouse.firstname.value == "")
	{
		alert("Please enter your First Name");
		document.buyhouse.firstname.focus();
		return (false);
	}
	if (document.buyhouse.lastname.value == "")
	{
		alert("Please enter your Last Name");
		document.buyhouse.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0;  i < document.buyhouse.gender.length;  i++)
	{
		if (document.buyhouse.gender[i].checked)
			radioSelected = true;
		}
	if (!radioSelected)
	{
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.buyhouse.month.selectedIndex <= 0)
	{
		alert("Please select valid Month.");
		document.buyhouse.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.buyhouse.date.selectedIndex <= 0)
	{
		alert("Please select a valid Date.");
		document.buyhouse.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.buyhouse.year.selectedIndex <= 0)
	{
		alert("Please select a valid Year.");
		document.buyhouse.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.buyhouse.hour.selectedIndex <= 0)
	{
		alert("Please select valid Hours.");
		document.buyhouse.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.buyhouse.minutes.selectedIndex <= 0)
	{
		alert("Please select valid Minutes.");
		document.buyhouse.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.buyhouse.am_pm.selectedIndex <= 0)
	{
		alert("Please select either the time of birth as AM or PM.");
		document.buyhouse.am_pm.focus();
		return (false);
	}
	if (document.buyhouse.city.value == "")
	{
		alert("Please enter your City of Birth");
		document.buyhouse.city.focus();
		return (false);
	}
	if (document.buyhouse.nearcity.value == "")
	{
		alert("Please enter your nearest City of Birth");
		document.buyhouse.nearcity.focus();
		return (false);
	}
	if (document.buyhouse.country.value == "")
	{
		alert("Please enter your Country of Birth");
		document.buyhouse.country.focus();
		return (false);
	}
	if (document.buyhouse.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.buyhouse.currentcountry.focus();
		return (false);
	}
	if (document.buyhouse.email_id.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		document.buyhouse.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.buyhouse.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.buyhouse.email_id.focus();
		return (false);
	}
}

//*************************************************************************************
//******************** BUY LANDS PROPERTY  ***********************************************
//*************************************************************************************
function buylandsproperty() {
	if (document.buylandsproperty.firstname.value == "") {
		alert("Please enter your First Name");
		document.buylandsproperty.firstname.focus();
		return (false);
	}
	if (document.buylandsproperty.lastname.value == "") {
		alert("Please enter your Last Name");
		document.buylandsproperty.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0; i < document.buylandsproperty.gender.length; i++) {
		if (document.buylandsproperty.gender[i].checked)
			radioSelected = true;
	}
	if (!radioSelected) {
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.buylandsproperty.month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.buylandsproperty.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.buylandsproperty.date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.buylandsproperty.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.buylandsproperty.year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.buylandsproperty.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.buylandsproperty.hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.buylandsproperty.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.buylandsproperty.minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.buylandsproperty.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.buylandsproperty.am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.buylandsproperty.am_pm.focus();
		return (false);
	}
	if (document.buylandsproperty.city.value == "") {
		alert("Please enter your City of Birth");
		document.buylandsproperty.city.focus();
		return (false);
	}
	if (document.buylandsproperty.nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.buylandsproperty.nearcity.focus();
		return (false);
	}
	if (document.buylandsproperty.country.value == "") {
		alert("Please enter your Country of Birth");
		document.buylandsproperty.country.focus();
		return (false);
	}
	if (document.buylandsproperty.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.buylandsproperty.currentcountry.focus();
		return (false);
	}
	if (document.buylandsproperty.email_id.value == "") {
		alert("Please enter a value for the \"Email\" field.");
		document.buylandsproperty.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.buylandsproperty.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.buylandsproperty.email_id.focus();
		return (false);
	}
}

//*************************************************************************************
//******************** ENGAGEMENT  ***********************************************
//*************************************************************************************
function engagement() {
	if (document.engagement.b_firstname.value == "") {
		alert("Please enter bride's First Name");
		document.engagement.b_firstname.focus();
		return (false);
	}
	if (document.engagement.b_lastname.value == "") {
		alert("Please enter bride's Last Name");
		document.engagement.b_lastname.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.b_month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.engagement.b_month.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.b_date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.engagement.b_date.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.b_year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.engagement.b_year.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.b_hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.engagement.b_hour.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.b_minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.engagement.b_minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.b_am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.engagement.b_am_pm.focus();
		return (false);
	}
	if (document.engagement.b_city.value == "") {
		alert("Please enter your City of Birth");
		document.engagement.b_city.focus();
		return (false);
	}
	if (document.engagement.b_nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.engagement.b_nearcity.focus();
		return (false);
	}
	if (document.engagement.b_country.value == "") {
		alert("Please enter your Country of Birth");
		document.engagement.b_country.focus();
		return (false);
	}
	//GROOM DETAILS
	if (document.engagement.g_firstname.value == "") {
		alert("Please enter bride's First Name");
		document.engagement.g_firstname.focus();
		return (false);
	}
	if (document.engagement.g_lastname.value == "") {
		alert("Please enter bride's Last Name");
		document.engagement.g_lastname.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.g_month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.engagement.g_month.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.g_date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.engagement.g_date.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.g_year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.engagement.g_year.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.g_hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.engagement.g_hour.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.g_minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.engagement.g_minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.engagement.g_am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.engagement.g_am_pm.focus();
		return (false);
	}
	if (document.engagement.g_city.value == "") {
		alert("Please enter your City of Birth");
		document.engagement.g_city.focus();
		return (false);
	}
	if (document.engagement.g_nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.engagement.g_nearcity.focus();
		return (false);
	}
	if (document.engagement.g_country.value == "") {
		alert("Please enter your Country of Birth");
		document.engagement.g_country.focus();
		return (false);
	}
	if (document.engagement.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.engagement.currentcountry.focus();
		return (false);
	}
	if (document.engagement.email_id.value == "") {
		alert("Please enter a value for the \"Email\" field.");
		document.engagement.email_id.focus();
		return (false);
	}

	//  test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.engagement.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.engagement.email_id.focus();
		return (false);
	}
}

//*************************************************************************************
//******************** GRUHA PRAVESAM ***********************************************
//*************************************************************************************
function gruhapravesam() {
	if (document.gruhapravesam.firstname.value == "") {
		alert("Please enter your First Name");
		document.gruhapravesam.firstname.focus();
		return (false);
	}
	if (document.gruhapravesam.lastname.value == "") {
		alert("Please enter your Last Name");
		document.gruhapravesam.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0; i < document.gruhapravesam.gender.length; i++) {
		if (document.gruhapravesam.gender[i].checked)
			radioSelected = true;
	}
	if (!radioSelected) {
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.gruhapravesam.month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.gruhapravesam.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.gruhapravesam.date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.gruhapravesam.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.gruhapravesam.year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.gruhapravesam.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.gruhapravesam.hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.gruhapravesam.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.gruhapravesam.minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.gruhapravesam.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.gruhapravesam.am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.gruhapravesam.am_pm.focus();
		return (false);
	}
	if (document.gruhapravesam.city.value == "") {
		alert("Please enter your City of Birth");
		document.gruhapravesam.city.focus();
		return (false);
	}
	if (document.gruhapravesam.nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.gruhapravesam.nearcity.focus();
		return (false);
	}
	if (document.gruhapravesam.country.value == "") {
		alert("Please enter your Country of Birth");
		document.gruhapravesam.country.focus();
		return (false);
	}
	if (document.gruhapravesam.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.gruhapravesam.currentcountry.focus();
		return (false);
	}
	if (document.gruhapravesam.email_id.value == "") {
		alert("Please enter a value for the \"Email\" field.");
		document.gruhapravesam.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.gruhapravesam.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.gruhapravesam.email_id.focus();
		return (false);
	}
}

//*************************************************************************************
//******************** JOB VISA INTERVIEW ***********************************************
//*************************************************************************************
function jobvisaintrvw() {
	if (document.jobvisaintrvw.firstname.value == "") {
		alert("Please enter your First Name");
		document.jobvisaintrvw.firstname.focus();
		return (false);
	}
	if (document.jobvisaintrvw.lastname.value == "") {
		alert("Please enter your Last Name");
		document.jobvisaintrvw.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0; i < document.jobvisaintrvw.gender.length; i++) {
		if (document.jobvisaintrvw.gender[i].checked)
			radioSelected = true;
	}
	if (!radioSelected) {
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.jobvisaintrvw.month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.jobvisaintrvw.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.jobvisaintrvw.date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.jobvisaintrvw.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.jobvisaintrvw.year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.jobvisaintrvw.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.jobvisaintrvw.hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.jobvisaintrvw.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.jobvisaintrvw.minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.jobvisaintrvw.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.jobvisaintrvw.am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.jobvisaintrvw.am_pm.focus();
		return (false);
	}
	if (document.jobvisaintrvw.city.value == "") {
		alert("Please enter your City of Birth");
		document.jobvisaintrvw.city.focus();
		return (false);
	}
	if (document.jobvisaintrvw.nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.jobvisaintrvw.nearcity.focus();
		return (false);
	}
	if (document.jobvisaintrvw.country.value == "") {
		alert("Please enter your Country of Birth");
		document.jobvisaintrvw.country.focus();
		return (false);
	}
	if (document.jobvisaintrvw.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.jobvisaintrvw.currentcountry.focus();
		return (false);
	}
	if (document.jobvisaintrvw.email_id.value == "") {
		alert("Please enter a value for the \"Email\" field.");
		document.jobvisaintrvw.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.jobvisaintrvw.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.jobvisaintrvw.email_id.focus();
		return (false);
	}
}

//*************************************************************************************
//******************** BUYING MANGALSUTRA ***********************************************
//*************************************************************************************
function mangalsutra() {
	if (document.mangalsutra.firstname.value == "") {
		alert("Please enter your First Name");
		document.mangalsutra.firstname.focus();
		return (false);
	}
	if (document.mangalsutra.lastname.value == "") {
		alert("Please enter your Last Name");
		document.mangalsutra.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0; i < document.mangalsutra.gender.length; i++) {
		if (document.mangalsutra.gender[i].checked)
			radioSelected = true;
	}
	if (!radioSelected) {
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.mangalsutra.month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.mangalsutra.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.mangalsutra.date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.mangalsutra.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.mangalsutra.year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.mangalsutra.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.mangalsutra.hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.mangalsutra.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.mangalsutra.minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.mangalsutra.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.mangalsutra.am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.mangalsutra.am_pm.focus();
		return (false);
	}
	if (document.mangalsutra.city.value == "") {
		alert("Please enter your City of Birth");
		document.mangalsutra.city.focus();
		return (false);
	}
	if (document.mangalsutra.nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.mangalsutra.nearcity.focus();
		return (false);
	}
	if (document.mangalsutra.country.value == "") {
		alert("Please enter your Country of Birth");
		document.mangalsutra.country.focus();
		return (false);
	}
	if (document.mangalsutra.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.mangalsutra.currentcountry.focus();
		return (false);
	}
	if (document.mangalsutra.email_id.value == "") {
		alert("Please enter a value for the \"Email\" field.");
		document.mangalsutra.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.mangalsutra.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.mangalsutra.email_id.focus();
		return (false);
	}
}

//*************************************************************************************
//******************** MARRIAGE ***********************************************
//*************************************************************************************
function marriage() {
	if (document.marriage.b_firstname.value == "") {
		alert("Please enter bride's First Name");
		document.marriage.b_firstname.focus();
		return (false);
	}
	if (document.marriage.b_lastname.value == "") {
		alert("Please enter bride's Last Name");
		document.marriage.b_lastname.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.b_month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.marriage.b_month.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.b_date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.marriage.b_date.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.b_year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.marriage.b_year.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.b_hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.marriage.b_hour.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.b_minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.marriage.b_minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.b_am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.marriage.b_am_pm.focus();
		return (false);
	}
	if (document.marriage.b_city.value == "") {
		alert("Please enter your City of Birth");
		document.marriage.b_city.focus();
		return (false);
	}
	if (document.marriage.b_nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.marriage.b_nearcity.focus();
		return (false);
	}
	if (document.marriage.b_country.value == "") {
		alert("Please enter your Country of Birth");
		document.marriage.b_country.focus();
		return (false);
	}
	//GROOM DETAILS
	if (document.marriage.g_firstname.value == "") {
		alert("Please enter bride's First Name");
		document.marriage.g_firstname.focus();
		return (false);
	}
	if (document.marriage.g_lastname.value == "") {
		alert("Please enter bride's Last Name");
		document.marriage.g_lastname.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.g_month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.marriage.g_month.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.g_date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.marriage.g_date.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.g_year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.marriage.g_year.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.g_hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.marriage.g_hour.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.g_minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.marriage.g_minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.marriage.g_am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.marriage.g_am_pm.focus();
		return (false);
	}
	if (document.marriage.g_city.value == "") {
		alert("Please enter your City of Birth");
		document.marriage.g_city.focus();
		return (false);
	}
	if (document.marriage.g_nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.marriage.g_nearcity.focus();
		return (false);
	}
	if (document.marriage.g_country.value == "") {
		alert("Please enter your Country of Birth");
		document.marriage.g_country.focus();
		return (false);
	}
	if (document.marriage.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.marriage.currentcountry.focus();
		return (false);
	}
	if (document.marriage.email_id.value == "") {
		alert("Please enter a value for the \"Email\" field.");
		document.marriage.email_id.focus();
		return (false);
	}

	//  test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.marriage.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.marriage.email_id.focus();
		return (false);
	}
}

//*************************************************************************************
//******************** NAMAKARANAM ***********************************************
//*************************************************************************************
function namakaranam() {
	if (document.namakaranam.firstname.value == "") {
		alert("Please enter your First Name");
		document.namakaranam.firstname.focus();
		return (false);
	}
	if (document.namakaranam.lastname.value == "") {
		alert("Please enter your Last Name");
		document.namakaranam.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0; i < document.namakaranam.gender.length; i++) {
		if (document.namakaranam.gender[i].checked)
			radioSelected = true;
	}
	if (!radioSelected) {
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.namakaranam.month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.namakaranam.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.namakaranam.date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.namakaranam.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.namakaranam.year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.namakaranam.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.namakaranam.hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.namakaranam.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.namakaranam.minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.namakaranam.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.namakaranam.am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.namakaranam.am_pm.focus();
		return (false);
	}
	if (document.namakaranam.city.value == "") {
		alert("Please enter your City of Birth");
		document.namakaranam.city.focus();
		return (false);
	}
	if (document.namakaranam.nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.namakaranam.nearcity.focus();
		return (false);
	}
	if (document.namakaranam.country.value == "") {
		alert("Please enter your Country of Birth");
		document.namakaranam.country.focus();
		return (false);
	}
	if (document.namakaranam.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.namakaranam.currentcountry.focus();
		return (false);
	}
	if (document.namakaranam.email_id.value == "") {
		alert("Please enter a value for the \"Email\" field.");
		document.namakaranam.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.namakaranam.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.namakaranam.email_id.focus();
		return (false);
	}
}

//*************************************************************************************
//******************** NEW JOB START ***********************************************
//*************************************************************************************
function newjob() {
	if (document.newjob.firstname.value == "") {
		alert("Please enter your First Name");
		document.newjob.firstname.focus();
		return (false);
	}
	if (document.newjob.lastname.value == "") {
		alert("Please enter your Last Name");
		document.newjob.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0; i < document.newjob.gender.length; i++) {
		if (document.newjob.gender[i].checked)
			radioSelected = true;
	}
	if (!radioSelected) {
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.newjob.month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.newjob.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.newjob.date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.newjob.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.newjob.year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.newjob.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.newjob.hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.newjob.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.newjob.minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.newjob.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.newjob.am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.newjob.am_pm.focus();
		return (false);
	}
	if (document.newjob.city.value == "") {
		alert("Please enter your City of Birth");
		document.newjob.city.focus();
		return (false);
	}
	if (document.newjob.nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.newjob.nearcity.focus();
		return (false);
	}
	if (document.newjob.country.value == "") {
		alert("Please enter your Country of Birth");
		document.newjob.country.focus();
		return (false);
	}
	if (document.newjob.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.newjob.currentcountry.focus();
		return (false);
	}
	if (document.newjob.email_id.value == "") {
		alert("Please enter a value for the \"Email\" field.");
		document.newjob.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.newjob.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.newjob.email_id.focus();
		return (false);
	}
}

//*************************************************************************************
//******************** OPERATION ***********************************************
//*************************************************************************************
function operation() {
	if (document.operation.firstname.value == "") {
		alert("Please enter your First Name");
		document.operation.firstname.focus();
		return (false);
	}
	if (document.operation.lastname.value == "") {
		alert("Please enter your Last Name");
		document.operation.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0; i < document.operation.gender.length; i++) {
		if (document.operation.gender[i].checked)
			radioSelected = true;
	}
	if (!radioSelected) {
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.operation.month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.operation.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.operation.date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.operation.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.operation.year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.operation.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.operation.hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.operation.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.operation.minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.operation.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.operation.am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.operation.am_pm.focus();
		return (false);
	}
	if (document.operation.city.value == "") {
		alert("Please enter your City of Birth");
		document.operation.city.focus();
		return (false);
	}
	if (document.operation.nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.operation.nearcity.focus();
		return (false);
	}
	if (document.operation.country.value == "") {
		alert("Please enter your Country of Birth");
		document.operation.country.focus();
		return (false);
	}
	if (document.operation.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.operation.currentcountry.focus();
		return (false);
	}
	if (document.operation.email_id.value == "") {
		alert("Please enter a value for the \"Email\" field.");
		document.operation.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.operation.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.operation.email_id.focus();
		return (false);
	}
}


//*************************************************************************************
//******************** PRANAPRATHEESTHA ***********************************************
//*************************************************************************************
function pranapratheestha() {
	if (document.pranapratheestha.firstname.value == "") {
		alert("Please enter your First Name");
		document.pranapratheestha.firstname.focus();
		return (false);
	}
	if (document.pranapratheestha.lastname.value == "") {
		alert("Please enter your Last Name");
		document.pranapratheestha.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0; i < document.pranapratheestha.gender.length; i++) {
		if (document.pranapratheestha.gender[i].checked)
			radioSelected = true;
	}
	if (!radioSelected) {
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.pranapratheestha.month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.pranapratheestha.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.pranapratheestha.date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.pranapratheestha.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.pranapratheestha.year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.pranapratheestha.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.pranapratheestha.hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.pranapratheestha.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.pranapratheestha.minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.pranapratheestha.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.pranapratheestha.am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.pranapratheestha.am_pm.focus();
		return (false);
	}
	if (document.pranapratheestha.city.value == "") {
		alert("Please enter your City of Birth");
		document.pranapratheestha.city.focus();
		return (false);
	}
	if (document.pranapratheestha.nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.pranapratheestha.nearcity.focus();
		return (false);
	}
	if (document.pranapratheestha.country.value == "") {
		alert("Please enter your Country of Birth");
		document.pranapratheestha.country.focus();
		return (false);
	}
	if (document.pranapratheestha.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.pranapratheestha.currentcountry.focus();
		return (false);
	}
	if (document.pranapratheestha.email_id.value == "") {
		alert("Please enter a value for the \"Email\" field.");
		document.pranapratheestha.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.pranapratheestha.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.pranapratheestha.email_id.focus();
		return (false);
	}
}


//*************************************************************************************
//******************** TEMPLE CONST ***********************************************
//*************************************************************************************
function templeconst() {
	if (document.templeconst.firstname.value == "") {
		alert("Please enter your First Name");
		document.templeconst.firstname.focus();
		return (false);
	}
	if (document.templeconst.lastname.value == "") {
		alert("Please enter your Last Name");
		document.templeconst.lastname.focus();
		return (false);
	}

	//  require at least one radio button be selected
	var radioSelected = false;
	for (var i = 0; i < document.templeconst.gender.length; i++) {
		if (document.templeconst.gender[i].checked)
			radioSelected = true;
	}
	if (!radioSelected) {
		alert("Please select the Gender");
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.templeconst.month.selectedIndex <= 0) {
		alert("Please select valid Month.");
		document.templeconst.month.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.templeconst.date.selectedIndex <= 0) {
		alert("Please select a valid Date.");
		document.templeconst.date.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.templeconst.year.selectedIndex <= 0) {
		alert("Please select a valid Year.");
		document.templeconst.year.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.templeconst.hour.selectedIndex <= 0) {
		alert("Please select valid Hours.");
		document.templeconst.hour.focus();
		return (false);
	}

	//   check if the first drop down is selected, if so, invalid selection
	if (document.templeconst.minutes.selectedIndex <= 0) {
		alert("Please select valid Minutes.");
		document.templeconst.minutes.focus();
		return (false);
	}
	//   check if the first drop down is selected, if so, invalid selection
	if (document.templeconst.am_pm.selectedIndex <= 0) {
		alert("Please select either the time of birth as AM or PM.");
		document.templeconst.am_pm.focus();
		return (false);
	}
	if (document.templeconst.city.value == "") {
		alert("Please enter your City of Birth");
		document.templeconst.city.focus();
		return (false);
	}
	if (document.templeconst.nearcity.value == "") {
		alert("Please enter your nearest City of Birth");
		document.templeconst.nearcity.focus();
		return (false);
	}
	if (document.templeconst.country.value == "") {
		alert("Please enter your Country of Birth");
		document.templeconst.country.focus();
		return (false);
	}
	if (document.templeconst.currentcountry.value == "")
	{
		alert("Please enter Current Country of Residence");
		document.templeconst.currentcountry.focus();
		return (false);
	}
	if (document.templeconst.email_id.value == "") {
		alert("Please enter a value for the \"Email\" field.");
		document.templeconst.email_id.focus();
		return (false);
	}
	//	   test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.templeconst.email_id.value;
	var EmailValid = false;
	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("The \"email\" field must contain an \"@\" and a \".\".");
		document.templeconst.email_id.focus();
		return (false);
	}
}
