//
// search.js
//
// Contains code to display the search forms and field descriptions on the vascular plant search page (search.php).
// search.php includes this code via a <javascript> element.
// When search.php is loaded in a user's browser, a call to showForm() is triggered by the onload event handler within the <body> tag.
// When the user clicks the Search button in the search form, the browser will request results.php from the web server.


// Total number of tabs that will be displayed across the top of the search form.
var numTabs = 3;


// Used to build tabs at top of search page by creating an HTML table.  Controls which tab is active (ie: the tab the user is currently viewing).
// Arguments:
//   activeTab = number of the tab that will be high.  The left most tab is #1, and tabs are numbered from left to right.
//
function tabTable(activeTab)
{
  var tabTable = "<table width=\"100%\" height=\"22px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
  tabTable += addTab("showForm('basic')", "BASIC SEARCH", activeTab, 1);
  tabTable += addTab("showForm('advanced')", "ADVANCED SEARCH", activeTab, 2);
  tabTable += addTab("showDesc()", "FIELD DESCRIPTIONS", activeTab, 3);
  tabTable += "</tr></table>";

  return tabTable;
}


// Builds the HTML to display a single tab within the tab table.
// Each tab is built from a couple <td> tags with background images used to create the tab border and background, and text used to create the tab label.
// Arguments:
//   handler = javascript function (plus arguments to that function) that will be called when this tab is clicked by the user.
//   label = text that will appear on the tab.
//   activeTab = number of the tab that will be active (ie: the tab the user is currently viewing).
//   tabNum = the number of this tab, numbered from left to right (1 to numTabs).
//
function addTab(handler, label, activeTab, tabNum)
{
  var tabHTML = "<td width=\"10px\"><img src=\"../images/";
  if (activeTab == tabNum) tabHTML += "tab_on_left2";
  else tabHTML += "tab_off_left2";
  tabHTML += ".gif\" width=\"10\" height=\"22\" border=\"0\"></td>";

  tabHTML += "<td nowrap";
  if (activeTab == tabNum) tabHTML += " class=\"tabon\"><span class=\"tabselected\">";
  else tabHTML += " class=\"taboff\"><span class=\"tablink\" onclick=\"" + handler + ";\" onmouseover=\"this.className='tabhover';\" onmouseout=\"this.className='tablink';\">";
  tabHTML += label + "</span></td>";

  tabHTML += "<td width=\"10px\"><img src=\"../images/";
  if (activeTab == tabNum) tabHTML += "tab_on_right2";
  else tabHTML += "tab_off_right2";
  tabHTML += ".gif\" width=\"10\" height=\"22\" border=\"0\"></td>";

  if (tabNum < numTabs) tabHTML += "<td width=\"4px\"><img id=\"tab1spacer\" src=\"../images/spacer.gif\" width=\"4\" height=\"22\" border=\"0\"></td>";
  else tabHTML += "<td width=\"100%\"><img id=\"tabfiller\" src=\"../images/spacer.gif\" width=\"1\" height=\"22\" border=\"0\"></td>";

  return tabHTML;
}

