// JScript 文件
function val()
        {
            var flag=true;
            //邮箱地址验证
            var username=ReplaceAll(document.getElementById("username").value," ","");
            var CheckMail = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
            if(username!=""){
                if(CheckMail.test(username))
                {   
                    document.getElementById("email_val").innerHTML="<em>请填写您常用的邮箱地址 </em>";
                }else{
                    document.getElementById("email_val").innerHTML="<span class='msg_submit'>邮箱地址格式不正确！</span>";
                    flag=false;
                }
            }else{
                document.getElementById("email_val").innerHTML="<span class='msg_submit'>邮箱地址不能为空！</span>";
                flag= false;
            }
            var pwd=ReplaceAll(document.getElementById("pwd").value," ","");
            if(pwd!=""){
                if(pwd.length<6||pwd.length>20){
                    document.getElementById("pwd_val").innerHTML="<span class='msg_submit'>请输入6-20位的密码！</span>";
                    flag= false;
                 }else{  
                     document.getElementById("pwd_val").innerHTML="<em>输入6-20位的密码 </em>";
                 }
            }else{
                document.getElementById("pwd_val").innerHTML="<span class='msg_submit'>密码不能为空！</span>";
                flag= false;
            }
            //真实姓名验证
            var uname=ReplaceAll(document.getElementById("uname").value," ","");
            if(uname.length!=0){
                if(uname.length>5){
                    document.getElementById("uname_val").innerHTML="<span class='msg_submit'>用户名不能超过5个字符！</span>";
                    flag= false;
                }else{
                    document.getElementById("uname_val").style.display="none";
                }
            }else{
                document.getElementById("uname_val").innerHTML="<span class='msg_submit'>用户名不能为空！</span>";
                flag= false;
            }
            //验证码验证
            var checkfc=getCookies('CheckCodef');
            var txt_yz=ReplaceAll(document.getElementById("txt_yz").value," ","");
            if(txt_yz==""){
                document.getElementById("message_val").innerHTML="<span class='msg_submit'>请填写验证码！</span>";
                flag= false;
            }else if(checkfc!=txt_yz){
                document.getElementById("message_val").innerHTML="<span class='msg_submit'>请正确填写验证码！</span>";
                flag=false;
            }else{
                document.getElementById("message_val").innerHTML="";
            }
             //验证密保两次输入的问题是否一致
            var sel4=document.getElementById("Select4").value;
            var sel5=document.getElementById("Select5").value;
            if(document.getElementById("showMoreInfo").checked==true)
            {
                if(sel4==sel5){
                    document.getElementById("message_val").innerHTML="<span class='msg_submit'>两次问题不能相同!</span>";
                    flag=false;
                }
            }
            if(flag){
                return true;
            }else{
                return false;
            }
        }
