// JavaScript Document
function checkregistration(){
	var firstname=document.reg.firstname.value;
	if((firstname==null)||(firstname=="")){
		alert('You must enter in your first name.');
		document.reg.firstname.focus();
		document.reg.firstname.select();
	return false;
	}
	var lastname=document.reg.lastname.value;
	if((lastname==null)||(lastname=="")){
		alert('You must enter in your last name.');
		document.reg.lastname.focus();
		document.reg.lastname.select();
	return false;
	}
	var address=document.reg.address.value;
	if((address==null)||(address=="")){
		alert('You must enter in your address.');
		document.reg.address.focus();
		document.reg.address.select();
	return false;
	}	
	var city=document.reg.city.value;
	if((city==null)||(city=="")){
		alert('You must enter in your city.');
		document.reg.city.focus();
		document.reg.city.select();
	return false;
	}		
	var state=document.reg.state.selectedIndex;
	if (state==0) {
		alert("\nYou must select a state.");
		document.reg.state.focus();
		return false
   }
	var zip=document.reg.zip.value;
	if((zip==null)||(zip=="")){
		alert('You must enter in your zip.');
		document.reg.zip.focus();
		document.reg.zip.select();
	return false;
	} 
	var phone1 = document.reg.phone1.value;
	if ((phone1==null)||(phone1=="")){
		alert('You must enter in your phone number area code for your home phone number.');
		document.reg.phone1.focus();
		document.reg.phone1.select();
	return false;
	} else {
		if (isNaN(phone1)) {
			alert('The phone number contains illegal characters.');
			document.reg.phone1.focus();
			document.reg.phone1.select();
			return false;		   
		}
		if (!(phone1.length == 3)) {
			alert('The phone number is the wrong length. There needs to be 3 numbers.\n');
			document.reg.phone1.select();
			return false;			
		} 	
	}
	var phone2 = document.reg.phone2.value;
	if ((phone2==null)||(phone2=="")){
		alert('You must enter in your phone number exchange for your home phone number.');
		document.reg.phone2.focus();
		document.reg.phone2.select();
	return false;
	} else {
		if (isNaN(phone2)) {
			alert('The phone number contains illegal characters.');
			document.reg.phone2.focus();
			document.reg.phone2.select();
			return false;		   
		}
		if (!(phone2.length == 3)) {
			alert('The phone number is the wrong length. There needs to be 3 numbers.\n');
			document.reg.phone2.select();
			return false;			
		} 	
	}
	var phone3 = document.reg.phone3.value;
	if ((phone3==null)||(phone3=="")){
		alert('You must enter in your phone number extension for your home phone number.');
		document.reg.phone3.focus();
		document.reg.phone3.select();
	return false;
	} else {
		if (isNaN(phone3)) {
			alert('The phone number contains illegal characters.');
			document.reg.phone3.focus();
			document.reg.phone3.select();
			return false;		   
		}
		if (!(phone3.length == 4)) {
			alert('The phone number is the wrong length. There needs to be 4 numbers.\n');
			document.reg.phone3.select();
			return false;			
		}
	}	
	var email=document.reg.email.value;
	if ((email==""||email==null)){
		alert("You must enter in an email address.");
		document.reg.email.focus();
		document.reg.email.select();
		return false;
	}else{
		if (email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.indexOf(" ")!=-1 || email.length<6) 
			{alert("Sorry, your email address is not valid.");
			document.reg.email.focus();
			document.reg.email.select();
			return false;
		}
	}	  	
	var username=document.reg.username.value;
	if((username==null)||(username=="")){
		alert('You must enter in a username.');
		document.reg.username.focus();
		document.reg.username.select();
	return false;
	}		
	var password=document.reg.password.value;
	if((password==null)||(password=="")){
		alert('You must enter in a password.');
		document.reg.password.focus();
		document.reg.password.select();
		return false;
	}else{
		if(password!=document.reg.confirmpassword.value){
			alert('Both passwords must be the same. Please re-enter.');
			document.reg.password.focus();
			document.reg.password.select();
			return false;
		}
	}
	var answer=document.reg.answer.value;
	if((answer==null)||(answer=="")){
		alert('You must enter in an answer for your security question.');
		document.reg.answer.focus();
		document.reg.answer.select();
		return false;
	}
}
