  function check_submit_upload()
  {
    error = false;

    // Clear the error message
    error_msg = "";

    // Disable the submit button
    document.submit_upload.button_upload.disabled = true;

    // Variables in the form
    title = document.submit_upload.title.value;
    category = document.submit_upload.category.value;
    agree = document.submit_upload.agree.checked;
    userfile = document.submit_upload.userfile.value;

    // File extension
    ext = userfile.slice(userfile.indexOf(".")).toLowerCase();

    if(title == "")
    {
      error = true;
      error_msg += "Please enter a title.\n";
    }

    if(category == 0)
    {
      error = true;
      error_msg += "Please select a category.\n";
    }

    if(ext != ".doc")
    {
      error = true;
      error_msg += "Please only upload documents that use the '.doc' file extension.\n";
    }

    if(!agree)
    {
      error = true;
      error_msg += "You must agree to the Terms and Conditions.\n";
    }

    if(!error)
    {
      // Submit the form
      document.submit_upload.submit();
    }
    else
    {
      // Enable the submit button
      document.submit_upload.button_upload.disabled = false;

      // Shwo the error message
      alert(error_msg);
    }
  }

  function check_search(form)
  {
    if(form.elements['query'].value == '')
    {
      alert("Please enter at least one search term.");
      form.elements['query'].focus();
      return false;
    }
    else
    {
      return true;
    }
  }

  function check_submit_upload_confirm()
  {
    error = false;

    // Clear the error message
    error_msg = "";

    // Disable the submit button
    document.submit_upload_confirm.button_confirm_bottom.disabled = true;

    // Variables in the form
    title = document.submit_upload_confirm.title.value;
    category = document.submit_upload_confirm.category.value;
    paper_text = document.submit_upload_confirm.paper_text.value;

    if(title == "")
    {
      error = true;
      error_msg += "Please enter a title.\n";
    }

    if(category == 0)
    {
      error = true;
      error_msg += "Please select a category.\n";
    }

    if(paper_text == "")
    {
      error = true;
      error_msg += "Please enter a paper.\n";
    }

    if(!error)
    {
      if(confirm('Have you removed all of your personal information (if you would not like it published)?', 'Yes', 'No'))
      {
        // Submit the form
        document.submit_upload_confirm.submit();
      }
      else
      {
        // Enable the submit button
        document.submit_upload_confirm.button_confirm_bottom.disabled = false;
      }
    }
    else
    {
      // Enable the submit button
      document.submit_upload_confirm.button_confirm_bottom.disabled = false;

      // Show the error message
      alert(error_msg);
    }
  }

  function check_submit_paste()
  {
    error = false;

    // Clear the error message
    error_msg = "";

    // Disable the submit button
    document.submit_paste.button_paste.disabled = true;

    // Variables in the form
    title = document.submit_paste.title.value;
    category = document.submit_paste.category.value;
    paper_text = document.submit_paste.paper_text.value;
    agree = document.submit_paste.agree.checked;

    if(title == "")
    {
      error = true;
      error_msg += "Please enter a title.\n";
    }

    if(category == 0)
    {
      error = true;
      error_msg += "Please select a category.\n";
    }

    if(paper_text == "")
    {
      error = true;
      error_msg += "Please enter a paper.\n";
    }

    if(!agree)
    {
      error = true;
      error_msg += "You must agree to the Terms and Conditions.\n";
    }

    if(!error)
    {
      if(confirm('Have you removed all of your personal information (if you would not like it published)?', 'Yes', 'No'))
      {
        // Submit the form
        document.submit_paste.submit();
      }
      else
      {
        // Enable the submit button
        document.submit_paste.button_paste.disabled = false;
      }
    }
    else
    {
      // Enable the submit button
      document.submit_paste.button_paste.disabled = false;

      // Show the error message
      alert(error_msg);
    }
  }