//A library of EasyFile Javascript functions, for validation and various other purposes.

//Determines whether the passed value has a numeric value.
function isItANumber(what)
{
    var parsedvalue=parseInt(what);
	if(Math.abs(parsedvalue)>0)
    {
    	return parsedvalue;
    }
    else
    {
     	return false;
    }
}

//remove whitespace from the beginning and end of a string
function strtrim(trimwhat) 
{
    //Match spaces at beginning and end of text and replace
    //with null strings
    return trimwhat.replace(/^\s+/,'').replace(/\s+$/,'');
}

function anyEntered(what, whatfieldname)
{
		var fieldcount=0;
   		for (var i=0;i<what.elements.length;i++)
 		{
 			var e = what.elements[i];
 			if(e.name==whatfieldname)
 			{
	 			if(e.value)
	 			{
	 				fieldcount+=1;
	 			}
	 		}
 		}
 		if(fieldcount>0)
 		{
			
 			return true;
 		}
		
 		return false;
}