<?xml version="1.0" encoding="UTF-8"?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
	  xmlns:c="http://java.sun.com/jsp/jstl/core"
	  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
	  xmlns:nk="urn:jsptagdir:/WEB-INF/tags/nekurak"
	  version="2.0">
    <jsp:directive.page contentType="application/xhtml+xml"/>
    <jsp:output doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd"
		doctype-root-element="html"
		omit-xml-declaration="false"/>

    <!-- <lokalizace> -->
    <c:if test="${param.jazyk != null}">
	<fmt:setLocale value="${param.jazyk}" scope="session"/>
    </c:if>
    <fmt:setBundle basename="cz.frantovo.nekurak.preklady" scope="application"/>
    <!-- </lokalizace> -->

    <!-- <autentizace> -->
    <c:set var="prihlasenyUzivatel" scope="request" value="${pageContext.request.userPrincipal.name}"/>
    <c:if test="${param.akce == 'prihlaseni' &amp;&amp; param.odhlasit == 'ano'}">
	<!--
	    Uživatele musíme odhlásit dřív, než vykreslíme nabídku,
	    která závisí na tom, zda je uživatel přihlášený nebo ne.
	    „prihlaseni.jsp?odhlasit=ano“ už vypíše jen hlášku, že byl odhlášen.
	-->
	<jsp:scriptlet>session.invalidate();</jsp:scriptlet>
	<c:set var="prihlasenyUzivatel" scope="request" value="${null}"/>
    </c:if>
    <!-- </autentizace> -->


    <html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:svg="http://www.w3.org/2000/svg"
	  xmlns:xlink="http://www.w3.org/1999/xlink">
	<head>
	    <title><fmt:message key="nazev"/></title>
	    <link href="styl.css" type="text/css" rel="StyleSheet"/>
	    <script type="text/javascript" src="js/jquery.js"></script>
	    <script type="text/javascript" src="js/jquery.bxSlider.js"></script>
	    <link rel="alternate" type="application/atom+xml" title="podniky" href="atom/" />
	</head>
	<body>
	    <div class="body">

		<div id="horniPruh">
		    <h1><fmt:message key="nazev"/></h1>
		</div>

		<ul id="nabidka">
		    <li><a href="?"><fmt:message key="uvod"/></a></li>

		    <c:choose>
			<c:when test="${prihlasenyUzivatel == null}">
			    <li><a href="?akce=prihlaseni"><fmt:message key="prihlasitSe"/></a></li>
			    <li><a href="?akce=registrovatUzivatele"><fmt:message key="registrovatSe"/></a></li>
			</c:when>
			<c:otherwise>
			    <li><a href="?akce=pridatPodnik"><fmt:message key="pridatPodnik"/></a></li>
			    <li id="prihlasenyUzivatel"><fmt:message key="prihlasenyUzivatel"/>: ${prihlasenyUzivatel}</li>
			    <li><a href="?akce=prihlaseni&amp;amp;odhlasit=ano"><fmt:message key="odhlasitSe"/></a></li>
			</c:otherwise>
		    </c:choose>

		</ul>

		<nk:prepinaniJazyku/>

		<div id="obsah">

		    <c:choose>
			<c:when test="${param.akce == 'detail'}">
			    <jsp:include page="/WEB-INF/casti/detail.jsp" flush="false"/>
			</c:when>
			<c:when test="${param.akce == 'pridatPodnik'}">
			    <jsp:include page="/WEB-INF/casti/pridatPodnik.jsp" flush="false"/>
			</c:when>
			<c:when test="${param.akce == 'registrovatUzivatele'}">
			    <jsp:include page="/WEB-INF/casti/registrovatUzivatele.jsp" flush="false"/>
			</c:when>
			<c:when test="${param.akce == 'prihlaseni'}">
			    <jsp:include page="/WEB-INF/casti/prihlaseni.jsp" flush="false"/>
			</c:when>
			<c:otherwise>
			    <jsp:include page="/WEB-INF/casti/uvod.jsp" flush="false"/>
			</c:otherwise>
		    </c:choose>

		</div>

		<div id="paticka">
		    <p>
			<fmt:message key="licence"/>&amp;#160;
			<a href="nekurak.net-src.zip">nekurak.net-src.zip</a>
			<a href="nekurak.net-src.zip.SHA-512">.</a>
		    </p>
		</div>

	    </div>
	</body>
    </html>

</jsp:root>
