
var whitespace = " \t\n\r";

function isEmpty(s) {

	// check for null
	if (s == null || s.length==0)
		return true;
	
	// check for characters that are not whitespace
	for (var i=0; i<s.length; i++) {
		if (whitespace.indexOf(s.charAt(i)) == -1)
			return false;
	}
	
	// all characters are whitespace
	return true;
}

function hasSelected(s) {
	
	// check for null
	if (s == null)
		return false;
		
	// loop through fields and look for checked
	for (var i=0; i<s.length; i++) {
		if (s[i].checked)
			return true;
	}
	
	// nothing checked
	return false;
}
