<html>
<%@ page import="java.util.Date" errorPage="Error.jsp" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-1.0.2" prefix="bean" %>
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/utiltaglib.tld" prefix="util" %>

<%
    /* Compute today's date and store it in pageContext */
    pageContext.setAttribute("date", new Date());
%>

<head>
   <title><bean:message key="faq.title.report"/></title>
   <link type="text/css" rel="stylesheet" href="faqapp.css">
</head>

<body>

<h1>
  <center>
    <c:out value="${FAQQueryForm.areaDesc}"/>
    <bean:message key="faq.header.report"/>
  </center>
</h1>

<c:if test="${FAQQueryForm.internalFlag}">
  <h3>
    <center>
      <bean:message key="faq.report.internal"/>
   </center>
  </h3>
</c:if>
<br>

<i>
  <b><bean:message key="faq.report.lastUpdated"/></b>
  <fmt:formatDate value="${date}" type="DATE"/>
</i>

<H3>
  <a name="TOC"><bean:message key="faq.report.questionHeader"/></a>
</H3>

<%--
Use JSTL to loop through all FAQs stored in Struts form.
Display all questions for FAQs and filter questions based on "internalFlag".
Link all questions to answers created later on this page.
--%>

<OL>
  <c:forEach items="${FAQQueryForm.FAQs}" var="faq" varStatus="status">
    <c:choose>
      <c:when test="${!FAQQueryForm.internalFlag}">
        <c:if test="${!faq.internalFlag}">
          <LI>
            <B>
              <a href="#<c:out value="${status.index}"/>">
                <c:out value="${faq.question}" escapeXml="false"/>
              </a>
            </b>
          </LI>
        </c:if>
      </c:when>
      <c:otherwise>
        <LI>
          <b>
            <a href="#<c:out value="${status.index}"/>">
              <c:out value="${faq.question}" escapeXml="false"/>
            </a>
          </b>
        </LI>
      </c:otherwise>
    </c:choose>
  </c:forEach>           
</OL>

<H3><bean:message key="faq.report.answerHeader"/></H3>

<%--
Use JSTL to loop through all FAQs stored in Struts form.
Display all answers for FAQs and filter answers based on "internalFlag".
--%>

<OL>
<c:forEach items="${FAQQueryForm.FAQs}" var="faq" varStatus="status">
   <c:choose>
      <c:when test="${!FAQQueryForm.internalFlag}">
         <c:if test="${!faq.internalFlag}">
            <LI>
              <b>
                <a NAME="<c:out value="${status.index}"/>"></a>
                <c:out value="${faq.question}" escapeXml="false"/>
              </b>
              <p><c:out value="${faq.answer}" escapeXml="false"/></p>
              <a href="#TOC"><bean:message key="faq.report.toclink"/></a>
            </LI>
         </c:if>
      </c:when>
      <c:otherwise>
         <LI>
           <b>
             <a NAME="<c:out value="${status.index}"/>"></a><c:out value="${faq.question}" escapeXml="false"/>
           </b>
           <p><c:out value="${faq.answer}" escapeXml="false"/></p>
           <a href="#TOC"><bean:message key="faq.report.toclink"/></a>
         </LI>
      </c:otherwise>
   </c:choose>
   <br>
</c:forEach>
</OL>

<H2>&nbsp;</H2>

</body>
</html>









