    function localFocus() {
      var elem = document.getElementById("SS_CFocusTag");
      if (elem != null) elem.focus();
    }

    /**
     * Clears all elements of the given types in the named form
     *  name - name of the form we are manipulating
     *  types - comma-separated list of types of form fields to clear
     *  Note:  A more thorough implementation would test the type of the input field
     *         and do clearing appropriate for that type, but this suffices for our
     *         purposes.
     */
    function clearForm(name, types) {
      var form = document.forms[name];
      for (i = 0; i < form.elements.length; i++) {
         elem = form.elements[i];
         if (types.indexOf(elem.type) >= 0 && 
             (elem.name.indexOf("rft.") == 0 || elem.name == 'SS_doi' || elem.name == 'pmid')) {
           elem.value = '';
         }
      }
    }

    /**
     * Selects Journal, Book, and other.
     *  selectAllCheckbox - Handle to the select all Checkbox itself.
     */
    function setAllCheckboxes(selectAllCheckbox) {
      var form = selectAllCheckbox.form;
      for (var formElementIndex = 0; formElementIndex < form.elements.length; ++formElementIndex) {
        var formElement = form.elements[formElementIndex];
        if (formElement.value != this.selectAllCheckboxValue) {
          formElement.checked = selectAllCheckbox.checked;
        }
      }
    }
    
    /**
     * Updates Select All based on state of Journal, Book, and other.
     *  updateSelectAll - Handle to the select all Checkbox itself.
     */
     function updateSelectAll(selectedCheckBox) {
      var form = selectedCheckBox.form;
      var allChecked = true;
      for (var formElementIndex = 0; formElementIndex < form.elements.length; formElementIndex++) {
        var formElement = form.elements[formElementIndex];
        if (formElement.name != 'SS_searchTypeAll' && 
              (formElement.name.indexOf('SS_searchType') != -1) && 
              formElement.checked == '') {
                allChecked = false;
        }
      }
      
      selectedCheckBox.form.elements['SS_searchTypeAll'].checked = allChecked;
    }

