function UpdateCourse()
{
  // Start by getting the new CourseID
  fk_CourseID = document.getElementById('fk_CourseID').value;

  // Update the course elements
  UpdateImage( fk_CourseID );
  UpdateCaddies( fk_CourseID );
  UpdateJobs( fk_CourseID );

} // end function UpdateCourse()


function UpdateImage( fk_CourseID )
{
  // Set the backend filename to process
  var filename = 'modules/Activity/ajax_update_image.php';

  // Create the parameter list
  var params = "fk_CourseID=" + fk_CourseID;

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

  // Update the form when the AJAX process finishes
  xmlhttp.onreadystatechange = function()
  {
    if( (xmlhttp.readyState == 4) && (xmlhttp.status == 200) )
    {
      // Finally, increment the thread count
      document.getElementById('CourseImage').innerHTML = xmlhttp.responseText;
    }
  }

} // end function UpdateImage


function UpdateCaddies( fk_CourseID )
{
  // Set the backend filename to process
  var filename = 'modules/Activity/ajax_update_caddies.php';

  // Create the parameter list
  var params = "fk_CourseID=" + fk_CourseID;

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

  // Update the form when the AJAX process finishes
  xmlhttp.onreadystatechange = function()
  {
    if( (xmlhttp.readyState == 4) && (xmlhttp.status == 200) )
    {
      // Finally, increment the thread count
      document.getElementById('CourseCaddies').innerHTML = xmlhttp.responseText;
    }
  }

} // end function UpdateImage


function UpdateJobs( fk_CourseID )
{
  // Set the backend filename to process
  var filename = 'modules/Activity/ajax_update_jobs.php';

  // Create the parameter list
  var params = "fk_CourseID=" + fk_CourseID;

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

  // Update the form when the AJAX process finishes
  xmlhttp.onreadystatechange = function()
  {
    if( (xmlhttp.readyState == 4) && (xmlhttp.status == 200) )
    {
      // Finally, increment the thread count
      document.getElementById('CourseJobs').innerHTML = xmlhttp.responseText;
    }
  }

} // end function UpdateImage

