function validate() 
{
	var msg = "The following information is missing:\n\n";
	var goalert = false;
		if (contact.first_name.value == "") {
			msg += 'First Name\n';
			goalert = true;
		}
		
		if (contact.last_name.value == "") {
			msg += 'Last Name\n';
			goalert = true;
		}
		
		if (contact.email.value == "") {
			msg += 'Email\n';
			goalert = true;
		}
		
		if (contact.description.value == "") {
			msg += 'Message\n';
			goalert = true;
		}
	
	if (goalert == true) {
		alert(msg);
		return false;
	} else {
		var e = contact.email.value;
		
		if (e.indexOf('@')==-1) { //does it have an @ in it?
			alert('Please provide a valid email address\n\nThe address is missing an @ symbol');
			return false;
		} 
		
		var atsplit = contact.email.value.split('@');
		if (atsplit[0]=='') { //are there any characters before the @ symbol
			alert('Please provide a valid email address\n\nThe address is missing characters before the @ symbol');
			return false;
		}
		
		if (atsplit[1].indexOf('.')==-1) { //does it have a . after the @
			alert('Please provide a valid email address\n\nThe address is missing a . (dot) after the @ symbol');
			return false;
		} 
		
		var atdotsplit = atsplit[1].split('.');
		if (atdotsplit[0]=='') { //does it have characters immediately after the @				
			alert('Please provide a valid email address\n\nThe address is missing characters immediately after the @ symbol');
			return false;
		}
		
		var dotsplit = contact.email.value.split('.');
		//alert(dotsplit[dotsplit.length-1]);
		if (dotsplit[dotsplit.length-1]=='') { //are there any characters after the last .
			alert('Please provide a valid email address\n\nThe address is missing characters after the last .(dot)');
			return false;
		}
		
		//otherwise submit the form
		contact.submit();		
	} 
}

function checkRegistration() 
{
	var msg = "The following information is missing:\n\n";
	var goalert = false;
		if (register.fname.value == "") {
			msg += 'First Name\n';
			goalert = true;
		}
		
		if (register.lname.value == "") {
			msg += 'Last Name\n';
			goalert = true;
		}
		
		if (register.email.value == "") {
			msg += 'Email\n';
			goalert = true;
		}
		
		if (register.vesselname.value == "") {
			msg += 'Vessel Name\n';
			goalert = true;
		}
		
		if (register.training1.checked == false && register.training2.checked == false) {
			msg += 'Training Session(s)\n';
			goalert = true;
		}
		
	
	if (goalert == true) {
		alert(msg);
		return false;
	} else {
		var e = register.email.value;
		
		if (e.indexOf('@')==-1) { //does it have an @ in it?
			alert('Please provide a valid email address\n\nThe address is missing an @ symbol');
			return false;
		} 
		
		var atsplit = register.email.value.split('@');
		if (atsplit[0]=='') { //are there any characters before the @ symbol
			alert('Please provide a valid email address\n\nThe address is missing characters before the @ symbol');
			return false;
		}
		
		if (atsplit[1].indexOf('.')==-1) { //does it have a . after the @
			alert('Please provide a valid email address\n\nThe address is missing a . (dot) after the @ symbol');
			return false;
		} 
		
		var atdotsplit = atsplit[1].split('.');
		if (atdotsplit[0]=='') { //does it have characters immediately after the @				
			alert('Please provide a valid email address\n\nThe address is missing characters immediately after the @ symbol');
			return false;
		}
		
		var dotsplit = register.email.value.split('.');
		//alert(dotsplit[dotsplit.length-1]);
		if (dotsplit[dotsplit.length-1]=='') { //are there any characters after the last .
			alert('Please provide a valid email address\n\nThe address is missing characters after the last .(dot)');
			return false;
		}
		
		//otherwise submit the form
		register.submit();		
	} 
}

function validateEmail() 
{
	var msg = "The following information is missing or incorrect:\n\n";
	var goalert = false;
	var e = register.email.value;
		
	if (register.email.value == 'Enter email address' || register.email.value == '') { //does it have an @ in it?
		alert('Please provide a valid email address.');
		return false;
	} 
	
	if (e.indexOf('@')==-1) { //does it have an @ in it?
		alert('Please provide a valid email address\n\nThe address is missing an @ symbol');
		return false;
	} 
	
	var atsplit = register.email.value.split('@');
	if (atsplit[0]=='') { //are there any characters before the @ symbol
		alert('Please provide a valid email address\n\nThe address is missing characters before the @ symbol');
		return false;
	}
	
	if (atsplit[1].indexOf('.')==-1) { //does it have a . after the @
		alert('Please provide a valid email address\n\nThe address is missing a . (dot) after the @ symbol');
		return false;
	} 
	
	var atdotsplit = atsplit[1].split('.');
	if (atdotsplit[0]=='') { //does it have characters immediately after the @				
		alert('Please provide a valid email address\n\nThe address is missing characters immediately after the @ symbol');
		return false;
	}
	
	var dotsplit = register.email.value.split('.');
	//alert(dotsplit[dotsplit.length-1]);
	if (dotsplit[dotsplit.length-1]=='') { //are there any characters after the last .
		alert('Please provide a valid email address\n\nThe address is missing characters after the last .(dot)');
		return false;
	}
	
	//otherwise submit the form
	register.submit();		

}
