public static void writeControlPanelScript(org.powerloom.PrintableStringWriter stream) {
    {
      stream.println("<SCRIPT LANGUAGE='JavaScript'>");
      stream.println("<!-- Hide from non-javascript browsers");
      stream.println();
      stream.println("// Copyright 2000 University of Southern California");
      stream.println("// All rights reserved.");
      stream.println();
      stream.println("function putRight(newLoc) {parent.frames[2].document.location.href = newLoc;};");
      stream.println();
      stream.println("function putLeft(newLoc) {parent.frames[1].document.location.href = newLoc;};");
      stream.println("// var URLpath = self.document.location.href.substring(0, self.document.location.href.lastIndexOf('/') + 1);");
      stream.println();
      stream.println("function myescape (str) {");
      stream.println("  // Needed because the built-in escape doesn't escape the '+' character.");
      stream.println("  var i = str.indexOf('+');");
      stream.println("  var newstr = '';");
      stream.println("  if (i == -1) {return str;}");
      stream.println("  else {");
      stream.println("    newstr += str.substring(0,str.indexOf('+')) + '%2B';");
      stream.println("    if (i+1 < str.length)");
      stream.println("      {newstr +=  myescape(str.substring(i+1,str.length))};");
      stream.println("    return newstr;");
      stream.println("  };");
      stream.println("}");
      stream.println();
      stream.println("function lispify (str, caseflag) {");
      stream.println("  if (caseflag) {var sym = myescape(escape(str.toUpperCase()));} ");
      stream.println("  else {var sym = myescape(escape(str));};");
      stream.println("  return sym;");
      stream.println("};");
      stream.println();
      stream.println("function loadTopContextURL() {");
      stream.println("  var form = window.document.navform;");
      stream.println("  var sel = form.elements[0].options[form.elements[0].selectedIndex].text;");
      stream.println("  var URLpath = window.document.location.href.substring(0, window.document.location.href.lastIndexOf('/') + 1");
      stream.println("					       );");
      stream.println("  return URLpath + \"do-action?show+context+\" + sel + \"+NIL\";");
      stream.println("}");
      stream.println();
      stream.println("function loadURL(windowName, url, form) {");
      stream.println("  var sel = form.elements[0].options[form.elements[0].selectedIndex].text;");
      stream.println("  var typ = form.objecttype.options[form.objecttype.selectedIndex].value;");
      stream.println("  var URLpath = self.document.location.href.substring(0, self.document.location.href.lastIndexOf('/') + 1);");
      stream.println();
      stream.println();
      stream.println("  if (url == \"show\") {");
      stream.println("    if (form.matchtype.options[form.matchtype.selectedIndex].value==\"caseInsensitive\") {url = \"findinsensitive\"}");
      stream.println("    else if (form.matchtype.options[form.matchtype.selectedIndex].value==\"substring\") {url = \"findsubstring\"};");
      stream.println("  } else if (url == \"edit\") {");
      stream.println("    if (form.matchtype.options[form.matchtype.selectedIndex].value==\"caseInsensitive\") {url = \"editinsensitive\"}");
      stream.println("    else if (form.matchtype.options[form.matchtype.selectedIndex].value==\"substring\") {url = \"editsubstring\"};");
      stream.println("  };");
      stream.println();
      stream.println("  if (form.find.value == \"?\") {");
      stream.println("     // window.open (URLpath + \"help/regexp.html\", \"toc\")");
      stream.println("        parent.frames[\"toc\"].document.location.href = URLpath + \"help/regexp.html\"");
      stream.println("  }");
      stream.println("  else if (url == \"new\") {");
      stream.println("    if (typ == \"instance\") {");
      stream.println("     parent.frames[windowName].document.location.href = URLpath + \"do-action?new+instance+\" + sel + \"+NIL\"}");
      stream.println();
      stream.println("       else {");
      stream.println("     parent.frames[windowName].document.location.href = URLpath + \"do-action?new+\" + typ + \"+\" + sel + \"+NIL\"");
      stream.println("}");
      stream.println("  }");
      stream.println("  else if (form.find.value.length > 0) {");
      stream.println("        url = \"do-action?\" + url +\"+\" + typ + \"+\";");
      stream.println("     parent.frames[windowName].document.location.href = URLpath + url + sel + \"+\" + lispify(form.find.value, false)");
      stream.println("  } else {");
      stream.println("   alert(\"No input provided. You need to enter name to look up.\");");
      stream.println("  };");
      stream.println("};");
      stream.println();
      stream.println("function loadContextURL(windowName, action, form) {");
      stream.println("  var sel = form.elements[0].options[form.elements[0].selectedIndex].text;");
      stream.println("  var URLpath = self.document.location.href.substring(0, self.document.location.href.lastIndexOf('/') + 1);");
      stream.println("  parent.frames[windowName].document.location.href = URLpath + \"do-action?\" + action + \"+context+\" + sel + \"+NIL\";");
      stream.println("};");
      stream.println();
      stream.println("function loadNewContextURL(windowName, lispPackage, form) {");
      stream.println("  var sel = form.elements[0].options[form.elements[0].selectedIndex].text;");
      stream.println("  var URLpath = self.document.location.href.substring(0, self.document.location.href.lastIndexOf('/') + 1);");
      stream.println("  parent.frames[windowName].document.location.href = URLpath + \"do-action?new+context+BUILT-IN-THEORY+\" + lispPackage;");
      stream.println("};");
      stream.println();
      stream.println("function loadVanillaURL(windowName, action, form) {");
      stream.println("  var URLpath = self.document.location.href.substring(0, self.document.location.href.lastIndexOf('/') + 1);");
      stream.println("  window.open(URLpath + action, windowName).focus();");
      stream.println("};");
      stream.println();
      stream.println("function loadFrameVanillaURL(windowName, action, form) {");
      stream.println("  var URLpath = self.document.location.href.substring(0, self.document.location.href.lastIndexOf('/') + 1);");
      stream.println("  // window.open(URLpath + action, windowName).focus();");
      stream.println("  parent.frames[windowName].document.location.href = URLpath + action;");
      stream.println("};");
      stream.println();
      stream.println("function formTest(form) {");
      stream.println("  loadURL('content', 'show', form);");
      stream.println("  return false;");
      stream.println("};");
      stream.println();
      stream.println("function setConInfo(con, theory) {");
      stream.println("  var Form = self.document.navform;");
      stream.println("  var Selection = Form.context;");
      stream.println("  var tempResult = \"\";");
      stream.println("  for (var i = 0; i < Selection.options.length; i++) {");
      stream.println("    if (Selection.options[i].text == theory) {");
      stream.println("      Selection.options[i].selected = true;");
      stream.println("    } else {");
      stream.println("      Selection.options[i].selected = false;");
      stream.println("    };");
      stream.println("  };");
      stream.println("  Form.find.value = con;");
      stream.println("};");
      stream.println();
      stream.println("// End hiding from old browsers -->");
      stream.println("</SCRIPT>");
    }
;
  }