﻿function loginout()
{
  window.document.all.hidact.value="loginout";
  window.document.all("memberlogin").submit();
}
function loginin()
{
  if(checkLogin())
  {

     window.document.all.hidact.value="loginin";
     return true;
  }
  return false;
}
function checkLogin()
{
  objusername=window.document.getElementById('txtUserName');
  objpassword=window.document.getElementById('txtPassword');
  objverifycode=window.document.getElementById('txtVerifyCode');
  if(objusername.value.replace(/(^[\s\u3000]*)|([\s\u3000]*$)/g,'')=='')
  {
    alert('请输入用户名');
    objusername.focus();
    return false;
  }
  var patten=/^[0-9A-Za-z_]{2,16}$/;
  if(!patten.exec(objusername.value))
  {
   alert('用户名输入错误');
    objusername.focus();
    return false;
  }
  
    if(objpassword.value.replace(/(^[\s\u3000]*)|([\s\u3000]*$)/g,'')=='')
  {
    alert('请输入密码');
    objpassword.focus();
    return false;
  }
   if(objverifycode.value.replace(/(^[\s\u3000]*)|([\s\u3000]*$)/g,'')=='')
  {
    alert('请输入验证码');
    objverifycode.focus();
    return false;
  }
  return true;
}
