<%@ page contentType="text/html; charset=GBK" session="false"%>
<%@ taglib uri="/cmsTag" prefix="cms"%>

<!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=utf-8" />
		<title>JTop内容管理系统</title>
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		 
		<script type="text/javascript" src="../../javascript/commonUtil_src.js"></script>
		<script type="text/javascript" src="../../style/blue/js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="../../javascript/dialog/lhgdialog.min.js?skin=iblue"></script>
		<style type="text/css">
*{
	margin:0;
	padding:0;
}
body, button, input, select, textarea {
	font:12px/1.5 tahoma, helvetica, arial, \5b8b\4f53, sans-serif;
}
/** text-align:center;**/
body{ background:url(bg_login.jpg) repeat-x #d8ecf3;}
#con{ width:906px; height:541px; margin:0 auto; background:url(login.jpg) no-repeat;}
.height285{ height:267px; width:100%;  display:block;}
.login_input{ height:16px; background-color:#e5f8fc; border:1px solid #99cad8; padding:2px;}
.c1{ color:#3d92a7; width:220px;}
.c2{color:#a8a8a8; width:220px;}
.c3{
	color:#900; width:120px;
}
.red1{ color:#C30;}
.login_button{ background:url(login.png) no-repeat; width:130px; height:120px; border:none; cursor:pointer; vertical-align:middle;}
a.fpw{ color:#3d92a7; text-decoration:none;}
a.fpw:hover{ color:#3d92a7; text-decoration: underline;}
</style>
	</head>
	<script>
	 
	
	if(window.parent.window.location != window.location)
	{
		window.parent.window.location = window.location;
	}
	</script>
	<body>
		<div id="con">
			<div class="height285">
			</div>
			<form id="loginForm" name="loginForm" method="post">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td height="20">
							&nbsp;
						</td>
						<td align="left" valign="middle">
							<span class="red1" style="display:none">登陆失败!</span>
						</td>
						<td>
							&nbsp;
						</td>
					</tr>
					<tr>
						<td width="30%" height="39">
							&nbsp;
						</td>
						<td width="31%" align="left" valign="top">
							<input tabindex="1" type="text" class="login_input c1" id="userName" maxlength="20" name="userName" value="" />
						</td>
						<td width="39%" rowspan="3" align="left" valign="middle">
							<input tabindex="4" type="button" class="login_button" onclick="javascript:login();" />
						</td>
					</tr>
					<tr>
						<td height="37">
							&nbsp;
						</td>
						<td align="left" valign="top">
							<input tabindex="3" type="password" class="login_input c2" id="password" name="password" size="" value="" />
						</td>
					</tr>
					<tr>
						<td height="44">
							&nbsp;
						</td>
						<td align="left" valign="top">
							<table border="0" cellspacing="0" cellpadding="0">
								<tr>

									<td>
										<input tabindex="3" id="sysCheckCode" name="sysCheckCode" type="text" class="login_input c3" maxlength="4"/>
									</td>
									<td>
										&nbsp;
										<img id="checkCodeImg" onclick="javascript:changeCode();" style="cursor: pointer;" src="<cms:BasePath/>common/authImg.cmd?count=4&line=3&point=120&width=90&height=24&jump=4" />
									</td>
								</tr>
							</table>


						</td>
					</tr>

				</table>
			</form>

		</div>
	</body>
</html>
<script type="text/javascript">

function changeCode()
{
	$('#checkCodeImg').attr('src','<cms:BasePath/>common/authImg.cmd?count=4&line=3&point=120&width=90&height=24&jump=4&rand='+Math.random());

}

function login()
{
		var currentLoginHref = window.location.href;
		 
	    if(window.location.href.indexOf('<cms:BasePath/>') != 0)
	    {
	    	$.dialog({ 
							   					title :'提示',
							    				width: '120px', 
							    				height: '60px', 
							                    lock: true, 
							    				icon: '32X32/fail.png', 
							    				
							                    content: '错误的登录入口！', 
							       ok: true 
							                    
			});
			
			return;
	    }
 
		var url = "<cms:BasePath/>login/postLogin.cmd";
        
        var postData =$("#loginForm").serialize();

		$.ajax({
				      		type: "POST",
				       		url: url,
				       		data: postData,
				   
				       		success: function(msg)
				            {     
				               if('-1' == msg)
				               {
				               		changeCode();
				               		
				               		$.dialog({ 
							   					title :'提示',
							    				width: '100px', 
							    				height: '60px', 
							                    lock: true, 
							    				icon: '32X32/fail.png', 
							    				
							                    content: '禁止登录！', 
							       ok: true 
							                    
								  });
				               		
				               		
				               }
				               if('0' == msg)
				               {
				               		changeCode();
				               		
				               		$.dialog({ 
							   					title :'提示',
							    				width: '100px', 
							    				height: '60px', 
							                    lock: true, 
							    				icon: '32X32/fail.png', 
							    				
							                    content: '验证码错误！', 
							       ok: true 
							                    
								  });
				               		
				               		
				               } 
				               else if('1' == msg)
				               {
				               	 
				               		$.dialog.tips('登录成功！正在跳转...',3600,'loading.gif');
				               		window.location.href = '<cms:BasePath/>core/console/main_blue.jsp';
				               		
				               		
				               }	
				               else
				               {
				               		changeCode();
				               		
				               	    $.dialog({ 
							   					title :'提示',
							    				width: '160px', 
							    				height: '60px', 
							                    lock: true, 
							    				icon: '32X32/fail.png', 
							    				
							                    content: '用户名或密码错误！', 
							       ok: true 
							                    
								  });
				               } 
				                
				              
				            }
		});	

      
     
}
</script>

