// embSpace -- Tests a string for presence of an embedded space
//
// Returns true if the string contains at least one embedded space; false otherwise
//
// Arguments:
//            theStr - the string to be tested
//
// V1.1   17 Nov 99   Initial release
//
// William K. Walker
// wkwalker@nvdi.com
//
function embSpace(theStr)
{
  var i0 = 0;
  var i1 = 0;

  if (theStr.length < 3) return false;

  for (i = 0;  i < theStr.length;  i++)
  {
    if (theStr.charAt(i) != " ") break;
  }
  i0 = i;

  for (i = (theStr.length-1); i > -1; i--)
  {
    if (theStr.charAt(i) != " ") break;
  }
  i1=i;

  if ((i1-i0) < 2) return false;
  for (i = (i0+1);  i < i1;  i++)
  {
    if (theStr.charAt(i) == " ") return true;
  }

  return false;
}


