<%@ include file="/includes.jsp"%>
<script language="javascript">
function topic(field){
if(field){
var open ="open";
document.location="patientDiscussionLink.do?topic="+open;
}
else{
var all ="all";
document.location="patientDiscussionLink.do?topic="+all;
}
}
function radioselected(){
var contid = "<%=request.getAttribute("radio")%>";
if(contid == "all"){
document.patientForumDiscussionForm.topics_filter[1].checked="true";
}else{
document.patientForumDiscussionForm.topics_filter[0].checked="true";
}

}
</script>

<body onload="javascript:radioselected();">
<s:form action="/meetings/patientDiscussion" styleId="patientDiscussion">
	<table border="0" width="95%" height="200">
		<tr>
			<td valign="top">
			<fieldset>
			<table class="menu" border="0" width="100%" height="70">
				<tr>
					<td class="menuItem" colspan="2"><span style="font-weight: bold; font-size: 12pt;">Q and A Forum</span></td>
				</tr>
				<tr>
					<td>Show: Open Topics<input type="radio" name="topics_filter" value="open" onclick="topic(true);" /> All Topics<input type="radio" name="topics_filter" value="all" onclick="topic(false);" />
					</td>
					<td align="middle"><a href="patientDiscussion.do?submitName=newThread"><u>Start New Topic...</u></a></td>
				</tr>
			</table>
			</fieldset>
			</td>
		</tr>
		<tr>
			<td>
			<table width="95%" border="1" cellpadding="0" cellspacing="0" class="table" align="center">
				<tr>
					<td class="tableTitleBar" colspan="5">Discussions found&nbsp;(<c:out value="${listsize}"/> matches)</td>
				</tr>
				<c:if test="${getDiscussionList ne null}">
					<tr class="tableHeader">
						<th class="tableColHeader">No.</th>
						<th class="tableColHeader">Discussion Topic</th>
						<th class="tableColHeader">Posted By</th>
						<th class="tableColHeader">Posted To</th>
						<th class="tableColHeader">Status</th>

					</tr>

					<c:forEach var="getDiscussionList" items="${getDiscussionList}" varStatus="i">
						<c:if test="${i.count%2==0}">
							<tr class="oddRow">
						</c:if>
						<c:if test="${i.count%2!=0}">
							<tr class="evenRow">
						</c:if>

						<td class="tableCell"><a href='patientDiscussion.do?submitName=openThread&threadid=<c:out value="${getDiscussionList.threadId}"/>'><c:out value="${i.count}" /></a></td>
						<td class="tableCell"><a href='patientDiscussion.do?submitName=openThread&threadid=<c:out value="${getDiscussionList.threadId}"/>'><c:out value="${getDiscussionList.discussionTopic}" /></a></td>
						<td class="tableCell"><c:out value="${getDiscussionList.postedBy}" /></td>
						<td class="tableCell"><c:out value="${getDiscussionList.postedTo}" /></td>
						<td class="tableCell"><c:out value="${getDiscussionList.status}" /></td>


					</c:forEach>
				</c:if>
				<c:if test="${getDiscussionList eq null}">
					<h4><font color="red">&nbsp;&nbsp;No Data Present</font></h4>
				</c:if>
			</table>
			</td>
		</tr>
	</table>
</s:form>
</body>
