

Type.registerNamespace("CZScripts");

CZScripts.Delegate = function(source, eventName, handler, context) {    
   this.source = source;
   this.eventName = eventName;
   this.delegate = Function.createDelegate(context, handler);
   $addHandler(source, eventName, this.delegate);
}

CZScripts.Delegate.prototype = {

    dispose: function() {   

         $removeHandler(this.source, this.eventName, this.delegate);
        delete this.delegate;
    }   
}

CZScripts.Delegate.registerClass('CZScripts.Delegate', null ,Sys.IDisposable);

