function validateSubmit()
{
	if (isBlank()){
		if (isValEmail()){
			return true;
		} else { return false; }
	} else { return false; }
}

function isValEmail()
{  
	var email	= document.apply.email.value;
	
	if (email.indexOf('@') == '-1' || email.indexOf('@') == '0' || email.indexOf('.') == '-1' || email.indexOf('@') > email.indexOf('.') || email.indexOf('.') > (email.length - 3))
	{
		alert("Your email address appears to be incorrect. \n Please Try Again.");
		return false;
	}
	else 
	{	return true; 	}
}

function isBlank()
{
//  alert("isBlank is called.");

//Grabs the variables from the form.	
	var app_name	= document.apply.name.value;
//	alert(name);
	var address 	= document.apply.address.value;
//	alert(address);
	var city			= document.apply.city.value;
//	alert(city);
	var state			= document.apply.state.value;
//	alert(state);
	var zip 			= document.apply.zip.value;
//	alert(zip);
	var phone			= document.apply.phone.value;
//	alert(phone);
	var email			= document.apply.email.value;
//	alert(email);
	var position	= document.apply.position.value;
//	alert(position);
  var resume		= document.apply.resume.value;
//  alert(resume);

	i = 0; 	
	var Blanks = new Array()
	
	if (app_name == '') {	
		Blanks[0] = 'Name';	
		i++;
	}	
	if (address == '') { 	
		Blanks[1] = 'Mailing Address'; 	
		i++;
	}
	if (city == '') {	
		Blanks[2] = 'City';
		i++;
	} 
	if (state == '') {	
		Blanks[3] = 'State';		
		i++
	}
	if (zip == '') {	
		Blanks[4] = 'Postal Code';		
		i++
	}
	if (phone == '') {
		Blanks[5] = 'Phone Number';
		i++;
	}
	if (email == ''){
	  Blanks[6] = 'Email Address';
	  i++;
	}
	if (position == ''){
	  Blanks[7] = 'Position Listed';
	  i++;
	}
	if (resume == ''){
	  Blanks[8] = 'Resume';
	  i++;
	}
		  
	var Error = Blanks.join("\n")
 	
  	if (i >= 1)
  	{
		alert('The following required information appears to be blank: ' + '\n' + Error);
		return false;
  	}
  	else
  	{  	return true; 	}
}
	
	
