
        function chkUser(id)
        {
            document.getElementById("UserNameInfo").style.color="#11B609";
            document.getElementById("UserNameInfo").innerHTML = "<font color=red>请梢候，正在检测中...</font>";
            var username = document.getElementById(id).value;
            hunshang.CorporationRegister.CheckUserName(username,onsuss);
        }
        function onsuss(results)
        {
            document.getElementById("UserNameInfo").innerHTML = results;
            checkbutton();
        }
        
         function ltrim(id)
        {
            var s = document.getElementById(id).value;
            document.getElementById(id).value = s.replace( /\s*$/, "");
        }
        
        function focustxt(btn)
        { 
            if(btn == "txtUserName")
            {
                document.getElementById("UserNameInfo").style.color="#ff6600";
            }
            else if(btn == "txtPassword")
            {
                document.getElementById("PasswordInfo").style.color="#ff6600";
            }
            else if(btn == "txtConfirmPassword")
            {
                document.getElementById("ConfirmPasswordInfo").style.color="#ff6600";
            }
            else if(btn == "txtRealName")
            {
                document.getElementById("RealNameInfo").style.color="#ff6600";
            }
            else if(btn == "txtPhone")
            {
                document.getElementById("PhoneInfo").style.color="#ff6600";
            }
            else if(btn == "txtCorporationName")
            {
                document.getElementById("CorporationName").style.color="#ff6600";
            }
            else
            {
                document.getElementById("EmailInfo").style.color="#ff6600";
            }
        }
        
           function checkpwd()
        {
            var pwd = document.getElementById("txtPassword").value;
            if(pwd.length>10 || pwd.length<6)
            {
                document.getElementById("PasswordInfo").innerHTML = "<font color=red>密码位数必须在6到10位之间，请重新输入。</font>";
            }
            else
            {
                document.getElementById("PasswordInfo").style.color="#11B609";
                document.getElementById("PasswordInfo").innerHTML = "<font color='#11B609'>密码输入正确。</font>";
            }
            document.getElementById("PasswordInfo").style.color="#26536F";
            checkbutton();
        }
         function checkpwdagain()
        {
            var pwd = document.getElementById("txtPassword").value;
            var pwdagain = document.getElementById("txtConfirmPassword").value;
            if(pwd!=pwdagain || pwd=="" || pwdagain =="")
            {
                //document.getElementById("pwdagaininfo").style.color="#ff0000";
                document.getElementById("ConfirmPasswordInfo").innerHTML= "<font color=red>您两次输入的密码不匹配，请重新输入。</font>";
            }
            else
            {
                document.getElementById("ConfirmPasswordInfo").style.color="#11B609";
                document.getElementById("ConfirmPasswordInfo").innerText = "密码输入正确，请牢记您的密码！";
            }
            document.getElementById("ConfirmPasswordInfo").style.color="#11B609";
            checkbutton();
        }
        
        function checkemail()
        {
             document.getElementById("EmailInfo").style.color="#11B609";
             document.getElementById("EmailInfo").innerHTML = "<font color=red>请梢候，正在检测中...</font>";
             var email = document.getElementById("txtEmail").value;
             hunshang.CorporationRegister.CheckEmail(email,onemailsearch);
        }
         function onemailsearch(results)
        {
            document.getElementById("EmailInfo").innerHTML = results;
            checkbutton();
        }
        
        function chkRealName()
        {
            var realname = document.getElementById("txtRealName").value;
            if(realname == "") 
            {
                document.getElementById("RealNameInfo").innerText = "不允许为空！";
            }
            else
            {
                document.getElementById("RealNameInfo").innerText = "";
            }
            checkbutton();
        }
        function chkPhone()
        {
            var phoneno = document.getElementById("txtPhone").value;
            if(phoneno == "") 
            {
                document.getElementById("PhoneInfo").innerText = "请您准确填写您的电话！";
            }
            else
            {
                document.getElementById("PhoneInfo").innerText = "";
            }
            checkbutton();
        }
         function chkCorpName()
        {
            var realname = document.getElementById("txtCorporationName").value;
            if(realname == "")
            {
                document.getElementById("CorporationName").innerText = "不允许为空！";
            }
            else
            {
                document.getElementById("CorporationName").innerText = "";
            }
            checkbutton();
        }
        
        function checkcity()
        {
            var city = document.getElementById("city").options[document.getElementById("city").selectedIndex].innerText;
            if(city == "请选择市")
            {
                document.getElementById("cityspan").innerText = "请选择您所在的城市";
            }
            else
            {
                document.getElementById("cityspan").innerText = "";
            }
            checkbutton();
        }
        
      
         function checkbutton()
        {
            var infoofuser = document.getElementById("UserNameInfo").innerText;
            var infoofpwd = document.getElementById("PasswordInfo").innerText;
            var infoofpwdagain = document.getElementById("ConfirmPasswordInfo").innerText;
            var infoofemail = document.getElementById("EmailInfo").innerText;
            var realname = document.getElementById("RealNameInfo").innerText;
            var corpname =  document.getElementById("CorporationName").innerText;
            var city = document.getElementById("cityspan").innerText ;
            //alert(infoofuser+","+infoofpwd+","+infoofpwdagain+","+infoofemail);
            if(infoofuser =="用户名可以使用！" && infoofpwd=="密码输入正确。"&& infoofpwdagain=="密码输入正确，请牢记您的密码！"&&infoofemail=="该邮箱可以使用" && realname == "" && corpname =="" && city == "")
            {
                document.getElementById("Button1").disabled = "";
            }
            else
            {
                document.getElementById("Button1").disabled = "disabled";
            }
            
        }
        
        