<%--
  Copyright 2003 Sun Microsystems, Inc. All rights reserved 
  Use is subject to license terms.
 --%>
<%-- @(#)dbMenu.jsp --%>

<% 
String[] selected = request.getParameterValues("database");

String databases = "default|discussion"; /* database list separated by "|" */
StringTokenizer st = new StringTokenizer(databases, "|");
if (st.countTokens() > 0) {
%>
    <tr> 
	<td valign=middle align=right height=40>
	    <FONT color=<%=tFontColor%> face=<%=tFontFace%>>From&nbsp;</FONT>
	</td> 
	<td valign=middle align=left height=40>
	    <table border=0 cellspacing="0" cellpadding="0">
<% 
	    while (st.hasMoreTokens()) {
		String token = (String)st.nextToken();

		String checked = "";
		if (selected == null) {
		    if (token.equals("default")) {
			checked = "CHECKED";
		    }
		} else {
		    for (int i = 0; i < selected.length; i++) {
			if (selected[i].equals(token)) {
			    checked = "CHECKED";
			    break;
			}
		    }
		}
%>
		<tr>
		    <td valign=middle align=left>
			<INPUT TYPE="checkbox" ID="database" NAME="database" value="<%=token%>" <%=checked%>><FONT color=<%=tFontColor%> face=<%=tFontFace%> size="-1"><%=token%></FONT>
		    </td>
		</tr>
<% 
	    }
%>
	    </table>
	</td> 
    </tr>
<% 
}
%>

