function trim(s)
{
  while(s.length > 0 && s.charAt (0) == ' ')
  {
     s = s.substring(1,s.length);
  }
  while(s.length > 0 && s.charAt (s.length - 1) == ' ')
  {
     s = s.substring(0,s.length - 1);
  }
  return s;
}

function empty(s)
{
    if(trim(s) == '')
          return true;
    return false;
}

