﻿Fleurop._EventManager = function ( ) {
    this.AddHandler = function ( e, h ) {
        var oldEH = null;
        var newEH = null;
        
        if ( e != null &&
             typeof ( e ) == "function" ) {
            oldEH = function ( ) {
                e.apply ( this, arguments );
            };
        };
        
        if ( oldEH != null ) {
            newEH = function ( ) {
                oldEH.apply ( this, arguments );
                h.apply ( this, arguments );
            };
        }
        else {
            newEH = function ( ) {
                h.apply ( this, arguments );
            };
        };
        
        return newEH;
    };
};

Fleurop.EventManager = new Fleurop._EventManager ( );