How to extend or "hook" Drupal Form AJAX? I'm working with standard admin form, which has 'add_more' button for one of fields.

My task is to move some fields to jQuery UI Dialog just for usability. When dialog was closed I manually append it's content to form so It sends normally.
The problem appears when some core ajax is sending while some form parts are in the dialog (i.e. outside of form tag because jQuery UI Dialog appears in the bottom of body). The 'add_more' button as example. When I click on it, the form serializes for AJAX without some inputs in the dialog.
Оh..
The jQuery Form Plugin (which used by Drupal) has option beforeSerialize. I think it can help me but I don't know  how I can extend Drupal.ajax.options to set something custom.  

If you can recommend other ways to solve my problem or give some links to documentation about Drupal JavaScript, I will be very happy :)  

Thanks.
Thank you, @yvan, for answer. Links you added are good.
But there are better documentation in source code comments. If you want to understand how it works you should look through files includes/ajax.inc and misc/ajax.js.
My problem was solved like this:


(function($) {
Drupal.behaviors.MyModule = {
    attach: function (context, settings) {

        // Overwrite beforeSubmit
        Drupal.ajax['some_element'].options.beforeSubmit = function (form_values, element, options) {
            // ... Some staff added to form_values
            // return false; // to prevent AJAX call if needed.
        }
        //Or you can overwrite beforeSubmit
        Drupal.ajax['some_element'].options.beforeSerialize = function (element, options) {

            // ... Some staff added to options.data
            // Also call parent function
            Drupal.ajax.prototype.beforeSerialize(element, options);
        }

                    //...


These functions are calling in jQuery Form Plugin.