function submitThisForm(formName) {return checkForm(formName);}
function checkForm(regform) {
var flag = 0; var warningMsg = "The following ERRORS have occured:\n\n";
if ((regform.fname.value == " ") || (regform.fname.value == ""))  {warningMsg += "Name of your friend missing\n"; flag = 1;}
if ((regform.email.value == " ") || (regform.email.value == ""))  {warningMsg += "Email Address of your friend missing\n"; flag = 1;}
else {
var emailField = regform.email.value; var is_ok_at = emailField.indexOf ("@"); var is_ok_dot = emailField.indexOf (".");
if ((is_ok_at == -1) || (is_ok_dot == -1))  {warningMsg += "Email Address of your friend is invalid\n"; flag = 1;}
}
if (flag == 1) {warningMsg += "\n\nPlease correct these errors and resubmit"; alert(warningMsg);}
else {document.regform.submit();}
}
function movefocus(nextfield) {nextfield.focus();}
