function admin_save_artist()
{
  // Set the backend filename to process
  var filename = 'modules/Admin/artists/ajax_save_artist.php';

  // Get the form fields
  var pk_ID = document.getElementById('pk_ID').value;
  var vc_FirstName = document.getElementById('vc_FirstName').value;
  var vc_LastName = document.getElementById('vc_LastName').value;
  var fk_CountryID = document.getElementById('fk_CountryID').value;
  var txt_Biography = document.getElementById('txt_Biography').value;
  var vc_Tags = document.getElementById('vc_Tags').value;

  if( document.getElementById('bool_Active_yes').checked )
    var bool_Active = 1;
  else
    var bool_Active = 0;

  // Format any ampersands with URL friendly characters
  vc_FirstName = vc_FirstName.replace( /&/g, '%26' );
  vc_LastName = vc_LastName.replace( /&/g, '%26' );
  txt_Biography = txt_Biography.replace( /&/g, '%26' );
  vc_Tags = vc_Tags.replace( /&/g, '%26' );

  // Create the parameter list
  var params = "pk_ID=" + pk_ID + "&vc_FirstName=" + vc_FirstName + "&vc_LastName=" + vc_LastName + "&fk_CountryID=" + fk_CountryID + "&txt_Biography=" + txt_Biography + "&bool_Active=" + bool_Active + "&vc_Tags=" + vc_Tags;

  // Inform the user that the item is being submitted
  document.getElementById('Submit').value = 'Saving Artist';

  // 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) )
    {
      // Update the artist list
      document.getElementById('module_lbody').innerHTML = xmlhttp.responseText;

      // Toggle the submit button
      toggle_submit( 'Submit', 'Artist Saved', 'Submit' );

    }
  }

}

function admin_delete_artist()
{
  // Get the artist ID
  var pk_ID = document.getElementById('pk_ID').value;

  // Send the confirmation 
  var remove = confirm( "Are you sure you want to delete this artist?\n\nALL inventory associated with the artist will also be removed!\n\nThis cannot be undone!" );

  if( remove == true )
    window.location = "index.php?module=Admin&page=artists&subpage=delete&ArtistID=" + pk_ID;

}
