function CheckAccount(){
  var frms = document.frmlogon;
  var subs = document.getElementById("Log0MainR2SUB");
  subs.style.display = "none";

  var memtype = frms.memtype;
  if(memtype != null && !frms.memtype[1].checked ) 
    return;
  frms.sub_account.value = "";
  formtrim(frms);
  var account = frms.account.value;
  if( account == "" ) return;

  var http = null;

  if(window.XMLHttpRequest){
    //Firefox, Opera 8.0+, Safari
    http = new XMLHttpRequest();
  }
  else{
    //Internet Explorer
    var xmlhttps = new Array(
      'Msxml2.XMLHTTP.5.0',
      'Msxml2.XMLHTTP.4.0',
      'Msxml2.XMLHTTP.3.0',
      'Msxml2.XMLHTTP',
      'Microsoft.XMLHTTP'
    );
    for (var i=0; i<xmlhttps.length; i++){
      try {
        http = new ActiveXObject(xmlhttps[i]);
        break;
      }
      catch (e) {
        http = null;
      }
    }
  }

  if(http == null){
  //alert("您的浏览器版本过低，不支持XMLHTTP，请升级浏览器之后再试！");
  //无子帐号的会员浏览器若不支持也会提示，暂不提示
    return;
  }

  //据说是UTF-8方式传递，IE下中文参数需要转码，FF下可以不转
  var url = "/recruit/sub_account_check.jsp?account=" + encodeURIComponent(account);
  http.onreadystatechange = onStateChange;
  http.open("GET", url, true);
  http.send(null);

  function onStateChange(){
    if(http.readyState==0){
      return;
    }
    if(http.readyState==1){
      return;
    }
    if(http.readyState==2){
      return;
    }
    if(http.readyState==3){
      return;
    }
    if(http.readyState==4){
      if (http.status != 200){
        alert("XMLHTTP请求失败，错误代码 (" + http.status + ") " + http.statusText);
      }
      else{
        eval(http.responseText);
        if(sub_accounts == null){
          alert("帐号 " + account + " 不存在，请核对后再输入！");
        }
        else{
          if(sub_accounts.length>0){
            for(var i=frms.sub_account.options.length-1; i>=1; i--) frms.sub_account.remove(i);

            for(var i=0;i<sub_accounts.length;i++){
              var newoption   = document.createElement('option');
              newoption.value = sub_accounts[i][0];
              newoption.text  = sub_accounts[i][0];
              frms.sub_account.options.add(newoption);
            }
            subs.style.display           = '';
          }
        }
      }
      delete(http);
      return;
    }
  }

}
/*
  http.open第三个参数
  同步(false)，返回值是true或false，因为执行完send后，开始执行onreadystatechange，程序会等到 onreadystatechange都执行完，
  取得responseText后才会继续执行下一条语句，所以returnValue一定有值。
  如果是异步(true)，返回值一定是null，因为程序执行完send后不等xmlhttp的响应，而继续执行下一条语句，所以returnValue还没有
  来的及变化就已经返回null了。 
  var strData = "code=123";
  xmlDom.open("POST","default.asp",false);
  xmlDom.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
  xmlDom.send(strData);
*/

function sb_hide(){
  document.getElementById("Log0MainR2SUB").style.display = "none";
  document.frmlogon.sub_account.value         = "";
}
