<%@ include file="/includes.jsp"%>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<smvc:form name="setMessagingConfigurationForm" modelAttribute="messagingForm"
	id="setMessagingConfigurationForm" method="post" action="../referrals/messaging.form"
	onsubmit="return validate(this);submitTheForm();">
	<input type="hidden" name="redirectParams" value="<c:out value="${requestScope['javax.servlet.forward.query_string']}" />" />
	<div><c:choose>
		<c:when
			test="${requestScope.successMsg ne null || requestScope.errorMsg ne null}">
			<c:if test="${requestScope.successMsg ne null}">
				<div class="message"><img
					src="../images/16x16/information.png" alt="i" />
				<c:out value="${requestScope.successMsg}"/></div>
			</c:if>
			<c:if
				test="${(null ne requestScope.errorMsg) and ('null' ne requestScope.errorMsg) and (fn:length(requestScope.errorMsg) ne 0)}">
				<div class="error"><img src="../images/16x16/error.png"
					alt="e" /><c:out value="${requestScope.errorMsg}"/></div>
				<br />
			</c:if>
		</c:when>
	</c:choose></div>
         <br />
		<br />
	<br/>
	<br/>
	<table width="500" border="2" cellpadding="0" cellspacing="0" align="center">
		<tbody>
			<tr>
				<td>
				<table class="reportSummary" width="100%" border="0"
					cellpadding="4" cellspacing="0">
					<tbody>
						<tr>
							<td class="dialogTitle"><b>User Messaging Preferences</b></td>
						</tr>
						<tr>
							<td>
							<table width="100%" border="0" cellpadding="10" cellspacing="0">

								<tbody>
									<tr>
										<td>
										<table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tbody>
											<tr>
												<td colspan="4">
												<img src="../images/16x16/information.png"/>&nbsp;Select the events for which you would like notification<br/>
												<hr/>							
												</td>
											</tr>
											<tr>
												<td align="left" colspan="4" style="color : #0000FF;"><b><c:out value="${saveSuccessMessage}"/></b></td>
											</tr>
											<tr>								
												<td align="right" colspan="4">
													Select: <a href="javascript:select('all')">All</a> | <a href="javascript:select('none')">None</a> | <a href="javascript:select('invert')">Invert</a>
												</td>
											</tr>
											<tr>
												<td align="left"><b>Type of Event</b></td>
												<td align="left"><b>Send Email</b></td>
												<td align="left"><b>Inbox</b></td>
												<td align="left">&nbsp;</td>
											</tr>
											<c:forEach var="amw" items="${activeMessagingWays}">
												<tr>
												<td align="left"><c:out value="${amw.messagingDescription}"/></td>
												<td align="center">
													<smvc:checkbox path="selectedEmailNotifications" value="${amw.messagingId}" cssClass="allNonInvert"/>&nbsp;<br/>
												</td>
												<td align="left">	
													<smvc:checkbox path="selectedInboxNotifications" value="${amw.messagingId}" cssClass="allNonInvert"/>&nbsp;<br/>
												</td>
												<td align="left">&nbsp;</td>
												</tr>
											</c:forEach>
											</tbody>
										</table>
										<br />
										<br />
										<table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tbody>
												<tr>
													<td align="right"><input type="RESET" name="reset"
														value="Reset" id="reset" onclick="resetPage();"> <input
														type="SUBMIT" name="save" value="Save" id="save">
													</td>
												</tr>
											</tbody>
										</table>
										</td>
									</tr>
								</tbody>
							</table>
							</td>
						</tr>
					</tbody>
				</table>
				</td>
			</tr>
			
		</tbody>
	</table>
</smvc:form>
