<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站后台管理系统</title>
<link rel="shortcut icon" href="{$conf.weburl}/images/favicon.ico" type="image/x-icon" />
<link href="styles/login_style.css" rel="stylesheet" type="text/css" />
{insert_scripts files="../js/jquery.min.js"}
</head>
<script type="text/javascript">
{literal}
if (window.parent != window){
  window.top.location.href = location.href;
}
function formSubmit(e){   
    var charCode=(navigator.appName=="Netscape")?e.which:e.keyCode;   
    if(charCode==13){
		if (validate()){
			document.getElementById('theForm').submit();  
		}
    }
}
{/literal}
</script>

<div id="loading"><img src="images/loading.gif" border="0" alt="loading..." /></div>
<body>
<div style="height:48px; margin:0px auto;"></div>
<div class="Clear"></div>
<div class="main">
<div class="BG_left"></div>
<div class="login">
<div class="login_Name"></div>
<form method="post" action="" id="theForm" name="theForm" class="M">
	<ul>
		<li class="form">
		 <input value="" type="text" name="user_name" id="user_name" onmouseover="this.className='blank1'"  onmouseout="this.className='blank'" class="blank" onKeyDown="formSubmit(event);" />
		</li>
		<li class="form">
		  <input type="password" name="password" id="password" onmouseover="this.className='key1'"  onmouseout="this.className='key'" class="key" onKeyDown="formSubmit(event);" />
		</li>
		<li class="button">
		<a href="javascript:void();" class="submit" onclick="return validate();"></a>
		</li>   
		<li class="help"><span>密码忘了？</span><a class="forgot" href="get_password.php?act=forget_pwd">这里找回</a></li>     
	</ul>
	</form>
</div>	
<div class="BG_right"></div>
</div>
<div class="Clear"></div>
<div class="footer">
<span>版权所有  2010-2015  {$company_profile.name} All rights reserved.&nbsp;&nbsp;<a href="templates/free.html" target="_blank"><font color="#ff0000"><免费试用版></font></a></span>
<a href="../" target="_blank" title="打开网站前台首页" class="footer_a"></a>
</div>
<script type="text/javascript">
{literal}
$('#user_name').focus();
function validate(){

	var user_name= $("#user_name").val();
	var password= $("#password").val();

	if(user_name==''){
		alert('请输入用户名!');
		$("#user_name").focus();
		return false;
	}

	if(password == ''){
		alert('请输入密码!');
		$("#password").focus();
		return false;
	}

	$.ajax({
		url:"privilege.php",
		type:"POST",
		dataType:"json",
		data:{"act":"signin",
		"user_name":user_name,
		"password":password
		},
		beforeSend:function(){
			$("#loading").fadeIn("fast");
		},
		complete:function(){
			$("#loading").stop();
			$("#loading").fadeOut("fast");
		},
		success: function(result){
					if(result.error == 1){
						alert(result.message);
					}else{
						location.href = "index.php";
					}
				}
	 });
}
{/literal}
</script>
</body>
</html>