<!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=gb2312" />{#qishi_pageinfo set="列表名:page,调用:QS_login"#}
<title>{#$page.title#}-建材销售人才网 www.jcxsr.com</title>
<meta name="description" content="{#$page.description#}">
<meta name="keywords" content="{#$page.keywords#}">
<meta http-equiv="X-UA-Compatible" content="IE=7">
<link rel="shortcut icon" href="{#$QISHI.site_dir#}favicon.ico" />
<meta name="author" content="建材销售人才网，建材人才网" />
<meta name="copyright" content="epzpw.com" />
<link href="{#$QISHI.site_template#}css/common.css" rel="stylesheet" type="text/css" />
<link href="{#$QISHI.site_template#}css/user.css" rel="stylesheet" type="text/css" />
<script src="{#$QISHI.site_template#}js/jquery.js" type='text/javascript' language="javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{
//
$("#username").focus(function(){
	if ($("#username").val()=="用户名/邮箱/手机号")
	{
	$("#username").val('');
	$("#username").css("color","");
	}  
});
//
$(".but80").hover(function(){$(this).addClass("but80_hover")},function(){$(this).removeClass("but80_hover")});
//验证
$("form[id=Formlogin]").submit(function(e) {
e.preventDefault();
	if ($("#username").val()=="" || $("#username").val()=="用户名/邮箱/手机号")
	{			
		$(".login_err").html("请填写：用户名 / 邮箱 / 手机号");	
		$(".login_err").show();
	}
	else if($("#password").val()=="")
	{	
	$(".login_err").html("请填写密码！");
	$(".login_err").show();
	}
	{#if $verify_userlogin=="1"#}
	else if($("#postcaptcha").val()=="" || $("#postcaptcha").val()=="点击获取验证码")
	{	
	$(".login_err").html("请填写验证码！");
	$(".login_err").show();
	}
	{#/if#}
	else
	{
		$("#login").val("正在登录");
		$("#login").attr("disabled","disabled");
		 if($("#expire").attr("checked")==true)
		 {
		 var expire=$("#expire").val();
		 }
		 else
		 {
		 var expire="";
		 }
		$.post("{#$QISHI.site_dir#}plus/ajax_user.php", {"username": $("#username").val(),"password": $("#password").val(),"expire":expire,"url":"{#$smarty.get.url#}","postcaptcha":$("#postcaptcha").val(),"time": new Date().getTime(),"act":"do_login"},
	 	function (data,textStatus)
	 	 {
			if (data=="err" || data=="errcaptcha")
			{			
				$("#login").val("登录");
				$("#login").attr("disabled","");
				$("#password").attr("value","");
				$(".login_err").show();	
				if (data=="err")
				{
				errinfo="帐号或者密码错误";
				}
				else if(data=="errcaptcha")
				{
				$("#imgdiv img").attr("src",$("#imgdiv img").attr("src")+"1");
				errinfo="验证码错误";
				}
				$(".login_err").html(errinfo);
			}
			else
			{
				$("body").append(data);
			}
	 	 })		
	}
	return false;
});
//
//验证码部分
{#if $verify_userlogin=="1"#}
function imgcaptcha(inputID,imgdiv)
{
	$(inputID).focus(function(){
		if ($(inputID).val()=="点击获取验证码")
		{
		$(inputID).val("");
		$(inputID).css("color","#333333");
		}
		$(inputID).parent("div").css("position","relative");
		//设置验证码DIV
		$(imgdiv).css({ position: "absolute", left:  $(inputID).width(), "bottom": "0px" , "z-index": "10", "background-color": "#FFFFFF", "border": "1px #A3C8DC solid","display": "none","margin-left": "15px"});
		$(imgdiv).show();
		if ($(imgdiv).html()=='')
		{
		$(imgdiv).append("<img src=\"{#$QISHI.site_dir#}include/imagecaptcha.php?t={#$random#}\" id=\"getcode\" align=\"absmiddle\"  style=\"cursor:pointer; margin:3px;\" title=\"看不请验证码？点击更换一张\"  border=\"0\"/>");
		}
		$(imgdiv+" img").click(function()
		{
			$(imgdiv+" img").attr("src",$(imgdiv+" img").attr("src")+"1");
		});
		$(document).unbind().click(function(event)
		{
			var clickid=$(event.target).attr("id");
			if (clickid!="getcode" &&  clickid!="postcaptcha")
			{
			$(imgdiv).hide();
			$(inputID).parent("div").css("position","");
			$(document).unbind();
			}			
		});
	});
}
imgcaptcha("#postcaptcha","#imgdiv");
//验证码结束
{#/if#}
//
});
</script>
</head>
<body>
{#include file="user/header.htm"#}

<div class="login_bg">
	<div class="login_box">
			  <div class="login_boxin">
			<form id="Formlogin" name="Formlogin" method="post">
			<div class="tit">会员登录</div>
		  <div class="login_err"></div>
			<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" >
			 
			<tr><td width="55" align="right" id="account">帐号：</td>
			<td>
			  <input name="username" type="text"  class="login_input" id="username"   maxlength="30" value="用户名/邮箱/手机号" style="color:#999999"/>    </td>
		  </tr>
		  <tr>
			<td align="right">密码：</td>
			<td>
			  <input name="password" type="password"  class="login_input" id="password"  maxlength="20"/>    </td>
		  </tr>
		  {#if $verify_userlogin=="1"#}
		  <tr>
			<td align="right">验证码：</td>
			<td>
			  
			  <div>
	<div id="imgdiv"></div>
	<input  class="login_input"    name="postcaptcha" id="postcaptcha" type="text" value="点击获取验证码" style="color:#999999"/>
 
	
			</div>
			  </td>
		  </tr>
		  {#/if#}
		  <tr>
			<td align="right">&nbsp;</td>
			<td><div style="position:relative;"><label><input type="checkbox" name="expire" id="expire" value="7" />
			  一周内自动登录</label></div></td>
		  </tr>
		  </table>
		  {#if $smarty.get.url#}
		  <div class="login_tip">您所访问的页面需要登录后才能访问！</div>
		  {#/if#}
		  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" >  
		  <tr>
			<td align="right" width="50">&nbsp;</td>
			<td height="40" valign="top">
			<div style="position:relative;">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td width="100">
				<input type="submit" name="submitlogin"  id="login" class="but80" value="登录" />
				</td>
				<td class="link_bk"><a href="{#$QISHI.site_dir#}user/user_getpass.php">忘记密码？</a></td>
			  </tr>
			</table>
			</div>
			</td>
			</tr>
		  <tr>
			<td align="right" style="border-top:1px  #E8E8E8 solid">&nbsp;</td>
			<td height="20" class="link_lan" style="border-top:1px  #E8E8E8 solid">还没有账号？<a href="{#$QISHI.site_dir#}user/user_reg.php">免费注册</a></td>
		  </tr>
		  {#if $QISHI.qq_apiopen=="1"#}
		  <tr>
		    <td align="right"  >&nbsp;</td>
		    <td  class="link_lan"  >或者你也可以用以下网站帐号登录</td>
		    </tr>
		  <tr>
		    <td align="right"  >&nbsp;</td>
		    <td height="20" valign="middle"  class="link_lan"  >
			<img src="{#$QISHI.site_template#}images/75.gif" align=absmiddle/>
			<a href="{#$QISHI.site_dir#}user/qqconnect.php" >用QQ帐号登录</a></td>
		    </tr>
			{#/if#}
		</table>
		</form>
		</div>
  </div>
  <div class="clear"></div>
</div>
{#include file="user/footer.htm"#}
</body>
</html>
