function save_comment( module, id )
{

  // Start by disabling the button
  document.getElementById("comment_button").value = "Posting Comment";
  document.getElementById("comment_button").disabled = true;

  // Set the backend filename to process
  if( module == "Videos" )
  {
    var filename = 'modules/Videos/ajax_save_comment.php';
    var pk_ID = document.getElementById('VideoID').value;
  }
  else if( module == "Photos" )
  {
    var filename = 'modules/Photos/ajax_save_comment.php';
    var pk_ID = document.getElementById('PhotoID').value;
  }

  // Get the input fields
  var comment_box = document.getElementById('comment_box').value;
  var comment_name = document.getElementById('comment_name').value;

  // Format any ampersands with URL friendly characters
  comment_box = comment_box.replace( /&/g,'%26' );
  comment_name = comment_name.replace( /&/g,'%26' );

  // Get the recaptcha fields
  var response = document.getElementById('recaptcha_response_field').value;
  var challenge = document.getElementById('recaptcha_challenge_field').value;

  // Create the parameter list
  var params = "pk_ID=" + pk_ID + "&response=" + response + "&challenge=" + challenge + "&comment_box=" + comment_box + "&comment_name=" + comment_name;

  // Process the AJAX POST request
  AJAX_POST( filename, params );

  // Update the form when the AJAX process finishes
  xmlhttp.onreadystatechange = function()
  {
    if( (xmlhttp.readyState == 4) && (xmlhttp.status == 200) )
    {

      // Process the request when it comes in
      if( xmlhttp.responseText == "FALSE" )
      {
        document.getElementById("output_cell").innerHTML = "<span style='color: #990000; font-weight: bold;'>Your answer was incorrect</span>";
        document.getElementById("comment_button").value = "Add Comment";
        document.getElementById("comment_button").disabled = false;
        Recaptcha.reload();
      }
      else
      {
        // The CAPTCHA successfully verified and the comment was saved.
        // Display the comments back to the user and hide the extraneous data
        document.getElementById("comments_cell").innerHTML = xmlhttp.responseText;

        // Disable the form so that the user can not post another comment right away
        document.getElementById('comment_box').value = "";
        document.getElementById('comment_name').value = "";
        document.getElementById('output_cell').innerHTML = "&nbsp;";
        document.getElementById('comment_button').value = "Comment Posted!";
      }

    }
  }

}

