<%@ include file="/includes.jsp"%>

<link href="../referrals/css/main.css" type="text/css" rel="stylesheet" />
<table width="100%">
	<tr>
		<td><br /></td>
	</tr>
	<tr>
		<td width="29%"></td>
		<td valign="top">
			<form name="selectSpeciality" action="../referrals/referralsPatient.form" method="post" onsubmit="return submitTheForm();">
				<fieldset>
					<legend>Choose Speciality </legend>
						<br />
						<b>Referring Patient to <c:out value="${centralHubHospital.hospitalName}"/></b>
						<br /> Please choose a Speciality or Referral Pathway: <br/> <br/>
						<c:if test="${referralsDefinitionList!=null and fn:length(referralsDefinitionList)>0}">
						<center>
						<c:set var="referralsDefinitionListLength">${referralsDefinitionListLength}</c:set>	<c:out value="${referralsDefinitionListLength}"/>
					<%-- 	<c:set var="index"></c:set>		
						<%  int rowLenth= Integer.parseInt(pageContext.getAttribute("referralsDefinitionListLength").toString());
						    for (int index = 1; index <= rowLenth; index++) {
						    	 pageContext.setAttribute("index",index);
						%> --%>
							<c:forEach var="referralsDefinition" items="${referralsDefinitionList}">
							<%-- 	<c:if test="${referralsDefinition.orderIndex==index}"> --%>
									<div class="menuButtonDiv" style="margin-bottom: 10px;" onclick="location.href='../referrals/referralsPatient.form?isReferral=true&addnew=true&referralDefId=<c:out value="${referralsDefinition.id}"/>'">
										<br/><c:out value="${referralsDefinition.title}"/>
									</div>
								<%-- </c:if> --%>
							</c:forEach>
					<%-- 	<% }%> --%>
						</center>
		
							<table>
								<tr>
									<td>
									</td>
								</tr>
								<tr>
									<td width="8%"><br /></td>
									<td align="center">							</td>
								</tr>
								<tr>
									<td><br /> <br /></td>
								</tr>
							</table>
						</c:if>
									<div style="text-align: right; width: 100%;">
					<a href="javascript:back();">Cancel</a>
					</div>
				</fieldset>
			</form>
		</td>
		<td width="29%"></td>
	</tr>
</table>