<!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_headinc.tpl"}-->
<body>
<div id="doc"> 
  <!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_menu.tpl"}-->
  <div></div>
  <div id="bd">
    <div id="signin" class="clearfix sign-box">
      <div class="main" style="border:0px">
        <h2> <span class="yhzc">登录</span> <span class="yhzc1">还没有帐号？<a href="<!--{$urlpath}-->index.php?c=passport&a=reg">马上注册</a></span> </h2>
        <form method="post" action="<!--{$urlpath}-->index.php?c=passport&a=loginpost&forward=<!--{$forward}-->" class="form" name="login_form" id="login_form">
          <dl>
            <dt>帐&#12288;号</dt>
            <dd>
              <input type="text" class="input-text" name='loginname' id='loginname' value='用户名/邮箱' onClick="changeDefaultInputValue();" onBlur="changeDefaultInputValue();">
            </dd>
          </dl>
          <dl>
            <dt>密&#12288;码</dt>
            <dd>
              <input type="password" class="input-text" name="password" id="password">
            </dd>
          </dl>
          <!--{if $config.logincode == '1'}-->
          <dl>
            <dt>验证码</dt>
            <dd>
              <input type="text" class="input-text" id="checkcode" name="checkcode" autocomplete="off" class="w2" />
              &#12288;<img id="checkCodeImg" src="<!--{$urlpath}-->source/include/imagecode.php?act=verifycode" align="middle" /> <a href="javascript:refreshCode();"> 换一张</a></dd>
          </dl>
          <!--{/if}-->
          <dl class="form-btn">
            <dt>&nbsp;</dt>
            <dd>
              <button type="submit" class="btn-base btn-pink" onClick="return checklogin();"><span>登入</span></button>
              <a class="sign-forget-btn" href="<!--{$urlpath}-->index.php?c=passport&a=forget">忘记密码了？</a><em class="input-tips"></em> </dd>
          </dl>
        </form>
      </div>
    </div>
  </div>
  <!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_footer.tpl"}--> </div>
</body>
</html><script language="javascript">
function checklogin(){
    //帐号
    if($("#loginname").val() == "" || $("#loginname").val() == '用户名/邮箱'){
		alert('登录帐号不能为空');
		return false;
	} 

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

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

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

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