It's better to attach the validation on form onsubmit and not in the submit button's onclick.
Code:
function validate(oFrm) {
var at_location = oFrm.email.value.indexOf("@");
...
<form method="post" action="register2.asp" class="reg" name="form" onsubmit="return validate(this)">
You can also pass the form reference to the function to avoid repeating the form reference document.form. Also it's a good coding habit to always declare variables with
var keyword. If declared within a function, it makes the variable local, much more efficient and easier to debug.