﻿// JavaScript Document
 function _logonout()
 {
    CSWeb.reg.login.UserOut();
    window.location.reload();
 }
 
function _PostForm()
{

    var _UserName=document.getElementById("txtUName");
    var _UserPwd=document.getElementById("txtPwd");
    if(_UserName.value.length<4)
    {
        alert('帐号格式错误!');
        _UserName.focus();
        return ;
    }
    if(_UserPwd.value.length<6)
    {
         alert('密码格式错误!');
         _UserPwd.focus();
        return ;
    
    }
    var _return=CSWeb.reg.login.UserLogin(_UserName.value,_UserPwd.value).value;
    
    
    switch(_return)
    {
        case 0:
            alert('帐号不存在!');
        break;
        
        case 1:
            location.reload();
            //location.href='/default.aspx';
        break;
        
        case 2:
            alert('密码错误!');
        break;
    }
}

$(document).ready(function(){
$("#logoin a:eq(2)").click(function() { 
	
    jQuery.blockUI({ message:$('#m_login') }); 
})
}
)
var login='<div id="m_login"><img src="/images/lg_close.jpg" id="c_log" onclick="jQuery.unblockUI()"/><ul><li style="margin-left:21px; text-align:left">帐号：<input name=\"txtUName\" id=\"txtUName\" onkeypress=\"if(event.keyCode==13){document.getElementById(\'txtPwd\').focus();}\" value=\"\" type=\"text\" /></li><li>密码：<input name=\"txtPwd\" id=\"txtPwd\" onkeypress=\"if(event.keyCode==13){document.getElementById(\'btnLogin\').click();}\"  value=\"\" type="password" /><a href="/reg/GetbackAccount.aspx">忘记密码？</a></li><li><button type="button" onclick=\"_PostForm();\"  id=\"btnLogin\" class="logb">登录</button><button  onclick="location=\'/reg/regist.aspx\'" class="logb">注册</button></li></ul></div>'
document.writeln(login);
