<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ViewMasterPageSub.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
	<link href="../../Content/Skin/Validation.css" rel="stylesheet" type="text/css" />
	<script src="../../Scripts/Admin.js" type="text/javascript"></script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LeftContent" runat="server">
	<div class="Item">
		<div class="LeftNavTitle"><%= Language.Context.User.LabelNavTitle %></div>
		<div>
			<%Html.RenderPartial("partial_LeftNav_User");%></div>
	</div>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="RightContent" runat="server">
	<div class="Item">
		<div class="Location">
			<%= Html.ActionLink(Language.Context.Global.HomePage, "Index")%>
			<%= Language.Context.User.ChangePassword %>
		</div>
		<div class="WebContent" style="margin-left:35%">
		<script type="text/javascript">
			$(document).ready(function () {
				$("#frmchangepwd").submit(function () {
					var oldpwd = $("input[name='oldpwd']");
					var pwd1 = $("input[name='pwd1']");
					var pwd2 = $("input[name='pwd2']");
					if (oldpwd.val().length < 6) {
						alert("<%= Language.Context.User.JsAlertOldPasswordShort %>");
						oldpwd.focus();
						return false;
					}
					if (pwd1.val().length < 6) {
						alert("<%= Language.Context.User.JsAlertNewPasswordShort %>");
						pwd1.focus();
						return false;
					}
					if (pwd2.val().length < 6) {
						alert("<%= Language.Context.User.JsAlertConfirmPasswordShort %>");
						pwd2.focus();
						return false;
					}
					if (pwd1.val() != pwd2.val()) {
						alert("<%= Language.Context.User.JsAlertPasswordNotEquals %>");
						pwd2.focus();
						return false;
					}
				});
			});
		</script>
		<% using (Html.BeginForm("UserChangePwd", "Home", FormMethod.Post, new { id = "frmchangepwd" })) {%>
			<%= Html.AntiForgeryToken()%>
			<div>
				<span class="editor-label"><%= Language.Context.User.LableOldPassword %></span>
				<span class="editor-field"><input type="password" name="oldpwd" /></span>
			</div>
			<div>
				<span class="editor-label"><%= Language.Context.User.LableNewPassword %></span>
				<span class="editor-field"><input type="password" name="pwd1" /></span>
			</div>
			<div>
				<span class="editor-label"><%= Language.Context.User.LabelConfirmNewPassword %></span>
				<span class="editor-field"><input type="password" name="pwd2" /></span>
			</div>
			<div>
				<span class="editor-label">&emsp;</span>
				<span class="editor-field"><input type="submit" value="<%= Language.Context.User.InputValueConfirmChange %>" class="btn w90" /></span>
			</div>
			<% } %>
		</div>
	</div>
</asp:Content>

