  <!--
  function checkKey(e) {
    var charCode = (navigator.appName == "Netscape") ? e.which : e.keyCode;
    status = charCode;
    if (status == 13) {
      doSubmit();
    }
  }
  function doSubmit() {
    for (var i=0; i<document.CUNewsSearch.field.length; i++) {
      if (document.CUNewsSearch.field[i].checked == "1") {
        var text = document.CUNewsSearch.qt.value;
        var terms = new Array();
        var token = " ";

        /*
        // strip off some common words
        var stopwords = new Array(10);
        stopwords[0] = "of";
        stopwords[1] = "school";
        stopwords[2] = "the";
        stopwords[3] = "a";
        stopwords[4] = "an";
        stopwords[5] = "center";
        stopwords[6] = "institute";
        stopwords[7] = "office";
        stopwords[8] = "program";
        stopwords[9] = "college";

        for (var i=0; i<stopwords.length; i++) {
          text = text.replace(/\bstopwords[i]\b/ig, "");
        }
        */
        terms = splitPreserve(text, token, "\"");
        if (document.CUNewsSearch.field[i].value == "any") {
          document.CUNewsSearch.qt.value = terms[0];
          // use AND instead of OR (default op)
          for (var j=1; j<terms.length; j++) {
            document.CUNewsSearch.qt.value += " " + terms[j];
          }
          for (var j=0; j<terms.length; j++) {
            document.CUNewsSearch.qt.value += " cunews_subject:" + terms[j];
            document.CUNewsSearch.qt.value += " cunews_deptorschool:" + terms[j];
            document.CUNewsSearch.qt.value += " cunews_topic:" + terms[j];
            document.CUNewsSearch.qt.value += " cunews_subtopic:" + terms[j];
          }
        }
        if (document.CUNewsSearch.field[i].value == "subject") {
          document.CUNewsSearch.qt.value = "";
          for (var j=0; j<terms.length; j++) {
            document.CUNewsSearch.qt.value += " +cunews_subject:" + terms[j];
          }
        }
        else if (document.CUNewsSearch.field[i].value == "dept") {
          document.CUNewsSearch.qt.value = "";
          for (var j=0; j<terms.length; j++) {
            document.CUNewsSearch.qt.value += " +cunews_deptorschool:" + terms[j];
          }
        }
        if (document.CUNewsSearch.field[i].value == "topic") {
          document.CUNewsSearch.qt.value = "";
          for (var j=0; j<terms.length; j++) {
            document.CUNewsSearch.qt.value += " cunews_topic:" + terms[j];
            document.CUNewsSearch.qt.value += " cunews_subtopic:" + terms[j];
          }
        }
      }
    }
    document.CUNewsSearch.submit();
    setTimeout("document.CUNewsSearch.reset()", 100)
  }

  function splitPreserve(string, token, preserve) {
    // split string as delimited by token, but preserve anything inbetween preserve (together with the preserve char), as if they are within one token
    var result = new Array();
    var arrayOfStrings = replaceEmbedded(string, token, preserve, unescape("%FF")).split(token);
    for (var i=0; i<arrayOfStrings.length; i++) {
      result[i] = replace(arrayOfStrings[i], unescape("%FF"), token);
    }
    return result;
  }

  function replaceEmbedded(string,token,preserve,by) {
  // Replaces any token between matching preserve with by in string, and keep the preserve
      var i = string.indexOf(preserve);
      //if ((!i) || (i == -1)) return string;
      // we should be able to handle preserve at beginning
      if ((i == -1)) return string;
      var j = string.indexOf(preserve,i+1);
      if ((!j) || (j == -1)) return string;
      var newstr = string.substring(0,i) + preserve +
  replace(string.substring(i+1,j),token,by) + preserve;
      if (j < string.length)
          newstr +=
  replaceEmbedded(string.substring(j+1,string.length),token,preserve,by);
       return newstr;
  }

  function replace(string,text,by) {
  // Replaces text with by in string
      var i = string.indexOf(text);
      if ((!i) || (i == -1)) return string;
      var newstr = string.substring(0,i) + by;
      if (i+text.length < string.length)
          newstr +=
  replace(string.substring(i+text.length,string.length),text,by);
      return newstr;
  }
  //-->
