/* Function for Make an Enquiry Form */
function frm_apply(check)
{
	errorDetails = '';
	errorControl = '';
	resetTextBoxCSS(check.First_Name);
	resetTextBoxCSS(check.Last_Name);
	resetTextBoxCSS(check.Phone);
	resetTextBoxCSS(check.Email);
	resetTextBoxCSS(check.FILE1);
	
	if (check.First_Name.value == "")
	{
		applyErrorTextBoxCSS(check.First_Name);
		if (errorDetails == '')
		{
			errorControl = check.First_Name;
		}
		errorDetails = errorDetails + " - Please enter your first name\n";	
	}
	
	if (check.Last_Name.value == "")
	{
		applyErrorTextBoxCSS(check.Last_Name);
		if (errorDetails == '')
		{
			errorControl = check.Last_Name;
		}
		errorDetails = errorDetails + " - Please enter your last name\n";	
	}
	
	if (check.Phone.value == "")
	{
		applyErrorTextBoxCSS(check.Phone);
		if (errorDetails == '')
		{
			errorControl = check.Phone;
		}
		errorDetails = errorDetails + " - Please enter your best contactable number \n";	
	}
	
	
	if (check.Email.value == "")
	{
		applyErrorTextBoxCSS(check.Email);
		if (errorDetails == '')
		{
			errorControl = check.Email;
		}
		errorDetails = errorDetails + " - Please enter your valid Email address \n";
	}
	
	
	if (isValidEmail(check.Email.value)==false)
	{
		applyErrorTextBoxCSS(check.Email);
		if (errorDetails == '')
		{
			errorControl = check.Email;
		}
		errorDetails = errorDetails + " - Please enter your valid Email address\n";
	}
	
	if (check.FILE1.value == "")
	{
		applyErrorTextBoxCSS(check.FILE1);
		if (errorDetails == '')
		{
			errorControl = check.FILE1;
		}
		errorDetails = errorDetails + " - Please attach your resume\n";	
	}
	
	if (isValidFile(check.FILE1.value) == false)
	{
		applyErrorTextBoxCSS(check.FILE1);
		if (errorDetails == '')
		{
			errorControl = check.FILE1;
		}
		errorDetails = errorDetails + " - Please attach your resume in either a word format or PDF format\n";	
	}



	if (errorDetails == '')
	{
		
		return true;
	}
	else
	{
		alert('To submit the form you need to enter the following mandatory fields \n' + errorDetails);
		errorControl.focus();
		return false;
			
		
	}
}