<!-- Include -->
<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %> 
<%@ taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %>
<%@ include file="/WEB-INF/decorators/include.jsp"%>

<!-- Doctype -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
	<head>
		<link rel="icon" type="image/png" href="./images/favicon.png" />
		<title><fmt:message key="title" /></title>
		<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
		<script type='text/javascript' src='./javascripts/prototype.js'></script>
		<script type='text/javascript' src='./javascripts/rounded_boxes.js'></script>
			<script type="text/javascript">

var LoginManager = Class.create({
	initialize: function(inputField, inputField2){
		$(inputField).observe("keypress", this.KeyPressHandler.bindAsEventListener(this));
		$(inputField2).observe("keypress", this.KeyPressHandler.bindAsEventListener(this));
	},
	KeyPressHandler: function(event){
		switch(event.keyCode){
			case Event.KEY_RETURN:
			if (event.element().parentNode.id == 'mainformlogin')
				$('mainformlogin').submit();
			else
				$('mainformlogin2').submit();
		}
	}
});

</script>
		<decorator:head />
	</head>
	
	<body>
	
		<!--  Container -->
		<div id="container">
		
		
			<div id="logotexte">
				<a href="main.htm"><img src="./images/logo-yacos-texte.png" alt="Logo Yacos Texte" /></a>
			</div>
		
		
		<!-- User Information -->
		<div id="userlogin">
			
			<!-- For anonymous user display the login form -->
			<authz:authorize ifAllGranted="ROLE_ANONYMOUS">
				<page:applyDecorator name="empty" page="/login.jsp" />
			</authz:authorize>

			<!-- For authenticated user display user information-->
			<authz:authorize ifNotGranted="ROLE_ANONYMOUS">
				<page:applyDecorator name="empty" page="/WEB-INF/jsp/secure/userinformation.jsp" />
			</authz:authorize>
			
		</div>
		
		<!-- headermenu -->
		<page:applyDecorator name="empty" page="/WEB-INF/decorators/headerchoose.jsp" />
	
		<!-- Main bloc -->
			
			<div id="main">
			
				<!-- dynamic menu with session -->
				<page:applyDecorator name="empty" page="/WEB-INF/decorators/usermenu.jsp" />
				
				<div id="maincontent">
				
					<!--  Contents of decorated page -->
					<decorator:body />
					
				</div><!--maincontent-->
			</div><!--main-->
		

		<!-- footer -->
		<page:applyDecorator name="empty" page="/WEB-INF/decorators/footer.jsp" />
		
		</div><!--container-->
	</body>
</html>