
var whitespace = " \t\n\r";

function isEmpty(s)
{
	return ((s == null) || (s.length == 0));
}

function isWhitespace (s)
{
	var i;
	
	if (isEmpty(s)) return true;
	
	for (i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		if (whitespace.indexOf(c) == -1) return false;
	}
	return true;
}

function Strip(strValue)
{
	while(strValue.charAt(0) == " ")
	{
		strValue = strValue.substr(1);
	}
	
	var iLength = strValue.length;
	
	while(strValue.charAt(iLength - 1) == " ")
	{
		strValue = strValue.substr(0, iLength - 1);
		
		iLength = strValue.length;
	}
	
	return strValue;
}

function ForceEntry(val, str)
{
	var strInput = new String(val.value);
	
	if (isWhitespace(strInput))
	{
		val.focus();
		alert(str);
		return false;
	}
	else
		return true;
}