// JavaScript Document
function checkFname()
{
	var firstName = document.contact.fname.value;
		if ( firstName.length >= 2 ){
			return true;
		}else{
			alert ("You must enter a first name");
			document.contact.fname.focus();
			return false;
		}
}

function checkLname()
{
	var lastName = document.contact.lname.value;
		if ( lastName.length >= 2 ){
			return true;
		}else{
			alert ("You must enter a last name");
			document.contact.lname.focus();
			return false;
		}
}

function checkEmail()
{
	var emailStr = document.contact.email.value;
	var found_amper = 0;
	var found_dot = 0;
	var found_domain = 0;
	var ampLocation = emailStr.indexOf('@');
	var emailSubStr = emailStr.substring(ampLocation+1);
	var dotLocation = emailSubStr.indexOf('.');
	var emailSubSubStr = emailSubStr.substring(dotLocation);
	if ( ampLocation > 0 )
	{
		var found_amper = 1;
	}
	if ( dotLocation > 0 )
	{
		var found_dot = 1;
	}
	if ( emailSubSubStr.length > 2 )
	{
		var found_domain = 1;
	}
	if ( found_amper == 1 && found_dot == 1 && found_domain == 1 )
	{
		return true;
	}else{
		if ( emailStr == "" ){
			alert("You must enter an email address.")
		}else{
			alert("'"+emailStr+"' does not appear to be a valid email address.")
		}
		document.contact.email.focus()
		return false;
	}
}