<?xml version="1.0"?>
<page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">  
  <title>Member Login</title>
  <content>
    <table>
		<form method="post" action="js-search">
			<tr>
				<td colspan="4" align="left"><p class="blue-word-14">Search information</p></td>
			</tr>
			<tr>
				<td colspan="4"><hr/></td>
			</tr>
			<tr>
				<td align="left"><input type="text" size="40" name="txttext" value="${txttext}" class="textbox-gray"/></td>
				<td align="left"><p class="gray-word-12">
				<select name="cbxcaterogy">
					<option value="all">- All -</option>
					<jx:forEach var="item" items="${categorylist}" >
						<jx:choose>
						<jx:when test="${cbxcaterogy.equals(item.getId().toString())}">
							<option value="${item.getId()}" selected="">${item.getDesc()}</option>
						</jx:when>
						<jx:otherwise>
							<option value="${item.getId()}">${item.getDesc()}</option>
						</jx:otherwise>
						</jx:choose>											
					</jx:forEach>
					<jx:choose>
						<jx:when test="${cbxcaterogy.equals('events')}">
							<option value="events" selected="true">events</option>
						</jx:when>
						<jx:otherwise>
							<option value="events">events</option>
						</jx:otherwise>
					</jx:choose>
										
  				</select>
  				</p>
  				</td>
  				<td align="left"><p class="gray-word-12">  				
				<select name="cbxperiod">
						<option value="all">- All -</option>
					<jx:forEach var="item" items="${periodoftimelist}" >						
	                    <jx:choose>
						<jx:when test="${cbxperiod.equals(item.getDaysbefore().toString())}">
							<option value="${item.getDaysbefore()}" selected="true">${item.getDesc()}</option>
						</jx:when>
						<jx:otherwise>
							<option value="${item.getDaysbefore()}">${item.getDesc()}</option>
						</jx:otherwise>
						</jx:choose>
                    </jx:forEach>
                </select>
  				</p>
  				</td>
  				<td><input type="submit" name="search" value="search"/></td>
			</tr>
			<jx:choose>
				<jx:when test="${message}!='null'">
					<tr>
						<td align="left" colspan="2"><p class="red-word-bold">${message}</p></td>
					</tr>
				</jx:when>
				<jx:otherwise>
					<tr>
						<td colspan="4" height="20" align="left"><p class="red-word-bold">Results ${results} for ${txttext} (${seconds} seconds)</p></td>
					</tr>
				</jx:otherwise>
			</jx:choose>
			<tr>
				<td colspan="4"><hr/></td>
			</tr>
				<jx:forEach var="item" items="${searchlist}">
					<tr>
						<td colspan="4" height="20" align="left">
						<a class="orange-word-14">${item.getDesc_category()}</a> - <a class="blue-word-14">${item.getTitle()}</a></td>
					</tr>
					<tr>
						<td colspan="4" height="40" align="left">
						<a class="gray-word-12">${item.getText()}...</a><br/><a class="red-word-bold" href="${item.getLink()}"><img src="img/readmore.gif" border="0" width="16" height="16" align="absmiddle"></img>Read more...</a></td>
					</tr>
					<tr>
					<td colspan="4"><hr/></td>
					</tr>
				</jx:forEach>
		</form>
	</table>
  </content>
</page>
