<%@ Page Language="C#" AutoEventWireup="True" Codebehind="login.aspx.cs" Inherits="JumboTCMS.WebFile.Passport._login" %>
<!doctype html>
<!--STATUS OK-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7">
<title>用户登录 <%=site.Name%></title>
<link href="css/<%=base.PassportTheme %>/basic.css" rel="stylesheet" type="text/css" media="screen">
<link rel="stylesheet" type="text/css" href="css/<%=base.PassportTheme %>/login.css"/>
<script type="text/javascript" src="../_libs/jquery.tools.pack.js"></script>
<script type="text/javascript" src="../_data/global.js"></script>
<link   type="text/css" rel="stylesheet" href="../_data/global.css" />
<script type="text/javascript">if (top!=self)top.location=self.location;</script>
<style> 
.psp-main .psp-form em.c0{display: none;}
.psp-main .psp-form span.em{display: none;}
</style>

</head>
<body>
<div id="header">
  <div class=""></div>
  <div class="sub-global-header">
    <div class="sub-global-header-inner">
      <div class="logo"><a href="<%=site.Dir %>"><%=site.Name %></a></div>
      <ul class="cate-nav">
      </ul>
      <ul class="login-nav">
        <li><a href="<%=site.Dir %>">返回首页</a>|</li>
        <li class="collect"><a href="javascript:void(0);" onclick="return _jcms_addFavorite('<%=site.Url %>', '<%=site.Name %>')">收藏<%=site.Name2 %></a></li>
      </ul>
    </div>
  </div>
</div>
<div id="wrapper" class="login-wrap">
  <div id="bd">
    <div class="psp-title">
      <h2>用户登录<span class="theme"><a class="default" href="javascript:void(0);" title="蓝色风格" onclick="JumboTCMS.Cookie.set('passport_theme','default');location.reload();"></a><a class="green" href="javascript:void(0);" title="绿色风格" onclick="JumboTCMS.Cookie.set('passport_theme','green');location.reload();"></a></span></h2>
    </div>
    <div class="psp-wrap">
      <div class="psp-main cls">
        <div class="psp-container">
          <div class="login-icon">
            <p class="t">还没有帐号？</p>
            <p class="reg"><a href="register.aspx" class="btn-reg">立即注册</a></p>
            <p class="t oauth-navbar">使用合作网站帐号登录</p>
            <p class="icon-list oauth-navbar"><a id="oauth_sina" href="#" class="icons icon-sina"></a><a id="oauth_tencent" href="#" class="icons icon-tencent"></a><a id="oauth_renren" href="#" class="icons icon-renren"></a></p>
          </div>
        </div>
        <div class="psp-sidebar">
          <div class="login-con">
            <form id="loginform" class="psp-form">
              <ul>
                <li><em class="c0">使用将博帐号登录</em></li>
                <li>
                  <label class="k" style="width:80px;" for="txtUserName">帐&nbsp;&nbsp;号：</label>
                  <span class="v">
                  <input type="text" name="txtUserName" id="txtUserName" class="psp-text login-width" value="" />
                  </span> </li>
                <li>
                  <label class="k" style="width:80px;" for="txtUserPass">密&nbsp;&nbsp;码：</label>
                  <span class="v">
                  <input type="password" name="txtUserPass" id="txtUserPass" maxlength="14" class="psp-text" />
                  </span> </li>
                <li>
                  <label class="k" style="width:80px;" for="txtUserCode">验证码：</label>
                  <span class="v">
                  <input class="psp-text" type="text" style="width:80px;ime-mode:disabled;" id="txtUserCode" name="txtUserCode" maxlength="4" size="4" onpaste="return false" /><span id="lblCode"></span>
                  <img class="vcode-img" id="imgCode" onclick="_jcms_GetRefreshCode('imgCode',36);" src="" align="absmiddle" /><a href="javascript:void(0);" id="_vcode_txt" onclick="_jcms_GetRefreshCode('imgCode',36);return false;">换一张</a>  <img id="imgRead" src="../statics/common/maintb.gif" align="absmiddle" style="cursor: pointer" alt="收听验证码" title="收听验证码" onclick="ajaxPlayCodeVoice('player');" /><span id="player"></span></span> </li>
              </ul>
              <div class="btn">
                <input type="button" class="btn-login" onclick="ajaxLogin();" id="btnLogin" value="登录" />
                <a class="right" href="getpassword.aspx" tabindex="-1">忘记密码?</a>
                <input type="hidden" id="txtRefer" name="txtRefer" value="<%=Referer%>" />
                <input type="hidden" id="txtLoginType" name="LoginType" value="7" />
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<div id="footer">
  <div class="copyright">
    <div class="copyright-inner">
      
      <div class="copyright-info">
        <p> <span>Copyright &copy; 2007-2014</span> <span><%=site.Name%>版权所有</span> <a href="http://www.miibeian.gov.cn" target="_blank"><%=site.ICP%></a> </p>
        <p> Powered by <strong><a href="http://www.jumbotcms.net/" target="_blank">JumboTCMS</a></strong> <%=site.Version%></p>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){
	if (site.AllowReg){_jcms_SetOAuthBar();}
	_jcms_GetRefreshCode('imgCode',36);
	var act = q('act');
	if(act != "logout")
		sendRequest(1);
	else
		chkLogout();

});
var gSubmitTimes = 0;
function oLogin()
{
}
function ajaxLogin(){
	if(gSubmitTimes>4){
		alert('请想想密码再来');
		return;
	}
	var uName = $("#txtUserName").val();
	var uPass="";
	var uCode = $("#txtUserCode").val();
	var oPass = $('#txtUserPass').val();
	var typeNum = $("#txtLoginType").val();
	if(uName==""){
		alert('请填写用户名');
		$("#txtUserName").focus();
		$("#txtUserPass").val(oPass);
		return;
	}
	if(oPass==""){
		alert('请填写密码');
		$("#txtUserPass").focus();
		return;
	}
	if(uCode == ""){
		alert("请填写验证码");
		$("#txtUserPass").val(oPass);
		$("#txtUserCode").focus();
		return;
	}
	uPass=JumboTCMS.MD5(oPass);
	$('#txtUserPass').val(uPass);
	$.ajax({
		type:		"post",
		dataType:	"html",
		url:		"ajax.aspx?oper=ajaxLogin&clienttime="+Math.random(),
		data:		"name="+encodeURIComponent(uName)+"&pass="+encodeURIComponent(uPass)+"&code="+encodeURIComponent(uCode)+"&type="+typeNum,
        error:		function(XmlHttpRequest,textStatus, errorThrown) { alert(XmlHttpRequest.responseText);},
		success:	function(d){
			if (d== "ok")
				top.location.href="logining.aspx?url="+encodeURIComponent($("#txtRefer").val());
			else
			{
				gSubmitTimes=gSubmitTimes+1;
				alert(d);
				$('#txtUserPass').val(oPass);
				_jcms_GetRefreshCode('imgCode',36);
			}
		}
	});
}
function chkLogout(){
	top.location.href="logout.aspx";
}
function sendRequest(p){
	if(p==0)
	{
		oLogin();
		return;
	}
	$.ajax({
		url:		site.Dir+"user/ajax.aspx?clienttime="+Math.random(),
		type:		"get",
		dataType:	"json",
		success:	function(d){
			if(d.result=="1")
				if(q('refer')!="")
					top.location.href=decodeURIComponent(q('refer'));
				else
					top.location.href=site.Dir + 'user/default.aspx';
			else
				oLogin();
		}
	});
}
</script>
</body>
</html>
