<%@ page language="java" import="java.util.*,com.util.Escape"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String loginlog = "";
	String errormsg = "none;";

	loginlog = (String) request.getAttribute("loginlog");
	loginlog = Escape.unescape(loginlog);
	try {
		String path2 = request.getAttribute(
				"javax.servlet.forward.request_uri").toString();
		if (!path2.contains("loginout.tag") && loginlog != null
				&& loginlog.trim() != "" && !"请重新登录！".equals(loginlog)) {
			errormsg = "block;";
		}
	} catch (Exception e) {
	}
	String yzText = " class=\"easyui-textbox\" novalidate=\"true\" missingMessage=\"不能为空!\"  ";
%>
<!DOCTYPE html>
<!-- saved from url=(0030)http://jaguar.ag1199.cn/#login -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录</title>
<meta name="viewport"
	content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=yes">


<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<meta property="wb:webmaster" content="b88043bf3bca5af9">

<meta property="qc:admins" content="11043444406454630162546654">

<link rel="stylesheet" type="text/css" href="<%=path%>/css/index.css">

<link rel="stylesheet" type="text/css" href="<%=path%>/css/mc.css">

<!--[if lt IE 9]>
<script type="text/javascript">
window.JSON = JSON = {};
window.JSON.toString = JSON.toString = function(){ return '[object JSON]'; }
</script>
<script src="/lib/JSON-js/json2.js"></script>
<![endif]-->

<link rel="icon" type="image/x-icon"
	  href="<%=path%>/images/favicon.png" >
<link rel="stylesheet" type="text/css" href="<%=path%>/css/login.css">


<script src="<%=path%>/js/jquery.min.js"></script>
<script src="<%=path%>/js/common.js"></script>
<script type="text/javascript">
	if (window.top.location.href != location.href) {
		window.top.location.href = location.href;
	}
	$(function() {
		
		
		/* var wHeight;
		if(navigator.userAgent.toLowerCase().indexOf("chrome") == -1){
			 wHeight = document.body.scrollHeight - 4;
		}else {
			 wHeight = document.body.scrollHeight;
		}
		
		alert(wHeight);
		$("#bgImg").height(wHeight); */
	
/* 		setTimeout(function() {
			$('#um').next('span').find('input').focus();
			;
		}, 50);
 */

		/* $('#username').textbox('textbox').keydown(function(e) {
			if (e.keyCode == 13) {
				$("input[name=button]").click();
			}
		});
		$('#password').textbox('textbox').keydown(function(e) {
			if (e.keyCode == 13) {
				$("input[name=button]").click();
			}
		});
		//控制按钮
		$("#username").textbox('textbox').bind('keyup', function() {
			checkLoginForm();
		});
		$("#password").textbox('textbox').bind('keyup', function() {
			checkLoginForm();
		});
		$("#username").textbox('textbox').bind('change', function() {
			checkLoginForm();
		});
		$("#password").textbox('textbox').bind('change', function() {
			checkLoginForm();
		});
		$("#username").textbox('textbox').bind('blur', function() {
			checkLoginForm();
		});
		$("#password").textbox('textbox').bind('blur', function() {
			checkLoginForm();
		});
		$("#username").textbox('textbox').bind('focus', function() {
			checkLoginForm();
		});
		$("#password").textbox('textbox').bind('focus', function() {
			checkLoginForm();
		}); */
		$("#username").keydown(function(e) {
			if (e.keyCode == 13) {
				$("input[type=button]").click();
			}
		});
		$("#password").keydown(function(e) {
			if (e.keyCode == 13) {
				$("input[type=button]").click();
			}
		});
		
		 $("#username").bind("keyup",function(){
			checkLoginForm();
		});
		$("#password").bind("keyup",function(){
			checkLoginForm();
		}); 
		$("#username").bind("change",function(){
			checkLoginForm();
		});
		$("#password").bind("change",function(){
			checkLoginForm();
		}); 
		/* $("#username").bind("blur",function(){
			checkLoginForm();
		});
		$("#password").bind("blur",function(){
			checkLoginForm();
		}); */
		/* $("#username").bind("focus",function(){
			checkLoginForm();
		});
		$("#password").bind("focus",function(){
			checkLoginForm();
		}); */
	});

	function checkLoginForm() {
		var password = $("#password").val();
		var username = $("#username").val();
		if ( "" != password && "" != username) {
			$("#LoginForm1BtnCtId").removeClass("checkFair");
			$("#LoginForm1BtnCtId").addClass("checkSuccess");
		return true;
		} else {
		//alert("提交不能为空");
		$("#LoginForm1BtnCtId").removeClass("checkSuccess");
		$("#LoginForm1BtnCtId").addClass("checkFair");
		return false;
		}
	}
	function login(){
	
		if(checkLoginForm()){
		$(".userPrompt").hide();
		var password = $("#password").val();
		var username = $("#username").val();
		var params={};
		params["password"]=password;
		params["username"]=username;
			var result = ajaxgetresultpost($("#paths").val()
					+ '/base/login.do',params );
			if(result.flag==0){
			//alert(result.msg);
			$(".userPrompt").text(result.msg);
			$(".userPrompt").show();
			
			}else{
				  window.location.href=$("#paths").val()+"/base/home.do";
				  $(".userPrompt").hide();
			}		
		}
	
	}
	
	
