// Check for null and empty
function isFilled(elm) { 
    if (elm.value == "" ||
        elm.value == null) 
    return false;
    else return true;
}

// Check for a valid email address
function isEmail(elm) {
	var reEmail = /^\s*\w[\w\.-]*\w@(?:[\w-]{2,}\.)+[a-z]{2,4}\s*$/i;
	return reEmail.test(elm.value);
}

// Check for a valid UID (single word only)
function isUID(elm) {
	var reUID = /^\w+$/;
	return reUID.test(elm.value);
}

// Check to see if there is a valid selection in a SELECT menu
function isSelected(elm) { 
	if (elm.selectedIndex == 0) 
	return false;
	else return true;
}

//Check to see if a radio button had been selected
function isChecked(elm) { 
	var chkValue = ""
	for (i=0, n=elm.length; i<n; i++) {
		if (elm[i].checked) {
			var chkValue = elm[i].value;
			break;
		}
	}
	if (chkValue)
	return true;
	else return false;
}
