
function confirm_admin_delete( arg_object_id, arg_object_type, arg_admin_action)
{
	var param_hash = new Hash ();
	param_hash.set ( 'method', 'admin_delete' );
	param_hash.set ( 'id', arg_object_id);
	param_hash.set ( 'type', arg_object_type);
	param_hash.set ( 'admin_action', arg_admin_action);
	
	new Ajax.Request('/ajax.php', 
		{
			method: "post",
			evalJSON: true, 
			sanitizeJSON: true, 
			parameters: $H(param_hash),
			onSuccess: submit_confirm_admin_delete,
			onFailure: errback_global 
		});
}

function submit_confirm_admin_delete ( oReq, json )
{
	ajax_require_logged_in ( oReq.responseJSON.status );
	
	if ( oReq.responseJSON.status == 'success' )
		$('delete_summary').innerHTML = '<span>Sucessful ' + oReq.responseJSON.data['admin_action'] + ' of object ' + oReq.responseJSON.data['id'] + ' of type ' + oReq.responseJSON.data['type'];
	else
		$('delete_summary').innerHTML = '<span>Failed to ' + oReq.responseJSON.data['admin_action']  + ' object ' + oReq.responseJSON.data['id'] + ' of type ' + oReq.responseJSON.data['type'];
}

function toggle_account_type ( arg_user_id, arg_account_type)
{
	var param_hash = new Hash ();
	param_hash.set ( 'method', 'toggle_user_account_type' );
	param_hash.set ( 'user_id', arg_user_id );
	param_hash.set ( 'user_type_id', arg_account_type);
	
	new Ajax.Request('/ajax.php', 
		{
			method: "post",
			evalJSON: true, 
			sanitizeJSON: true, 
			parameters: $H(param_hash),
			onSuccess: submit_toggle_account_type_callback,
			onFailure: errback_global 
		});
}

function submit_toggle_account_type_callback ( oReq, json )
{
	ajax_require_logged_in ( oReq.responseJSON.status );
	
	if ( oReq.responseJSON.status == 'success' )
	{
		// window.location = "http://thefightersunion.com/profile/" + oReq.responseJSON.data['handle'];
		 window.location = absolute_link_path + "profile/" + oReq.responseJSON.data['handle'];
		 
		 
	}
	else
	{
		//callback_show_general_errors ( 'fighter_is_mma_error_general', oReq );
	}
}

function confirm_account_email(arg_user_id)
{
	var param_hash = new Hash ();
	param_hash.set ( 'method', 'confirm_account_email' );
	param_hash.set ( 'user_id', arg_user_id );
	
	new Ajax.Request('/ajax.php', 
		{
			method: "post",
			evalJSON: true, 
			sanitizeJSON: true, 
			parameters: $H(param_hash),
			onSuccess: confirm_account_email_callback,
			onFailure: errback_global 
		});
}

function confirm_account_email_callback ( oReq, json )
{
}