// Function that builds the HTML for both the basic and advanced search forms.
// Called from an onload event handler in the <body> tag of the search.php page.
// Calls the tabTable() function to build the tabs at the top of the search form.
// Function finishes by calling document.getElementById("searchdiv").innerHTML to embedd the search form into the search <div> placeholder on search.php.
// Arguments:
//   type = "basic" or "advanced", to determine which serach form to display.
//
function showForm(type)
{
  var newTable = "<form name=\"searchform\" id=\"searchform\" action=\"results.php\" method=\"get\"><input type=\"hidden\" name=\"SourcePage\" value=\"SearchForm\">";
  newTable += "<table class=\"main\" width=\"720px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
  newTable += "<tr><td id=\"tabs\" class=\"tabs\">";
  if (type == "basic") newTable += tabTable(1);
  else newTable += tabTable(2);

  newTable += "</td></tr><tr><td class=\"search\" align=\"left\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";

  newTable += "<tr><td align=\"left\" colspan=\"2\"> <input type=\"hidden\" name=\"SourcePage\" value=\"SearchForm\"></td></tr>";

  newTable += "<tr><td align=\"center\" colspan=\"2\"><input type=\"image\" src=\"../images/search_button.gif\" width=\"50\" height=\"23\" alt=\"Search\">&nbsp;&nbsp;<img src=\"../images/clear_button2.gif\" width=\"50\" height=\"23\" alt=\"Reset\" onclick=\"document.searchform.reset();\" onmouseover=\"this.style.cursor = 'hand';\"></td></tr>";

  newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"10\" vspace=\"0\" hspace=\"0\"></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\">Family&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"Fam\" size=\"20\" maxlength=\"40\"></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\">Genus&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"Gen\" size=\"15\" maxlength=\"30\"><span class=\"textupper\"> species </span><input type=\"text\" name=\"Sp\" size=\"15\" maxlength=\"30\"><span class=\"textupper\"> ssp/var </span><input type=\"text\" name=\"Sub\" size=\"15\" maxlength=\"30\"></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\"></td><td class=\"fieldtextupper\"><Input type=\"checkbox\" name=\"IncSyn\" value=\"Y\"> Expand search to include synonyms of the above name</td></tr>";

  newTable += "<tr><td class=\"fieldlabel\"></td><td class=\"fieldtextupper\"><Input type=\"checkbox\" name=\"IncPastDet\" value=\"Y\"> Expand search to include past determinations</td></tr>";

  newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"3\" vspace=\"0\" hspace=\"0\"></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\">Common Name&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"Com\" size=\"35\" maxlength=\"70\"></td></tr>";

  newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"15\" vspace=\"0\" hspace=\"0\"></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\"><nobr>Collector's Name&nbsp;</nobr></td><td class=\"fieldtextlower\"><input type=\"text\" name=\"Coll\" size=\"20\" maxlength=\"50\"><span class=\"textupper\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Collector's Number&nbsp;</span>&nbsp;<input type=\"text\" name=\"Num\" size=\"10\" maxlength=\"30\"></td></tr>";

  if (type == "advanced")
  {
    newTable += "<tr><td class=\"fieldlabel\"><nobr>Assoc. Collectors&nbsp;</nobr></td><td class=\"fieldtextlower\"><input type=\"text\" name=\"AssocColl\" size=\"40\" maxlength=\"80\"></td></tr>";

   newTable += "<tr><td class=\"fieldlabel\"><nobr>Collection Day&nbsp;</nobr></td><td class=\"fieldtextlower\"><input type=\"text\" name=\"D\" size=\"5\" maxlength=\"15\"><span class=\"textupper\">&nbsp;&nbsp;Month&nbsp;</span><select name=\"M\"><option selected><option value=\"Jan\">Jan<option value=\"Feb\">Feb<option value=\"Mar\">Mar<option value=\"Apr\">Apr<option value=\"May\">May<option value=\"Jun\">Jun<option value=\"Jul\">Jul<option value=\"Aug\">Aug<option value=\"Sep\">Sep<option value=\"Oct\">Oct<option value=\"Nov\">Nov<option value=\"Dec\">Dec</select><span class=\"textupper\">&nbsp;&nbsp;Year&nbsp;</span><input type=\"text\" name=\"Y\" size=\"7\" maxlength=\"15\"><span class=\"textupper\"> (4-digit year)</span></td></tr>";
  }
  else newTable += "<tr><td class=\"fieldlabel\">Collection Year&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"Y\" size=\"10\" maxlength=\"20\"></td></tr>";

  newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"8\" vspace=\"0\" hspace=\"0\"></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\">Country&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"Country\" size=\"20\" maxlength=\"40\"><span class=\"textupper\"> (full spelling, except USA)</span></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\">State&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"State\" size=\"20\" maxlength=\"40\"><span class=\"textupper\"> (full spelling)</span></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\">County&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"County\" size=\"20\" maxlength=\"40\"></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\">Locality&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"Loc\" size=\"40\" maxlength=\"80\"></td></tr>";

  if (type == "advanced")
  {
    newTable += "<tr><td class=\"fieldlabel\"><nobr>Site Description&nbsp;</nobr></td><td class=\"fieldtextlower\"><input type=\"text\" name=\"SiteDesc\" size=\"40\" maxlength=\"80\"></td></tr>";

    newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"10\" vspace=\"0\" hspace=\"0\"></td></tr>";

    newTable += "<tr><td class=\"fieldlabel\">Latitude&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"Lat\" size=\"15\" maxlength=\"15\"><span class=\"textupper\"> (decimal degrees)</span></td></tr>";

    newTable += "<tr><td class=\"fieldlabel\">Longitude&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"Lon\" size=\"15\" maxlength=\"15\"><span class=\"textupper\"> (decimal degrees)</span></td></tr>";

    newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"10\" vspace=\"0\" hspace=\"0\"></td></tr>";

    newTable += "<tr><td class=\"fieldlabel\">Township&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"T\" size=\"5\" maxlength=\"15\"><span class=\"textupper\"> Range&nbsp;</span><input type=\"text\" name=\"R\" size=\"5\" maxlength=\"15\"><span class=\"textupper\"> Section&nbsp;</span><input type=\"text\" name=\"S\" size=\"5\" maxlength=\"15\"><span class=\"textupper\"> Quarter&nbsp;</span><input type=\"text\" name=\"Q\" size=\"10\" maxlength=\"20\"><span class=\"textupper\"> (leave off T, R, S, Q)</span></td></tr>";

    newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"10\" vspace=\"0\" hspace=\"0\"></td></tr>";

    newTable += "<tr><td class=\"fieldlabel\">UTM Zone&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"UTMZ\" size=\"5\" maxlength=\"15\"><span class=\"textupper\"> UTM Easting&nbsp;</span><input type=\"text\" name=\"UTME\" size=\"12\" maxlength=\"30\"><span class=\"textupper\"> UTM Northing&nbsp;</span><input type=\"text\" name=\"UTMN\" size=\"12\" maxlength=\"30\"><span class=\"textupper\"> (leave off E, N)</span></td></tr>";

    newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"10\" vspace=\"0\" hspace=\"0\"></td></tr>";

    newTable += "<tr><td class=\"fieldlabel\">Elevation&nbsp;</td><td class=\"fieldtextlower\"><input type=\"text\" name=\"FT\" size=\"8\" maxlength=\"20\"><span class=\"textupper\"> (in feet, no commas)</span></td></tr>";
  }

  newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"8\" vspace=\"0\" hspace=\"0\"></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\">Origin&nbsp;</td><td class=\"fieldtextlower\"><select name=\"Ori\"><option selected><option value=\"Native\">Native<option value=\"Introduced\">Introduced</select></td></tr>";

  if (type == "advanced")
  {
    newTable += "<tr><td class=\"fieldlabel\">Culture&nbsp;</td><td class=\"fieldtextlower\"><select name=\"Cult\"><option selected><option value=\"Wild: native/naturalized\">Wild (native or naturalized)<option value=\"Cultivated\">Cultivated<option value=\"Persisting from cultivation\">Persisting from cultivation<option value=\"Cultivated and naturalizing\">Cultivated and naturalizing</select></td></tr>";

    newTable += "<tr><td class=\"fieldlabel\">Phenology&nbsp;</td><td class=\"fieldtextlower\"><select name=\"Phe\"><option selected><option value=\"Flowering\">Flowering<option value=\"Fruiting\">Fruiting<option value=\"Flowering & Fruiting\">Flowering & Fruiting<option value=\"Fertile\">Fertile<option value=\"Sterile\">Sterile<option value=\"Remnants\">Remnants<option value=\"Buds\">Buds</select></td></tr>";
  }

  newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"8\" vspace=\"0\" hspace=\"0\"></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\"><nobr>Accession Number&nbsp;</nobr></td><td class=\"fieldtextlower\"><input type=\"text\" name=\"Acc\" size=\"10\" maxlength=\"30\"></td></tr>";

  newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"15\" vspace=\"0\" hspace=\"0\"></td></tr>";


  newTable += "<tr><td class=\"fieldlabel\">Sort First By&nbsp;</td><td class=\"fieldtextlower\"><select name=\"Sort1\"><option value=\"unsorted\">(Unsorted)<option value=\"AccessionNumber\">Accession #<option value=\"Family\">Family<option selected value=\"ScientificName1\">Scientific Name<option value=\"Collector\">Collector's Name<option value=\"FullCollectorNumber\">Collector's #<option value=\"Year\">Collection Year<option value=\"Country\">Country<option value=\"State\">State<option value=\"County\">County<option value=\"Origin\">Origin<option value=\"Phenology\">Phenology</select><select name=\"SortOrder1\"><option  value=\"ASC\" selected>ascending<option value=\"DESC\">descending</select>&nbsp;&nbsp;&nbsp;<span class=\"textupper\">Second By</span> <select name=\"Sort2\"><option value=\"unsorted\">(Unsorted)<option value=\"AccessionNumber\">Accession #<option value=\"Family\">Family<option value=\"ScientificName1\">Scientific Name<option value=\"Collector\">Collector's Name<option value=\"FullCollectorNumber\">Collector's #<option value=\"Year\" selected>Collection Year<option value=\"Country\">Country<option value=\"State\">State<option value=\"County\">County<option value=\"Origin\">Origin<option value=\"Phenology\">Phenology</select><select name=\"SortOrder2\"><option value=\"ASC\">ascending<option value=\"DESC\" selected>descending</select></td></tr>";

  newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"15\" vspace=\"0\" hspace=\"0\"></td></tr>";

  newTable += "<tr><td class=\"fieldlabel\"><nobr>Return&nbsp;</nobr></td><td class=\"fieldtextlower\"><select name=\"Limit\"><option>5<option>10<option>25<option>50<option selected>100<option>500<option>1000</select><span class=\"textupper\"> records per page.</span></td></tr>";

  if (type == "advanced") newTable += "<tr><td align=\"left\" colspan=\"2\"><img src=\"../images/spacer.gif\" border=\"0\" width=\"1\" height=\"10\" vspace=\"0\" hspace=\"0\"></td></tr><tr><td align=\"center\" colspan=\"2\"><input type=\"image\" src=\"../images/search_button.gif\" width=\"50\" height=\"23\" alt=\"Search\">&nbsp;&nbsp;<img src=\"../images/clear_button2.gif\" width=\"50\" height=\"23\" alt=\"Reset\" onclick=\"document.searchform.reset();\" onmouseover=\"this.style.cursor = 'hand';\"></td></tr>";

  newTable += "</table> </td></tr></table> </form>";

  document.getElementById("searchdiv").innerHTML = newTable;
}

