function CheckForm()
{
  document.frmlogin.loginname.value=KillSpace(document.frmlogin.loginname.value);
  if(document.frmlogin.loginname.value.length == 0)
    {
      alert('\n请输入您的用户名!');
      return false;
    }

  document.frmlogin.passwd.value=KillSpace(document.frmlogin.passwd.value);
  if(document.frmlogin.passwd.value.length == 0)
    {
      alert('\n请输入您的口令!');
      return false;
    }

  return true;
}

function KillSpace(x){
  while((x.length>0) && (x.charAt(0)==' '))
  x = x.substring(1,x.length)
  while((x.length>0) && (x.charAt(x.length-1)==' '))
  x = x.substring(0,x.length-1)
  return x
}
