<%@ include file="/includes.jsp"%>
<script type="text/javascript">
	function save() {

		var id = document.getElementById('patientId').value;
		var csId = document.getElementById('csId').value;
		var isAcknowledged = document.getElementById('isAcknowledged').value;
		var comments = document.getElementById('comments').value;
		var clinicianList = document.getElementById('clinicianList').value;
		location.href = "responsesfromNationalTeam.form?id=" + id + "&csId="
				+ csId + "&isAcknowledged" + isAcknowledged + "&comments="
				+ comments + "&actionRequired=SHOW_PATIENT&clinicianList="
				+ clinicianList;
	}
</script>
<input type="hidden" name="patientId" id="patientId" value="<c:out value="${id}"/>" />
<input type="hidden" name="csId" id="csId" value="<c:out value="${csId}"/>" />
<input type="hidden" name="isAcknowledged" id="isAcknowledged" value="<c:out value="${isAcknowledged}"/>" />
<input type="hidden" name="clinicianList" id="clinicianList" value="" />
<tiles:importAttribute />
<%--This imports all tiles atributes to page --%>

<div class="container">

	<div class="containerSubPage">
		<%--  valign="<%=section.getVAlign()%>" align="<%=section.getHAlign()%>" --%>
		<div class="rowDivSubPage">
			<c:choose>
				<c:when
					test="${fn:contains(pageContext.request.requestURI, '/referrals/')}">
					<tiles:insertTemplate template="/referrals/tiles/responseMenu.jsp" />
				</c:when>
				<c:otherwise>
					<tiles:insertTemplate
						template="../../../nationalMDT/tiles/responseMenu.jsp" />
				</c:otherwise>
			</c:choose>

		</div>
	</div>
	<table width="100%">
		<tr>
			<c:forEach var="section" items="${pge.children }" varStatus="sectionIndex">
				<c:set var="sectionIndexCount" value="${sectionIndex.count }" />
				<%
					com.ardeo.entities.autoforms.FormSection section = (com.ardeo.entities.autoforms.FormSection) pageContext .getAttribute("section");
					com.ardeo.entities.autoforms.FormPage pge = (com.ardeo.entities.autoforms.FormPage) pageContext .getAttribute("pge");
					Integer sectionIndexCount=(Integer)pageContext.getAttribute("sectionIndexCount");
				%>
				<td style="padding: 5px" valign="<%=section.getVAlign()%>" align="<%=section.getHAlign()%>">
					<c:if test="${error ne null}">
						<div class="error"> <img src="../images/16x16/error.png" alt="!" border="0" /> <c:out value="${error}" />
						</div>
					</c:if> 
					<c:if test="${requestScope.successMsg != null and fn:length(requestScope.successMsg) != 0}">
						<div class="message"> <img src="../images/16x16/information.png" alt="i" />&nbsp; <c:out value="${requestScope.successMsg}" /> </div>
					</c:if> <%-- START SECTION --%> 
					<tiles:insertTemplate template="standardSectionRenderer.jsp">
						<tiles:putAttribute name="section" value="${section}" />
						<tiles:putAttribute name="pageWritable" value="true" />
						<tiles:putAttribute name="parentPage" value="${parentPage}" />
						<tiles:putAttribute name="sectionIndex" value="${sectionIndex.count-1}" />
					</tiles:insertTemplate> <%-- END SECTION --%> <%-- END SECTION --%></td>
				<%-- EITHER START A NEW ROW OR INSERT SPACE DEPENDING ON SECTION COUNT --%>
				<%
					if ((sectionIndexCount.intValue() % pge.getSectionsPerRow()) == 0) {
				%>
			
		</tr>
	</table>
	<br />
	<table width="100%">
		<tr>
			<%
				}
			%>
			</c:forEach>
		</tr>

	</table>