<script type="text/JavaScript">
<!-- 
versions = new Array();
components = new Array();
closedversions = new Array();
versions['All'] = new Array(new Array('','All'));
components['All'] = new Array(new Array('','All'));
closedversions['All'] = new Array(new Array('','All'));
{project_js}

{literal}
function updateMenus(f) {
  sel = f.projects[f.projects.selectedIndex].text;
  f.versions.length = versions[sel].length;
  for (var x = 0; x < versions[sel].length; x++) {
    f.versions.options[x].value = versions[sel][x][0];
    f.versions.options[x].text = versions[sel][x][1];
  }
  f.components.length = components[sel].length;
  for (var x = 0; x < components[sel].length; x++) {
    f.components.options[x].value = components[sel][x][0];
    f.components.options[x].text = components[sel][x][1];
  }
}
{/literal}
//-->
</script>
    <form method="get" action="query.php" name="query">
      <table>
				<tr valign="baseline">
					<td valign="top"><b>{$STRING.QUERY.Project}:</b></td>
					<td valign="top">
						<select name="projects" onChange="updateMenus(this.form)">
							<option value=''>{$STRING.QUERY.opt_All}</option>
							{build_select box=project}
						</select>
					</td>
				</tr>
				<tr valign="baseline">
					<td valign="top"><b>{$STRING.QUERY.Version}:</b></td>
					<td valign="top">
						<select name="versions"><option value=''>{$STRING.QUERY.opt_All}</option></select>
					</td>
				</tr>
				<tr valign="baseline">
					<td valign="top"><b>{$STRING.QUERY.Component}:</b></td>
					<td valign="top">
						<select name="components"><option value=''>{$STRING.QUERY.opt_All}</option></select>
					</td>
				</tr>
				<tr valign="baseline">
					<td valign="top"><b>{$STRING.QUERY.Status}:</b></td>
					<td valign="top">
						<select name="status[]" multiple size="7">{build_select box=status}</select>
					</td>
				</tr>
				<tr valign="baseline">
					<td valign="top"><b>{$STRING.QUERY.SortBy}:</b></td>
					<td valign="top">
						<select name="order">
        			<option value="bug_id">
          			{$STRING.QUERY.SortBy_BugNumber}
        			</option>
        			<option selected value="severity.sort_order">
          			{$STRING.QUERY.SortBy_Severity}
        			</option>
        			<option value="reporter">
          			{$STRING.QUERY.SortBy_Reporter}
        			</option>
        			<option value="status.sort_order">
          			{$STRING.QUERY.SortBy_Status}
        			</option>
        			<option value="priority">
          			{$STRING.QUERY.SortBy_Priority}
        			</option>
      			</select>
						<select name="sort">
							<option selected value="asc">{$STRING.QUERY.SortAsc}</option>
							<option value="desc">{$STRING.QUERY.SortDesc}</option>
						</select>
					</td>
				</tr>
			</table>
			<br>
			<br>
			{if $smarty.session.uid}
				{$STRING.QUERY.SaveThisQueryAs}: <input maxlength="40" type="text" name="savedqueryname">
				<br><br>
			{/if}
      <input type="hidden" name="op" value="doquery">
			<input type="reset" value="{$STRING.QUERY.ResetBackToDefaultQuery}">
			<input type="submit" value="{$STRING.QUERY.SubmitQuery}"> 
			{if count($queries)}
				<br><br>
				<b>{$STRING.QUERY.SavedQueries}</b>
				<br>
				{section name=query loop=$queries}
					<a href="{$smarty.server.PHP_SELF}?{$queries[query].saved_query_string}">{$queries[query].saved_query_name}</a> (<a href="{$smarty.server.PHP_SELF}?op=delquery&queryid={$queries[query].saved_query_id}&form=simple" onClick="return confirm('{$STRING.QUERY.SureDeleteSavedQuery}');">{$STRING.delete}</a>)<br>
				{/section}
			{/if}
    </form>
		<br>
		{$STRING.QUERY.GoToThe} <a href="{$smarty.server.PHP_SELF}?op=query&form=advanced">{$STRING.QUERY.AdvancedQueryPage}</a>
