function validateText(stringContainer, minLen, maxLen){
	var s = stringContainer;
   	// Remove leading spaces and carriage returns
   	while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))
   	 { s = s.substring(1,s.length); }
     
		// Remove trailing spaces and carriage returns
	 while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r'))
		 { s = s.substring(0,s.length-1); }

	/*
	The way this works is you start with 7, which is failure. 
	It subtracts numbers (using bitmask algorythm) as it passes the tests.
	The results are as follows.
	    A return of 7 means the end user ented nothing. So messages can be written to this.
	    A return of 3 means the minimum length was not met. So messages can be written to this.
	    A return of 1 means the maximum length was exceeded. So messages can be written to this.
	    A return of 0 means all criteria was met. So messages can be written to this.
	*/
	returnValue = 7;
	if(stringContainer.length > 0){
		returnValue = returnValue - 4;	
		if(s.length >= minLen){
			returnValue = returnValue - 2;
			if(s.length <= maxLen){
				returnValue = returnValue - 1;
			}
		}
	}
    //alert(stringContainer + " , " + minLen + " , " + maxLen  + " , " + returnValue);
	return returnValue;
}
