/* Copyright 2005 Camptocamp SA. 
   Licensed under the GPL (www.gnu.org/copyleft/gpl.html) */

/* The logic contained in this file defines:
 *  - Onload event attachement to trigger AJAX JS logic execution
 *  - Common plugin behaviour for:
 *     - onBeforeAjaxCall: logic called before an AJAX request is sent
 *     - onAfterAjaxCall: logic called after an AJAX response is received
 *       and after plugin have refreshed their UI
 *     - onCartoclientError: logic called in production profile
 *                           when Cartoclient returns an faillure
 *
 * Uses: prototype.js
 * Uses: AjaxHelper.js - for common features (i.e. getHttpPostRequest)
 *
 * Used by: AjaxHandler.js
 */

/*
 * Plugin initialisation
 */
AjaxHelper.addEvent(window, 'load', function() {

    // Initialises plugins on window load    
    if (typeof(AjaxHandler) != 'undefined') {
        AjaxPlugins.Common.init();
    }
});

AjaxPlugins = {};

AjaxPlugins.Common = {

    init: function() {
        CartoWeb.disableAjax();
        AjaxHandler.setProfile(AjaxHandler.PROFILE_DEVELOPMENT);
        AjaxPlugins.MouseOver.init();
    }    
}
