﻿
    function SelectChange(v)
    {
        var type = $("#DDLoginType").val();
        if(type=='0')
           $("#Show").html("身 份 证：");
        else
           $("#Show").html("邮箱帐号：");
    }
    function ReSet()
    {
       form1.reset();
       $("#Show").html("邮箱帐号：");
    }
    function Login()
    {
        var Account = $("#TAccount").val();
        var LoginType = $("#DDLoginType").val();
        var Password = $("#TPassword").val();
        var checkcode =$("#Tcheckcode").val();
        var msg = "邮箱";
        if(LoginType=='0') msg ="身份证";
        if(Account=="")
        {
             alert("请输入"+msg);
             return false;
        }
        else
        {
           if (Account.indexOf("<")!=-1 || Account.indexOf(">")!=-1||Account.indexOf("'")!=-1||Account.indexOf("%")!=-1)
           {
               alert("请不要输入非法字符串！");
               return false;
           }
        }
        if(Password=="")
        {
           alert("请输入密码！");
           return false;
        }
        if(LoginType=="1"&&!IsEmail(Account))
        {
             alert("请输入正确的邮箱地址！");
             return false;
        }
        if(checkcode=="")
        {
            alert("请输入验证码！");
            return false;
        }
    }
    function IsEmail(strIn){return (/^([\.\w-]){2,}@([\.\w-]){2,}(\.([\w]){2,4}){1,2}$/).test(strIn);}

