<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=<!--{$page_charset}-->" />
<title><!--{$page_title}--></title>
<meta name="description" content="<!--{$page_description}-->" />
<meta name="keywords" content="<!--{$page_keyword}-->" />
<!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_headjs.tpl"}-->
<link href="<!--{$skinpath}-->themes/css/ajax_login.css" rel="stylesheet" type="text/css" />
</head><body>
<div class="layer-box">
  <div class="login-box validato-2" style="width:320px;">
    <form method="post" action="<!--{$urlpath}-->index.php?c=passport&a=loginpost&halttype=jdbox&forward=<!--{$forward}-->" name="login_form" id="login_form" />
    
    <table width="320" class="user-pop-login" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>登录帐号：</td>
        <td><input name="loginname" id="loginname" type="text" class="input-text" maxlength="100" value="用户名/邮箱" placeholder="" onclick="changeDefaultInputValue();" onblur="changeDefaultInputValue();" /></td>
      </tr>
      <tr>
        <td>登录密码：</td>
        <td><input name="password" id="password" type="password" class="input-text" maxlength="16" /></td>
      </tr>
      <!--{if $config.logincode == '1'}-->
      <tr>
        <td>验 证 码：</td>
        <td><div style="margin:14px 0">
            <input type="text" id="checkcode" name="checkcode" class="input-text-2" maxlength="6" />
            <img id="checkCodeImg" src="<!--{$urlpath}-->source/include/imagecode.php?act=verifycode" align="middle" /> <a href="javascript:refreshCode();"> 换一张</a> </div></td>
      </tr>
      <!--{/if}-->
      <tr>
        <td>&nbsp;</td>
        <td><input type="button" value="登录网站" class="login-btn" onclick="check_login();" />
          <a target="_top" class="forget-pw" href="<!--{$urlpath}-->index.php?c=passport&a=forget">忘记了密码？</a></td>
      </tr>
    </table>
    </form>
  </div>
  <!--end -->
  
  <div class="right">
    <p class="p1"> 还没有登录账号?&nbsp;<a style="color:#24d" href="<!--{$urlpath}-->index.php?c=passport&a=reg" target="_top">请点此注册</a> </p>
    <p class="qq-method" id="jq-thirdparty-login"> 
      <!--{assign var='oauths' value=vo_list("mod={connect}")}--> 
      <!--{if !empty($oauths)}--> 
      使用多平台登录： <br />
      <!--{foreach $oauths as $volist}--> 
      <a href="<!--{$volist.apiurl}-->" title="<!--{$volist.authname}-->" target="_top"><img src="<!--{$volist.logo}-->" alt="<!--{$volist.authname}-->" /></a>&nbsp;&nbsp; 
      <!--{/foreach}--> 
      <!--{/if}--> 
    </p>
  </div>
</div>
</body>
</html>
<script language="javascript">
function check_login() {
	var loginname = $("#loginname").val();
	var password = $("#password").val();

    if (loginname == "" || loginname == '用户名/邮箱') {
		alert('登录帐号不能为空');
		return false;
	} 

	if (password == "") {
		alert('登录密码不能为空');
		return false;
	} 

	<!--{if $config.regcode=='1'}-->
	if($("#checkcode").val() == "") {
		alert('验证码不能为空');
		return false;
	}
	<!--{/if}-->

	$('#login_form').submit();
}

function changeDefaultInputValue() {
	var a = $("#loginname").val();
	if (a == "") {
		$("#loginname").val("用户名/邮箱");
	} 
	else {
		if(a == '用户名/邮箱') {
			$("#loginname").val("");
		}
	}
	$('#loginname').attr("placeholder", "用户名/邮箱");
}

//验证码
function refreshCode() {
	var ccImg = document.getElementById("checkCodeImg");
	if (ccImg) {
		ccImg.src= ccImg.src + '&' +Math.random();
	}
}
</script>