﻿// JScript 文件

function checklogin()
{
         var username=$.trim($("#textUserName").val());
            if(username=="")
            {
               alert("请输入用户名");
	            $("#textUserName").focus()
	           return  false
            }
             var username=$.trim($("#textUserpwd").val());
            if(username=="")
            {
               alert("请输入密码");
	            $("#textUserpwd").focus()
	           return  false
            }
            var username=$.trim($("#textCode").val());
            if(username=="")
            {
               alert("请输入验证码");
	            $("#textCode").focus()
	           return  false
            }
            
         var textcode=$.trim($("#textCode").val());
        if(textcode=="")
        {
            alert("请输入验证码");
            return false;
        }
        var cookieValue = "";
        if(document.cookie.length > 0)
        {
            var offset = document.cookie.indexOf("yzmcode=") + 8;
            if(offset != -1)
            {
                var end = document.cookie.indexOf(";",offset);
                if(end == -1)
                {
                    end = document.cookie.length;
                }
                cookieValue = unescape(document.cookie.substring(offset,end));
            }
        }
        if(cookieValue != textcode.toUpperCase())
        {
            alert("验证码输入错误!");
            $("#textCode").html("");
            return false;
        } 
        return true;
}

 function reloadcode()
    {
        var ImgCode = document.getElementById("ImageCheck");
        ImgCode.setAttribute("src","../GifCode.aspx?"+Math.random());
    }

function alllogin()
{
         var username=$.trim($("#textUserName").val());
            if(username=="")
            {
               alert("请输入用户名");
	            $("#textUserName").focus()
	           return  false
            }
             var username=$.trim($("#textUserpwd").val());
            if(username=="")
            {
               alert("请输入密码");
	            $("#textUserpwd").focus()
	           return  false
            }
}
