function validateMailAddr(emailad) {
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,4}$/;
	var arrayOfAddresses = emailad.split(',');
	for(var i=0; i < arrayOfAddresses.length; i++) {
	    if(((arrayOfAddresses[i].search(exclude) != -1)||(arrayOfAddresses[i].search(check)) == -1)||(arrayOfAddresses[i].search(checkend) == -1)) {
		    return false;
		}
	}
	return true;
}
/*
Notes:
'exclude' checks 5 conditions:
a) characters that should not be in the address
b) characters that should not be at the start
c) & d) characters that shouldn't be together
e) there's not more than one '@'
'check' checks there's at least one '@', later followed by at least one '.'
'checkend' checks the address ends with a period followed by 2 or 3 or 4 alpha characters
N.B. Javascript 1.2 only works with version 4 browsers and higher.
*/

function validateForm(frm) {
	if (frm.email.value == "") {
		alert("Your e-mail address is required");
		return false;
	}
	else if (! validateMailAddr(frm.email.value)) {
		alert("Your e-mail address is not correct");
		return false;
	}
	return true;
}
