<%@ page language="java" session="true" contentType="text/html;charset=ISO-8859-2" %>
<%@ page import="com.etixpert.evolution.gui.servlets.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.net.*"%>
<%@ page import="com.etixpert.evolution.gui.servlets.*"%>
<%@ page import="com.etixpert.evolution.*"%>
<%@ page import="java.sql.*"%>
<%@ page pageEncoding="UTF-8"%>
<%@ include file="header.jsp" %>
<%@ include file="check.jsp" %>

<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link href="css/evolution.css" rel="stylesheet" type="text/css">
<script language="JavaScript">

function simpleLink(origLink) {
		parent.mainFrame.location = origLink;
	}

function link(origLink, page_action){
		if (top.mainFrame.document.forms.length == 0) {
			simpleLink(origLink);
			return;
		}
		else {
			if (top.mainFrame.document.forms[0].saveState == null) {
				simpleLink(origLink);
				return;
			}

			top.mainFrame.document.forms[0].saveState.value = top.mainFrame.self.location.pathname;
			top.mainFrame.document.forms[0].link.value = origLink;
			top.mainFrame.document.forms[0].pageAction.value = page_action;
			top.mainFrame.document.forms[0].submit();
		}
	}

</script>
</head>
<html>
<%	
  boolean admin = false;
  String focused = "old_password";
  if (session.getAttribute("admin")!=null) {
  	admin = true;
  	focused = "new_password";
  }
  if (session.getAttribute("password_error")!=null) { %>
 <body onload="alert('<%=session.getAttribute("password_error")%>');">
<% session.removeAttribute("password_error");
 } else if (session.getAttribute("PASSWORD_CHANGED")!=null) { %>
<body>
<script language=javascript>
	alert('<fmt:message key="PASSWORD_FOR"/> <%=session.getAttribute("password_person")%> <fmt:message key="TEST_T2"/>!');
	parent.mainFrame.location = 'password_person_selection.jsp';
</script>
<%
	session.removeAttribute("PASSWORD_CHANGED");
 } else { %>

 <body onload="document.forms[0].<%=focused%>.focus();">
<% } %>
<form name=new_order action="process/new_order.jsp" method="post">
		<input type="hidden" name="link" value="process/password_changing.jsp"/>
    	<input type="hidden" name="saveState"/>
    	<input type="hidden" name="pageAction"/>
	<label class="large"><%=FormHelper.generatePasswordPersonLine(session)%></label><br>
	<%if (!admin) {%>
	<label for="old_password"><fmt:message key="OLD_PASSWORD"/>:</label>
	<input type="password" name="old_password" class="normal" value=""><br>
	<%}%>
	<label for="new_password"><fmt:message key="NEW_PASSWORD"/>:</label>
	<input type="password" name="new_password" class="normal" value=""><br>

	<label for="re_new_password"><fmt:message key="NEW_PASSWORD_AGAIN"/>:</label>
	<input type="password" name="re_new_password" class="normal" value=""><br>

 <div width="800" height="30" align="left" class="menu">
 &nbsp;&nbsp;&nbsp;
 <a href="javascript:link('process/password_change.jsp', 'change_password');">Ok</a>
 &nbsp;&nbsp;&nbsp;
 <a href="javascript:link('process/password_person_selection.jsp', 'cancel_password_changing');">Verwerfen</a>
 </div>
</form>
<body>
<html>