"  var tidx = document.myForm.formAgent.selectedIndex\n"+ "  var encAgent = document.myForm.formAgent.options[tidx].value\n"+
"  var encAgent = document.myForm.formAgent.value\n"+
    private void displayAdvancedSearchForm()    {      if (DEBUG) {        System.out.println("\nDisplay Advanced Search Form");      }      out.print(          "<html>\n"+          "<script language=\"JavaScript\">\n"+          "<!--\n"+          "function mySubmit() {\n"+          "  var tidx = document.myForm.formAgent.selectedIndex\n"+          "  var encAgent = document.myForm.formAgent.options[tidx].value\n"+          "  document.myForm.action=\"/$\"+encAgent+\"");      out.print(support.getPath());      out.print(          "\"\n"+          "  return true\n"+          "}\n"+          "\n"+          "function setPred() {\n"+          "  var i = document.myForm.formPred.selectedIndex\n"+          "  var s\n"+          "  switch(i) {\n"+          "    default: alert(\"unknown (\"+i+\")\"); break\n");      PropertyTree templatePreds = getTemplatePreds();      int nTemplatePreds = templatePreds.size();      for (int i = 0; i < nTemplatePreds; i++) {        out.print("case ");        out.print(i);        out.print(": s=\"");        out.print(templatePreds.getValue(i));        out.print("\"; break\n");      }      out.print(          "  }\n"+          "  document.myForm.pred.value=s\n"+          "}\n"+          "// -->\n"+          "</script>\n"+          "<head>\n"+          "<title>");      out.print(support.getEncodedAgentName());      out.print(          " Advanced Search Form"+          "</title>\n"+          "</head>\n"+          "<body bgcolor=\"#F0F0F0\" "+          " onload=\"setPred()\">\n"+          "<font size=+1><b>Advanced Search</b></font><p>"+          // should add link here for usage!!!          "<noscript>\n"+          "<b>This page needs Javascript!</b><br>\n"+          "Consult your browser's help pages..\n"+          "<p><p><p>\n"+          "</noscript>\n"+          "<form name=\"myForm\" method=\"get\" "+          "target=\"predResults\" onSubmit=\"return mySubmit()\">\n"+          "Search cluster <input type=\"text\" name=\"formAgent\" value=\"");      out.print(support.getEncodedAgentName());      out.print("\"><br>\n");      if (nTemplatePreds > 0) {        out.print(            "<b>Find all </b>"+            "<select name=\"formPred\" "+            "onchange=\"setPred()\">\n");        for (int i = 0; i < nTemplatePreds; i++) {          out.print("<option>");          out.print(templatePreds.getKey(i));          out.print("</option>\n");        }        out.print(            "</select><br>\n");      }      out.print(          "<input type=\"checkbox\" name=\""+          LIMIT+          "\" value=\"true\" checked>"+          "limit to "+          DEFAULT_LIMIT+          " matches<br>\n"+          "<input type=\"submit\" name=\"formSubmit\" value=\"Search\"><br>\n"+          "<p><hr>\n"+          "<input type=\"checkbox\" name=\""+          PREDICATE_DEBUG+          "\" value=\"true\">View parsed predicate<br>\n"+          "<textarea name=\""+          PREDICATE+          "\" rows=15 cols=70>\n"+          "</textarea><br>\n"+        "<input type=\"hidden\" name=\""+        MODE+        "\" value=\""+        MODE_ADVANCED_SEARCH_RESULTS+        "\">\n"+        "<br><hr>\n"+        "</form>\n"+        "<i><b>Documentation</b> is available in the \"contract\" "+        "guide and javadocs, as "+        "/src/org/cougaar/lib/contract/lang/index.html"+        "</i>"+        "</body>"+        "</html>\n");      out.flush();    }