</script>
<style>
	
</style>
</head>
<body style="zoom: 1;">
	<%-- <img id="bgImg" src="<%=path %>/images/Login2.jpg" style="position:absolute;top:0;left:0;z-index:-1;width:100%" /> --%>
	<div id="header">
		<img class="carlogo" src="<%=path %>/images/carlogo.png">
		<img src="<%=path %>/images/topLogo.png">
	</div>
 <input type="hidden" name="paths" id="paths" value="<%=path %>"/>
	 <div id="main"> 
	 <div id="loginWrap">
	 	 <form onsubmit="return false;">
	 	<div id="loginTitle">捷豹路虎道路救援管理系统</div>
		<div style="margin-top:25px;">
			<span style="display: inline-block;width: 75px;letter-spacing: 2px;">用户名<font style="color:red;">*</font></span>
			<input id="username" name="username" type="text" value="" class="mc-ipt-text" />
		</div>
		<div style="margin-top:20px;">
			<span style="display: inline-block;width: 75px;">密&nbsp;&nbsp;码<font style="color:red;">*</font></span>
			<input id="password" name="password" type="password" value="" class="mc-ipt-text" />
		</div>
		<div style="margin-top:10px;">
			<span style="display: inline-block;width: 75px;">&nbsp;</span>
			<span class="userPrompt"></span>
		</div>
		<div style="margin-top:10px;">
			<span style="display: inline-block;width: 75px;">&nbsp;</span>
			<input id="LoginForm1BtnCtId" class="checkFair" type="button" onclick="login()" value="登   录">
		</div>
		</form>
		<div id="tip">
			<span style="letter-spacing: 1px;">账号密码请咨询：021-53682508</span><br/>
			
			<span>或邮箱: sino-selection@sino-assistance.com</span><br/>
			<span style="letter-spacing: 1px;">工作时间：周一至周五 9:00 - 17:30</span>
		</div>
	 </div>

		 	
		 	
		 	
		 	
		 	<!-- <div class="validation-summary-errors" style="display: none;">
				<span>登录不成功。请更正错误并重试。</span>
				<ul>
					<li>提供的用户名或密码不正确。</li>
				</ul>
			</div>
 -->
		<!-- <div class="login"> -->
			<!-- <div class="tologin">
				<p class="userPrompt"></p>
				<div class="validation-summary-errors" style="display: none;">
					<span>登录不成功。请更正错误并重试。</span>
					<ul>
						<li>提供的用户名或密码不正确。</li>
					</ul>
				</div>
				<form onsubmit="return false;">
					<div class="editor-field" style="">
						<label for="UserName">用户名&nbsp;<span class="redStar">*</span></label><span id="input3Wrap"><input
							id="username" name="username" type="text" value="" class="mc-ipt-text"
							style="width: 200px;height: 28px;"><span class="mc-ipt"
							style="width: 210px;height: 28px;"></span><span id="input3Msg"
							class="mc-ipt-tip-login" style="display: none;"></span></span>
					</div>
					<div class="editor-field" style="margin-bottom:0px;">
						<label for="Password">密&nbsp;&nbsp;码&nbsp;<span class="redStar">*</span></label><span id="input4Wrap"><input
							id="password" name="password" type="password" value=""
							class="mc-ipt-text" style="width: 200px;height: 28px;"><span
							class="mc-ipt" style="width: 210px;height: 28px;"></span><span
							id="input4Msg" class="mc-ipt-tip-login"></span></span>
					</div>
					
					<div>
						<input id="LoginForm1BtnCtId" class="checkFair" type="button" onclick="login()"
							value="登   录">
					</div>
				</form>
			</div> -->
		<!-- </div> -->
	</div>
</body>
</html>