<%@ include file="/WEB-INF/decorators/include.jsp"%>

<html>
<head></head>
<body>

<authz:authorize ifAllGranted="ROLE_ANONYMOUS">
	<h4 class="title"><fmt:message key="register.title" /></h4>
	<div class="user_new">
		<fmt:message key="form.label.newaccount" />
	</div>
	<fmt:message key="form.label.message" />
	<a href="<c:url value="login.htm"/>" /><fmt:message key="form.label.linkPage" /></a>
</authz:authorize>

<authz:authorize ifNotGranted="ROLE_ANONYMOUS">
	<h4 class="title"><fmt:message key="form.edit.title" /></h4>
	<div class="user_new">
		<fmt:message key="form.edit.txt" />
	</div>
</authz:authorize>

<br />
<form:form method="post" commandName="registerUser" id="account_data">
	<form:hidden path="isNew"/>

<p class="legend"><fmt:message key="form.field.account" /></p>
<fieldset>
	<span class="info"><fmt:message key="form.field.necessary" /></span>
	<div>
		<form:label path="login"><fmt:message key="form.register.user.login" /></form:label>
		<authz:authorize ifNotGranted="ROLE_ANONYMOUS">
			<form:input path="login" disabled="true"/>*
		</authz:authorize>
		<authz:authorize ifAllGranted="ROLE_ANONYMOUS">
			<form:input path="login" disabled="false"/>*
		</authz:authorize>
		<span class="formError"><form:errors path="login" /></span>
	</div>
	<div>
		<form:label path="password"><fmt:message key="form.register.user.password" /></form:label>
		<form:password path="password" showPassword="true"/>*
		<span class="formError"><form:errors path="password" /></span>
	</div>
	<div>
		<form:label path="passwordConfirm"><fmt:message key="form.register.user.passwordConfirm" /></form:label>
		<form:password path="passwordConfirm" showPassword="true"/>*
	</div>
</fieldset>

<p class="legend"><fmt:message key="form.field.personal" /></p>

<fieldset>
	<div>
		<form:label path="firstName"><fmt:message key="form.register.user.firstName" /></form:label>
		<form:input path="firstName"/>*
		<span class="formError"><form:errors path="firstName" /></span>
	</div>
	<div>
		<form:label path="lastName"><fmt:message key="form.register.user.lastName" /></form:label>
		<form:input path="lastName"/>*
		<span class="formError"><form:errors path="lastName" /></span>
	</div>
	<div>
		<form:label path="email"><fmt:message key="form.register.user.email" /></form:label>
		<form:input path="email"/>*
		<span class="formError"><form:errors path="email" /></span>
	</div>
	<div>
		<form:label path="organization"><fmt:message key="form.register.user.organization" /></form:label>
		<form:input path="organization"/>
		<span class="formError"><form:errors path="organization" /></span>
	</div>
</fieldset>

<center>
<a class="back_link" href="<c:url value="login.htm"/>">
			<fmt:message key="form.link.back" />
	</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<a class="register_link" href="javascript:document.getElementById('account_data').submit();">
			<fmt:message key="login.label.continue" />
	</a>
	
</center>
</form:form>

  </body>
</html>