// Builds the HTML code to display the field descriptions.
// Calls the tabTable() function to build the tabs at the top of the search form.
// Function finishes by calling document.getElementById("searchdiv").innerHTML to embedd the html into the search <div> placeholder on search.php.
// Arguments: none.
//
function showDesc()
{
  var newTable = "<form name=\"searchform\" id=\"searchform\" action=\"FMPro\" method=\"post\">";
  newTable += "<table class=\"main\" width=\"720px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
  newTable += "<tr><td id=\"tabs\" class=\"tabs\">";
  newTable += tabTable(3);

  newTable += "</td></tr><tr><td class=\"search\" align=\"left\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"left\">";

  newTable += "<br><b>Field Descriptions for Vascular Plant Database:</b><br><br><ul>";

  newTable += "<li><b>WTU Accession Number: </b>A unique number assigned to every specimen housed at WTU for herbarium record-keeping purposes. Some accession numbers include \"JWT\" after the number; these indicate speicmens originating from the herbarium of J. William Thompson that were integrated into WTU's collections but not accessioned with WTU numbers. Accession numbers followed by an \"A\", \"B\", or other single letter represent specimens with multiple collections mounted on them, all using the same accession number.<br><br>";

  newTable += "<li><b>Label Title: </b>Most labels have a title or other caption that can provide useful information.  Typical titles might say \"Flora of _____\", \"Herbarium of _____\", or indicate the project/reason for which the specimen was collected.<br><br>";

  newTable += "<li><b>Family: </b>Level of taxanomic classification above the genus.  The WTU Herbarium generally follows the Englerian sequence.<br>";

  newTable += "<li><b>Scientific Name (latin name): </b>Includes Genus, species epithat, and subtaxon.  Does not include authors.<br>";

  newTable += "<li><b>Accepted Name (taxon name): </b>Scientific names on the specimen are automatically matched up to the currently accepted name. Synonymy generally follows Kartesz.<br>";

  newTable += "<li><b>Common Name: </b>For Pacific Northwest collections, usage follows the common names given in Hitchcock & Cronquist's Flora of the Pacific Northwest (1973), stored in a lookup table.  Our database currently does not include common names for species not found in H&C or for cultivated species.<br><br>";

  newTable += "<li><b>Determination Number: </b>Multiple determinations may be made on one specimen. The original, or first, determination (usually on the label) is designated #1; later determinations (usually on separate annotation notes) are then numbered sequentially based on determination date.  Only the most recent determination is provided in the search results, while a link to previous determinations is provided on the Record View tab.<br>";

  newTable += "<li><b>Determiner: </b>The person who identified the specimen.<br>";

  newTable += "<li><b>Determination Date: </b>The date the specimen was identified.<br>";

  newTable += "<li><b>Fide: </b>The flora or literature source used to identify the specimen.  Common abbreviations we use are: \"H&C\" for Hitchcock & Cronquist's Flora of the Pacific Northwest (1973), \"Jepson\" for the Jepson Manual of California, and \"FNA\" for the published volumes of Flora of North America.<br>";

  newTable += "<li><b>Determination Notes: </b>Any observations or notes on specimen characteristics given by the determiner are provided in this field.<br><br>";

  newTable += "<li><b>Collector: </b>The name of the person who collected the specimen. If more than one name is listed on a specimen label then the first name is designated as the collector. If no collector name is given on the label, we enter \"unknown\" into this field.<br>";

  newTable += "<li><b>Associated Collectors: </b>If more than one name is listed on a specimen label then the first name is designated as the collector and the remaining names are listed as associated collectors.<br>";

  newTable += "<li><b>Collector's Number: </b>A unique number assigned to the specimen by the collector.  Different collectors use different numbering schemes; these may include the addition of prefixes or suffixes (such as their initials or the year) to the number. In the database, any prefixes and suffixes are included in the Collector's Number field exactly as they appear on the specimen label. When no collector number is given, we type \"s.n.\" in this field.<br>";

  newTable += "<li><b>Collection Date: </b>The date on which the specimen was collected, split up between day, month, and year in the database. Months are always given as three-letter abbreviations.  Years are alway 4-digits long. Occasionally a range of dates may be present on the label; in such cases, the first date in the range is used as the collection date, and the entire collection date is typed into the Notes field as it appears on the label (verbatim collection date). If no date is given, then the date fields are left blank and a note is made in the Notes field.<br><br>";

  newTable += "<li><b>Location: </b> Includes the country, state/province, and county/municipality where the specimen was collected, along with a detailed description of the location, as given on the specimen label.  May also include national park, national forest, and other land use designations. Older collections often have short and imprecise locality data. Detailed locality data for rare species (threatened, endangered, sensitive, watch, ...) is included in our database but omitted from the search results.<br>";

  newTable += "<li><b>Site Description: </b>This field includes all label information characterizing the site, such vegetation zone/association, substrate, slope, moisture, associated species, and so on - as the information appears on the specimen label.<br>";

  newTable += "<li><b>Elevation: </b>Given in both feet and meters.<br>";

  newTable += "<li><b>Latitude/Longitude: </b>Split up between degrees, minutes, and seconds.  Commonly given on newer specimens.  Omitted from rare species.<br>";

  newTable += "<li><b>Township/Range: </b>This system divides a region into a series of squares (identified by township and range) that are further divided into 36 numbered sections, with further precision given in quarters of a section.  The most commonly seen coordinate system on WTU's specimens.  Omitted from rare species.<br>";

  newTable += "<li><b>UTM: </b>These coordinates divide the earth into a series of south-north zones, within which coordinates are given in meters (designated as Easting and Northing coordinates).  Very few WTU specimens have UTM coordinates.  Omitted from rare species.<br><br>";

  newTable += "<li><b>Specimen Details: </b>Includes any characteristics pertaining to the plant specimen itself, such as flower color, fruit length, and plant height, along with information about the species on the site, such as abundance and the precise location and micro-habitat where collected.<br>";

  newTable += "<li><b>Origin: </b>Specifies whether the specimen is native or introduced to the state or country where it was collected.  Origin data is rarely found on the specimen label; instead, it is entered during data entry either from a lookup table or from the date entry personnel's own knowledge.  Origin data should be considered supplemental information, and should not be relied on as authoritative.<br>";

  newTable += "<li><b>Culture: </b>Specifies whether the specimen was growing wild or cultivated, or some variation thereof, such as \"persisting from cultivation\".  Nearly all WTU's specimens are wild, and are marked as such in the database unless information on the label indicates otherwise.<br>";

  newTable += "<li><b>Phenology: </b>Specifies the sexual maturity/condition of the specimen, such as flowering, fruiting, cone-bearing, spore-bearing, fertile, or sterile.  Phenology is generally not given on the label; instead the person entering the record examines the specimen and enters the appropriate value.  In some groups such as grasses and sedges, it is difficult to casually distinguish flowers from fruits, in which case the specimen is at least noted to be fertile.<br><br>";

  newTable += "</ul></td></tr>";

  newTable += "</table> </td></tr></table> </form>";

  document.getElementById("searchdiv").innerHTML = newTable;
}
