function validateEmail(theItem) {
	var string = theItem.value;
	if (string.length > 0) {
	    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
	        return true;
	    else {
			alert("Email address is not valid.");
			theItem.focus();
			theItem.select();
	        return false;
		}
	}
}

function menu() {
	var args = menu.arguments;
	document.mainform.control.value = args[0];
	if (args.length > 1)
		document.mainform.secondary.value = args[1];
	document.mainform.submit();
}
