

function Form1_Validator(theForm)
{
  	if (theForm.firstname.value == "")
  {
    alert("Please enter a value for the \"firstname\" field.");
    theForm.firstname.focus();
    return (false);
  }
  	if (theForm.lastname.value == "")
  {
    alert("Please enter a value for the \"lastname\" field.");
    theForm.firstname.focus();
    return (false);
  }
	if (theForm.username.value == "")
  {
    alert("Please enter a value for the \"username\" field.");
    theForm.firstname.focus();
    return (false);
  }
  
  	if (theForm.password.value == "")
  {
    alert("Please enter a value for the \"password\" field.");
    theForm.email.focus();
    return (false);
  }
	if (theForm.password.value != theForm.confirm.value)
	{
		alert("The two passwords are not the same.");
		theForm.confirm.focus();
		return (false);
	}
	
	
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(theForm.email.value)){
return (true);
}
else
{
alert("Invalid E-mail Address! Please re-enter.");

return (false);
}
}


