// JavaScript Document

function checkForm() {
	var message = "";

	// Determine the Location of the @ symbol in the text box
	var atSymbolLoc = document.registrationRequest.email.value.indexOf('@');
	
	// Determin the Location of the first dot after the @ symbol
	var dotLoc = document.registrationRequest.email.value.indexOf('.',atSymbolLoc);
	
	//The indexOf() method will return -1 if not found
	//0 is the first character which would also be invalid
	
	if ( (atSymbolLoc == -1) || (atSymbolLoc == 0) || 
		 (dotLoc == -1)    || (dotLoc == atSymbolLoc+1) ||
		 (dotLoc >= document.registrationRequest.email.value.length-2 ) ) {
			message = message + 'There is a problem with the e-mail address!\n';
		 } // end if

	if (document.registrationRequest.firstName.value.length < 1 ) {
		message += "First Name Field Does not Contain Enough Data\n";
		}
		
	if (document.registrationRequest.lastName.value.length < 2 ) { 
	    message += "Last Name Field Does not Contain Enough Data\n";
		}
		
	if (message.length > 0 ) {
		alert(message);
		message="";
		return false;
		} else {
		return true;
		}
				
} //end func