function verify() {
    var msg;
    var errors = "";
	var e = "";
	var elementnum = 999;

//If email address is present, check it is valid
	e = document.register.emailaddr.value; // Email Address
	if (!(e == null) && !(e == "") && !isblank(e)) {
		if (checkEmail(e) == false) {
			errors += "- Please enter a valid email address\n";
			if (2 < elementnum) {
				elementnum = 2;
			}
		}
	} else {
		errors += "- Please enter your email address\n";
		if (2 < elementnum) {
			elementnum = 2;
		}
	}
// Now, if there were any errors, display the messages, and
// return false to prevent the form from being submitted. 
// Otherwise return true.
    if ( !errors) {
		document.register.submit();
		return true;
    }

    msg  = "______________________________________________________\n\n"
    msg += "Unfortunately there are errors in your Registration Form \n";
    msg += "Please correct the following error(s) and try again.\n";
    msg += "______________________________________________________\n\n"

	msg += "\n";
    
    msg += errors;
    alert(msg);
    if (elementnum != 999) {
		document.register.elements[elementnum].focus();
	}
    return false;
}

// A utility function that returns true if a string contains only 
// whitespace characters.
function isblank(s)
{
    for(var i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
    }
    return true;
}

function checkEmail(thisemail)
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(thisemail)){
		return (true);
	}
	return (false);
}