public static String yieldPresetQueriesScript(Cons queries) {
    if (queries == Stella.NIL) {
      return ("");
    }
    { int nqueries = queries.length();
      OutputStringStream script = OutputStringStream.newOutputStringStream();

      script.nativeStream.print("<SCRIPT LANGUAGE='JavaScript'>\n	      \nfunction makeArray (size) {\n  this.length = size;\n  return this;\n}\n\nvar queryModuleList = new makeArray(");
      script.nativeStream.print(nqueries + ");\nvar querySourceList = new makeArray(");
      {
        script.nativeStream.println(nqueries + ");");
        script.nativeStream.println();
      }
;
      { Cons entry = null;
        Cons iter000 = queries;
        int j = Stella.NULL_INTEGER;
        int iter001 = 1;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest, iter001 = iter001 + 1) {
          entry = ((Cons)(iter000.value));
          j = iter001;
          script.nativeStream.println("queryModuleList[" + j + "] = '" + ((StringWrapper)(entry.rest.value)).wrapperValue + "';");
          script.nativeStream.println("querySourceList[" + j + "] = '" + Stella.replaceSubstrings(Stella.replaceSubstrings(Stella.replaceSubstrings(Stella.replaceSubstrings(((StringWrapper)(entry.rest.rest.value)).wrapperValue, "\\\\", "\\"), "\\\"", Native.makeString(1, '"')), "\\n", Native.makeString(1, '\n')), "\\n", Native.makeString(1, '\r')) + "';");
        }
      }
      {
        script.nativeStream.println();
        script.nativeStream.println("function setSourceAndModule (index) {\n  if (index > 0) {\n    document.QUERY.QUERYSOURCE.value = querySourceList[index];\n    for (var i = 0; i < document.QUERY.MODULE.length; i++) {\n       if (document.QUERY.MODULE[i].value==queryModuleList[index]) {\n           document.QUERY.MODULE.selectedIndex = i; }\n    }\n  } else {\n  document.QUERY.QUERYSOURCE.value = '';\n  }\n}\n</SCRIPT>");
        script.nativeStream.println();
      }
;
      return (script.theStringReader());
    }
  }