Imagine I have this code:
var myFunc1 = function(event) {
alert(1);
}
var myFunc2 = function(event) {
alert(2);
}
element.addEventListener(\'click\'
I second the outis solution, sounds like you need to decorate or adapt the existing DOM event dispatching model with your own event dispatcher.
Did some searching and found this link, which may or may not suit your needs, based on an actionscript dispatcher implementation, dated 2007.
http://positionabsolute.net/blog/2007/06/event-dispatcher.php
Of course I'm not really a javascripter, so give me a heads up if this is not relevant.