<%@ include file="/includes.jsp"%>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<script language="javascript">
	
	function processButtonClick(patientId,actionname){
		var formObj = document.getElementById('nrlAltDecision');
		if (actionname == 'DELAYDECISION'){
			var delayDate = document.getElementById("delayDate");
			if(delayDate && !isDate( delayDate.value, 'Delay') ){
				delayDate.focus();
				return false;
			}
		}
		document.getElementById('nrlPatientId').value=patientId;
	    document.getElementById('dispatchMethod').value = actionname;
		formObj.submit();
	}
	function enableSubmitButton(){
		
		var yourNotes = document.getElementById("yourNotes");
		var AddNotesButton = document.getElementById("AddNotesButton");
		if(yourNotes){
			if(AddNotesButton){			
				if(yourNotes.value.length > 0){
					AddNotesButton.disabled =  false;
				}else{
					AddNotesButton.disabled =  true;
				}
			}
		}
		
	}
</script>
<smvc:form id="nrlAltDecision" method="post"
	 modelAttribute="patientInfo" onsubmit = "return submitTheForm();">
	 <input type="hidden" name="redirectParams" value="<c:out value="${requestScope['javax.servlet.forward.query_string']}" />" />
	<smvc:hidden path="patientId" id="nrlPatientId" />
	<smvc:hidden path="actionMethod" id="dispatchMethod" />
	<br />
	<smvc:errors path="yourNotes" cssClass="error"></smvc:errors>
	<table>
		<tr>
			<td class="error"><c:out value="${model.errorMsg}"></c:out></td>
		</tr>
	</table>
	<table cellspacing="0" width="850" border="0" class="table">
		<tr>
			<td width="100%">
			<table border="0" width="100%" cellspacing="0" class="table">

				<tr>
					<td class="nrlTableTitleBar">Alternative Decision</td>
				</tr>
				<tr>
					<td colspan="2">
					<table width="100%" border="0" class="nrltableWhiteBorder">
						<tr>
							<td colspan="1" class="nrlBrown" width="20%"></td>
							<td class="nrlBrown" colspan="2" width="14%"><input
								class="nrlBtnWide" type="button"
								onclick="processButtonClick('<c:out value="${patientInfo.patientId}"/>','NOMDT');"
								value=" No MDT Required " /></td>
							<td colspan="1" class="nrlBrown" width="6%"></td>
							<td class="nrlBrown" width="13%"><input class="nrlBtnWide"
								type="button"
								onclick="processButtonClick('<c:out value="${patientInfo.patientId}"/>','NHSMDT');"
								value="NHS MDT" /></td>
							<td colspan="1" class="nrlBrown" width="6%"></td>
							<td class="nrlBrown" width="14%"><input class="nrlBtnWide"
								type="button"
								onclick="processButtonClick('<c:out value="${patientInfo.patientId}"/>','DELAYDECISION');"
								value=" Delay Decision " /></td>
							<td class="nrlBrown" width="20%">&#160;</td>
						</tr>
						<tr>
							<td colspan="9" class="nrlBrown">
							<hr color="gray" size="1" />
							<!-- <jsp:include page="../common/nrlPatientInfo.jsp"></jsp:include>	
                    			--> <%@ include
								file="../common/nrlPatientInfo.jsp"%></td>
						</tr>
					</table>
					</td>
				</tr>

				<tr>
				<td>
							<%@ include file="/nrl/common/nrlFromInfoLayout.jsp" %>
				</td>
			</tr>
				<tr>
					<td class="nrlBrownBlackText" colspan="2">
					<table>
						<tr>
							<td width="15%">&#160;</td>
							<td width="85%">Next Step</td>
						</tr>

					</table>
					</td>
				</tr>
				<tr>

					<td width="100%" colspan="2"><br />
					<table>
						<tr>
							<td width="10%"></td>
							<td width="80%">Date&#160;&#160;<spring:bind path="delayDate">
									<input id="delayDate" name="delayDate" type="text" value="<c:out value="${patientInfo.delayDate}"/>" placeholder="dd/mm/yyyy"/>
								</spring:bind> <img title='Click to choose date'
								style='cursor: pointer' src='../images/16x16/date.png'
								id='delayDate_DateTrigger' /> <a
								href="javascript:addNRLEvent('delayDate', 'Delay Date')"
								title="Add event to calendar"> <img width="12"
								src="../calendar/images/16x16/addEvent.png" /> </a></td>
							<td width="10%"></td>
						</tr>
						<tr>
							<td width="10%"></td>
							<td width="80%" colspan="2"><%@ include file="allNotes.jsp"%>
							</td>
							<td width="10%"></td>
						</tr>
					</table>
					</td>

				</tr>

			</table>
			</td>
		</tr>
	</table>
	<script src="../webapp.js" type="text/javascript"></script>	
	<script type="text/javascript">
		function dateChanged(calendar) { }
	</script>
</smvc:form>



