// JavaScript Document
function validation1()
{

	// check if name field is blank	
	if(document.candidate_enquiry1.name.value == "")
	{
	alert("Enter your Name");
	document.candidate_enquiry1.name.focus();
	return (false);
	}

	// check if email field is blank
	if (document.candidate_enquiry1.email.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		document.candidate_enquiry1.email.focus();
		return (false);
	}
	// test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.candidate_enquiry1.email.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.candidate_enquiry1.email.focus();
	return (false);
	}
		
	// check if mobile field is blank
	if (document.candidate_enquiry1.mobile.value == "")
	{
	alert("Please enter the Mobile No.");
	document.candidate_enquiry1.mobile.focus();
	return (false);
	}
	var checkOK = "0123456789";
	var	checkStr = document.candidate_enquiry1.mobile.value;
	var allValid = true;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++)
	{
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
	if (ch == checkOK.charAt(j))
	break;
	if (j == checkOK.length)
	{
	allValid = false;
	break;
	}
	if (ch != ",")
	allNum += ch;
	}
	if (!allValid)
	{
	alert("Please enter only digit characters in the \"Mobile number\" field.");
	document.candidate_enquiry1.mobile.focus();
	return (false);
	}
	
	// check if Area of the problem field is blank	
	if(document.candidate_enquiry1.problem_area.value == "")
	{
	alert("Select Area of the problem");
	document.candidate_enquiry1.problem_area.focus();
	return (false);
	}
	
	// check if Subject field is blank	
	if(document.candidate_enquiry1.subject.value == "")
	{
	alert("Please enter subject of the enquiry");
	document.candidate_enquiry1.subject.focus();
	return (false);
	}
	
	// check if Detail of the problem field is blank	
	if(document.candidate_enquiry1.detail_problem.value == "")
	{
	alert("Please enter Detail of the problem");
	document.candidate_enquiry1.detail_problem.focus();
	return (false);
	}
			
			
return (true);
}

/* ===================================================================================================================== */

function validation2()
{

	// check if name field is blank	
	if(document.candidate_enquiry2.name.value == "")
	{
	alert("Enter your Name");
	document.candidate_enquiry2.name.focus();
	return (false);
	}

	// check if email field is blank
	if (document.candidate_enquiry2.email.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		document.candidate_enquiry2.email.focus();
		return (false);
	}
	// test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.candidate_enquiry2.email.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.candidate_enquiry2.email.focus();
	return (false);
	}
		
	// check if mobile field is blank
	if (document.candidate_enquiry2.mobile.value == "")
	{
	alert("Please enter the Mobile No.");
	document.candidate_enquiry2.mobile.focus();
	return (false);
	}
	var checkOK = "0123456789";
	var	checkStr = document.candidate_enquiry2.mobile.value;
	var allValid = true;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++)
	{
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
	if (ch == checkOK.charAt(j))
	break;
	if (j == checkOK.length)
	{
	allValid = false;
	break;
	}
	if (ch != ",")
	allNum += ch;
	}
	if (!allValid)
	{
	alert("Please enter only digit characters in the \"Mobile number\" field.");
	document.candidate_enquiry2.mobile.focus();
	return (false);
	}
	
	// check if Area of the problem field is blank	
	if(document.candidate_enquiry2.problem_area.value == "")
	{
	alert("Select Area of the problem");
	document.candidate_enquiry2.problem_area.focus();
	return (false);
	}
	
	// check if Subject field is blank	
	if(document.candidate_enquiry2.subject.value == "")
	{
	alert("Please enter subject of the enquiry");
	document.candidate_enquiry2.subject.focus();
	return (false);
	}
	
	// check if Detail of the problem field is blank	
	if(document.candidate_enquiry2.detail_problem.value == "")
	{
	alert("Please enter Detail of the problem");
	document.candidate_enquiry2.detail_problem.focus();
	return (false);
	}
			
return (true);
}

/* ===================================================================================================================== */
function validation3()
{

	// check if name field is blank	
	if(document.employer_enquiry.name.value == "")
	{
	alert("Enter your Name");
	document.employer_enquiry.name.focus();
	return (false);
	}

	// check if email field is blank
	if (document.employer_enquiry.email.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		document.employer_enquiry.email.focus();
		return (false);
	}
	// test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.employer_enquiry.email.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.employer_enquiry.email.focus();
	return (false);
	}
		
	// check if mobile field is blank
	if (document.employer_enquiry.mobile.value == "")
	{
	alert("Please enter the Mobile No.");
	document.employer_enquiry.mobile.focus();
	return (false);
	}
	var checkOK = "0123456789";
	var	checkStr = document.employer_enquiry.mobile.value;
	var allValid = true;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++)
	{
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
	if (ch == checkOK.charAt(j))
	break;
	if (j == checkOK.length)
	{
	allValid = false;
	break;
	}
	if (ch != ",")
	allNum += ch;
	}
	if (!allValid)
	{
	alert("Please enter only digit characters in the \"Mobile number\" field.");
	document.employer_enquiry.mobile.focus();
	return (false);
	}
	
	// check if Area of the problem field is blank	
	if(document.employer_enquiry.problem_area.value == "")
	{
	alert("Select Area of the problem");
	document.employer_enquiry.problem_area.focus();
	return (false);
	}
	
	// check if Subject field is blank	
	if(document.employer_enquiry.subject.value == "")
	{
	alert("Please enter subject of the enquiry");
	document.employer_enquiry.subject.focus();
	return (false);
	}
	
	// check if Detail of the problem field is blank	
	if(document.employer_enquiry.detail_problem.value == "")
	{
	alert("Please enter Detail of the problem");
	document.employer_enquiry.detail_problem.focus();
	return (false);
	}
			
return (true);
}
/* ===================================================================================================================== */