/* Verify an Email Address */
function validateEmail(emailString)
{

/* The characters don't belong in a valid email address */
invalidChars = "/:,;";

/* You must enter something */
if (emailString == "")
{
window.alert("You must enter your email!");
return false;
}

/* There must be something BEFORE the at sign */
if (emailString.indexOf("@",0) == 0)
{
window.alert("No username in email address!");
return false;
}

/* There must be an at sign at, or after, the second character */
if (emailString.indexOf("@",1) == -1)
{
window.alert("No @ sign in email address!");
return false;
}

/* There must be a period somewhere */
if (emailString.indexOf(".",0) == -1)
{
window.alert("No period in email address!");
return false;
}

/* Check for invalid characters */
for (i=0; i<invalidChars.length; i++)
{
if (emailString.indexOf(invalidChars.charAt(i), 0) > -1)
{
window.alert("Bad character(s) in email address!",
invalidChars.charAt(i), i);
return false;
}
}
/* We made it! The email looks good! */
return true;
}

/* Verify a form */
function formVerify(myform)
{

/* Go validate the email address */
if (!validateEmail(myform.email.value))
{
myform.email.focus();
myform.email.select();
return false;
}

else
return true;
}

