<%@ include file="/includes.jsp"%>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
			<script>
					
			 <![CDATA[
			function funcValidate(){
		    var templateName = document.getElementById("Template");
		    var tName=templateName.value;
		    var queryName=tName.split(",");
               	if(queryName.value == "" || templateName.value == ""){
			    if(queryName.value == ""){
			    alert("Please select a Query Name:");
			    }
			    else{
			    alert("Please choose a letter template");
			    }
			}else{
			return document.location="createLetter.form?queryName="+queryName[1]+"&templateName="+queryName[0];
			}
			}
			
			
			]]>
			</script>	
<div class="breadcrumb">
You are here: <a href="../emdt/emdtHome.form"><img src="../emdt/images/16x16/icon.png" style="vertical-align: top;"/> eMDT</a> &gt; <a href="../emdt/reportMenu.jsp">Reports</a> &gt; <a class="selected">Letters</a>
</div>

		<br/>		
		<smvc:form modelAttribute="templateQueryList">
		    <input type="hidden" name="redirectParams" value="<c:out value="${requestScope['javax.servlet.forward.query_string']}" />" />
		    <table border="0" class="dialogBox">
			<tr>
				<th class="dialogTitle">Letters</th>
			</tr>
			<tr>
				<td>

				<table cellpadding="10" valign="bottom" align="center">
					<tr>
						<td>
							<br />
						</td>
					</tr>
					<tr>
						<td align="left">Choose a Letter Template: <smvc:select path="templateName" cssClass="smallFont" id="Template">
							<smvc:option value="">-- Select letter template --</smvc:option>
							<c:forEach var="qfm" items="${templateQueryList.queryAssociationList}" varStatus="s">
								<smvc:option value="${qfm.template_name},${qfm.query_id}"><c:out value="${qfm.template_name}"/></smvc:option>
							</c:forEach>
						</smvc:select> <input type="button" value="Generate Letter" onclick="funcValidate();" /></td>
					</tr>
				</table>
				</td>
			</tr>
			<tr>
				<td align="right"><input type="button" value="Letter admin..." onclick="document.location='createAssociation.form'" /><br/></td>
			</tr>
		</table>
	    </smvc:form>
	    
	    
    
    
    