function EventManagerDefn() 
{
    /**
     * register an event with manager
     * @param {EVENT_TYPE} typ	event type
     */
    this.registerEvent = function(typ ) {
	var str = typ + '';
	if( this._listeners[str] ) {
	    return false;
	}
	this._listeners[str] = new Array();
	return true;
    }

    /**
     * add a listener for an event type - the event type is registered if
     * not already done.
     *
     * @param {EVENT_TYPE} typ		event type
     * @param {EventListener} listener	event listener whose onEvent method would be called when
     *					event is posted
     */
    this.addListener = function(eventTyp, listener) {
	if( !listener || !listener.onEvent )  return false;
	var str = eventTyp + '';
	this.registerEvent(str);
	var listeners = this._listeners[str];
	if( !listeners ) return false;
	listeners[listeners.length] = listener;
	return true;
    }

    /**
     * post an event - the event is delivered to all listeners who have
     * registered to receive this event via {@link addListener}
     * @param	{EVENT_TYPE} evt	the event type
     * @param		     src	the event src (depends on event type)
     * @param		     data	the event data (depends on event type)
     */
    this.postEvent = function(typ, src, data) {
	var str = typ + '';

	if( typ == this.EVENT_CUSTOM ) {
	    if( src.onEvent ) 
		src.onEvent(str, src, data);
	    return;
	}

	var listeners = this._listeners[str];
	var nListeners = listeners.length;
	for(var i = 0; i < nListeners; i++ )
	    listeners[i].onEvent(str, src, data);
    }

    this.EVENT_MENUITEM_SELECTED  = EVENT_TYPE.prototype.EVENT_MENUITEM_SELECTED;
    this.EVENT_MENU_OPENED        = EVENT_TYPE.prototype.EVENT_MENU_OPENED;
    this.EVENT_MENU_CLOSED        = EVENT_TYPE.prototype.EVENT_MENU_CLOSED;
    this.EVENT_FORM_OPENED        = EVENT_TYPE.prototype.EVENT_FORM_OPENED;
    this.EVENT_FORM_CLOSED        = EVENT_TYPE.prototype.EVENT_FORM_CLOSED;
    this.EVENT_CONTENTAREA_MOUSECLICKED = EVENT_TYPE.prototype.EVENT_CONTENTAREA_MOUSECLICKED;
    this.EVENT_SWARA_SELECTED     = EVENT_TYPE.prototype.EVENT_SWARA_SELECTED;
    this.EVENT_NOTHING_SELECTED     = EVENT_TYPE.prototype.EVENT_NOTHING_SELECTED;
    this.EVENT_NEWSWARASPACER_SELECTED     = EVENT_TYPE.prototype.EVENT_NEWSWARASPACER_SELECTED;
    this.EVENT_LYRIC_SELECTED     = EVENT_TYPE.prototype.EVENT_LYRIC_SELECTED;
    this.EVENT_HEADING_SELECTED     = EVENT_TYPE.prototype.EVENT_HEADING_SELECTED;
    this.EVENT_NOTATION_INSERTMODE = EVENT_TYPE.prototype.EVENT_NOTATION_INSERTMODE;

    this.EVENT_SWARATOOLBAR_LABELCHANGED = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_LABELCHANGED;
    this.EVENT_SWARATOOLBAR_STAYICHANGED = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_STAYICHANGED;
    this.EVENT_SWARATOOLBAR_SPEEDCHANGED = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_SPEEDCHANGED;
    this.EVENT_SWARATOOLBAR_LENGTHCHANGED = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_LENGTHCHANGED;
    this.EVENT_SWARATOOLBAR_DELETESWARA = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_DELETESWARA;
    this.EVENT_SWARATOOLBAR_GAMAKACHANGED = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_GAMAKACHANGED;
    this.EVENT_LYRICTOOLBAR_LABELCHANGED = EVENT_TYPE.prototype.EVENT_LYRICTOOLBAR_LABELCHANGED;
    this.EVENT_FONT_ADDED = EVENT_TYPE.prototype.EVENT_FONT_ADDED;
    this.EVENT_GAMAKA_ADDED = EVENT_TYPE.prototype.EVENT_GAMAKA_ADDED;
    this.EVENT_CUSTOM      = EVENT_TYPE.prototype.EVENT_CUSTOM;

    /**
     * @type Array
     * an associated array of registered listeners for various events
     * @private
     */
    this._listeners = new Array();

    /**
     * (internal) initializer function
     * @private
     */
    this._init = function() {
	this.registerEvent(this.EVENT_MENUITEM_SELECTED);
	this.registerEvent(this.EVENT_MENU_OPENED);
	this.registerEvent(this.EVENT_MENU_CLOSED);
	this.registerEvent(this.EVENT_FORM_OPENED);
	this.registerEvent(this.EVENT_FORM_CLOSED);
	this.registerEvent(this.EVENT_SWARA_SELECTED);
	this.registerEvent(this.EVENT_NOTHING_SELECTED);
	this.registerEvent(this.EVENT_NEWSWARASPACER_SELECTED);
	this.registerEvent(this.EVENT_LYRIC_SELECTED);
	this.registerEvent(this.EVENT_HEADING_SELECTED);
	this.registerEvent(this.EVENT_NOTATION_INSERTMODE);
	this.registerEvent(this.EVENT_CONTENTAREA_MOUSECLICKED);

	this.registerEvent(this.EVENT_SWARATOOLBAR_LABELCHANGED);
	this.registerEvent(this.EVENT_SWARATOOLBAR_STAYICHANGED);
	this.registerEvent(this.EVENT_SWARATOOLBAR_SPEEDCHANGED);
	this.registerEvent(this.EVENT_SWARATOOLBAR_LENGTHCHANGED);
	this.registerEvent(this.EVENT_SWARATOOLBAR_DELETESWARA);
	this.registerEvent(this.EVENT_SWARATOOLBAR_GAMAKACHANGED);
	this.registerEvent(this.EVENT_LYRICTOOLBAR_LABELCHANGED);

	this.registerEvent(this.EVENT_FONT_ADDED);
	this.registerEvent(this.EVENT_GAMAKA_ADDED);
    }

    this._init();
}
/**
 * @class
 * represents the swara notation editor event manager
 */
@class
represents the swara notation editor event manager
@class represents the swara notation editor event manager
function EventManagerDefn() 
{
    this.registerEvent = function(typ ) {
	var str = typ + '';
	if( this._listeners[str] ) {
	    return false;
	}
	this._listeners[str] = new Array();
	return true;
    }
    this.addListener = function(eventTyp, listener) {
	if( !listener || !listener.onEvent )  return false;
	var str = eventTyp + '';
	this.registerEvent(str);
	var listeners = this._listeners[str];
	if( !listeners ) return false;
	listeners[listeners.length] = listener;
	return true;
    }
    this.postEvent = function(typ, src, data) {
	var str = typ + '';
	if( typ == this.EVENT_CUSTOM ) {
	    if( src.onEvent ) 
		src.onEvent(str, src, data);
	    return;
	}
	var listeners = this._listeners[str];
	var nListeners = listeners.length;
	for(var i = 0; i < nListeners; i++ )
	    listeners[i].onEvent(str, src, data);
    }
    this.EVENT_MENUITEM_SELECTED  = EVENT_TYPE.prototype.EVENT_MENUITEM_SELECTED;
    this.EVENT_MENU_OPENED        = EVENT_TYPE.prototype.EVENT_MENU_OPENED;
    this.EVENT_MENU_CLOSED        = EVENT_TYPE.prototype.EVENT_MENU_CLOSED;
    this.EVENT_FORM_OPENED        = EVENT_TYPE.prototype.EVENT_FORM_OPENED;
    this.EVENT_FORM_CLOSED        = EVENT_TYPE.prototype.EVENT_FORM_CLOSED;
    this.EVENT_CONTENTAREA_MOUSECLICKED = EVENT_TYPE.prototype.EVENT_CONTENTAREA_MOUSECLICKED;
    this.EVENT_SWARA_SELECTED     = EVENT_TYPE.prototype.EVENT_SWARA_SELECTED;
    this.EVENT_NOTHING_SELECTED     = EVENT_TYPE.prototype.EVENT_NOTHING_SELECTED;
    this.EVENT_NEWSWARASPACER_SELECTED     = EVENT_TYPE.prototype.EVENT_NEWSWARASPACER_SELECTED;
    this.EVENT_LYRIC_SELECTED     = EVENT_TYPE.prototype.EVENT_LYRIC_SELECTED;
    this.EVENT_HEADING_SELECTED     = EVENT_TYPE.prototype.EVENT_HEADING_SELECTED;
    this.EVENT_NOTATION_INSERTMODE = EVENT_TYPE.prototype.EVENT_NOTATION_INSERTMODE;
    this.EVENT_SWARATOOLBAR_LABELCHANGED = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_LABELCHANGED;
    this.EVENT_SWARATOOLBAR_STAYICHANGED = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_STAYICHANGED;
    this.EVENT_SWARATOOLBAR_SPEEDCHANGED = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_SPEEDCHANGED;
    this.EVENT_SWARATOOLBAR_LENGTHCHANGED = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_LENGTHCHANGED;
    this.EVENT_SWARATOOLBAR_DELETESWARA = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_DELETESWARA;
    this.EVENT_SWARATOOLBAR_GAMAKACHANGED = EVENT_TYPE.prototype.EVENT_SWARATOOLBAR_GAMAKACHANGED;
    this.EVENT_LYRICTOOLBAR_LABELCHANGED = EVENT_TYPE.prototype.EVENT_LYRICTOOLBAR_LABELCHANGED;
    this.EVENT_FONT_ADDED = EVENT_TYPE.prototype.EVENT_FONT_ADDED;
    this.EVENT_GAMAKA_ADDED = EVENT_TYPE.prototype.EVENT_GAMAKA_ADDED;
    this.EVENT_CUSTOM      = EVENT_TYPE.prototype.EVENT_CUSTOM;
    this._listeners = new Array();
    this._init = function() {
	this.registerEvent(this.EVENT_MENUITEM_SELECTED);
	this.registerEvent(this.EVENT_MENU_OPENED);
	this.registerEvent(this.EVENT_MENU_CLOSED);
	this.registerEvent(this.EVENT_FORM_OPENED);
	this.registerEvent(this.EVENT_FORM_CLOSED);
	this.registerEvent(this.EVENT_SWARA_SELECTED);
	this.registerEvent(this.EVENT_NOTHING_SELECTED);
	this.registerEvent(this.EVENT_NEWSWARASPACER_SELECTED);
	this.registerEvent(this.EVENT_LYRIC_SELECTED);
	this.registerEvent(this.EVENT_HEADING_SELECTED);
	this.registerEvent(this.EVENT_NOTATION_INSERTMODE);
	this.registerEvent(this.EVENT_CONTENTAREA_MOUSECLICKED);
	this.registerEvent(this.EVENT_SWARATOOLBAR_LABELCHANGED);
	this.registerEvent(this.EVENT_SWARATOOLBAR_STAYICHANGED);
	this.registerEvent(this.EVENT_SWARATOOLBAR_SPEEDCHANGED);
	this.registerEvent(this.EVENT_SWARATOOLBAR_LENGTHCHANGED);
	this.registerEvent(this.EVENT_SWARATOOLBAR_DELETESWARA);
	this.registerEvent(this.EVENT_SWARATOOLBAR_GAMAKACHANGED);
	this.registerEvent(this.EVENT_LYRICTOOLBAR_LABELCHANGED);
	this.registerEvent(this.EVENT_FONT_ADDED);
	this.registerEvent(this.EVENT_GAMAKA_ADDED);
    }
    this._init();
}
function EventManagerDefn ( ) { this . registerEvent = function ( typ ) { var str = typ + '' ; if ( this . _listeners [ str ] ) { return false ; } this . _listeners [ str ] = new Array ( ) ; return true ; } this . addListener = function ( eventTyp , listener ) { if ( ! listener || ! listener . onEvent ) return false ; var str = eventTyp + '' ; this . registerEvent ( str ) ; var listeners = this . _listeners [ str ] ; if ( ! listeners ) return false ; listeners [ listeners . length ] = listener ; return true ; } this . postEvent = function ( typ , src , data ) { var str = typ + '' ; if ( typ == this . EVENT_CUSTOM ) { if ( src . onEvent ) src . onEvent ( str , src , data ) ; return ; } var listeners = this . _listeners [ str ] ; var nListeners = listeners . length ; for ( var i = 0 ; i < nListeners ; i ++ ) listeners [ i ] . onEvent ( str , src , data ) ; } this . EVENT_MENUITEM_SELECTED = EVENT_TYPE . prototype . EVENT_MENUITEM_SELECTED ; this . EVENT_MENU_OPENED = EVENT_TYPE . prototype . EVENT_MENU_OPENED ; this . EVENT_MENU_CLOSED = EVENT_TYPE . prototype . EVENT_MENU_CLOSED ; this . EVENT_FORM_OPENED = EVENT_TYPE . prototype . EVENT_FORM_OPENED ; this . EVENT_FORM_CLOSED = EVENT_TYPE . prototype . EVENT_FORM_CLOSED ; this . EVENT_CONTENTAREA_MOUSECLICKED = EVENT_TYPE . prototype . EVENT_CONTENTAREA_MOUSECLICKED ; this . EVENT_SWARA_SELECTED = EVENT_TYPE . prototype . EVENT_SWARA_SELECTED ; this . EVENT_NOTHING_SELECTED = EVENT_TYPE . prototype . EVENT_NOTHING_SELECTED ; this . EVENT_NEWSWARASPACER_SELECTED = EVENT_TYPE . prototype . EVENT_NEWSWARASPACER_SELECTED ; this . EVENT_LYRIC_SELECTED = EVENT_TYPE . prototype . EVENT_LYRIC_SELECTED ; this . EVENT_HEADING_SELECTED = EVENT_TYPE . prototype . EVENT_HEADING_SELECTED ; this . EVENT_NOTATION_INSERTMODE = EVENT_TYPE . prototype . EVENT_NOTATION_INSERTMODE ; this . EVENT_SWARATOOLBAR_LABELCHANGED = EVENT_TYPE . prototype . EVENT_SWARATOOLBAR_LABELCHANGED ; this . EVENT_SWARATOOLBAR_STAYICHANGED = EVENT_TYPE . prototype . EVENT_SWARATOOLBAR_STAYICHANGED ; this . EVENT_SWARATOOLBAR_SPEEDCHANGED = EVENT_TYPE . prototype . EVENT_SWARATOOLBAR_SPEEDCHANGED ; this . EVENT_SWARATOOLBAR_LENGTHCHANGED = EVENT_TYPE . prototype . EVENT_SWARATOOLBAR_LENGTHCHANGED ; this . EVENT_SWARATOOLBAR_DELETESWARA = EVENT_TYPE . prototype . EVENT_SWARATOOLBAR_DELETESWARA ; this . EVENT_SWARATOOLBAR_GAMAKACHANGED = EVENT_TYPE . prototype . EVENT_SWARATOOLBAR_GAMAKACHANGED ; this . EVENT_LYRICTOOLBAR_LABELCHANGED = EVENT_TYPE . prototype . EVENT_LYRICTOOLBAR_LABELCHANGED ; this . EVENT_FONT_ADDED = EVENT_TYPE . prototype . EVENT_FONT_ADDED ; this . EVENT_GAMAKA_ADDED = EVENT_TYPE . prototype . EVENT_GAMAKA_ADDED ; this . EVENT_CUSTOM = EVENT_TYPE . prototype . EVENT_CUSTOM ; this . _listeners = new Array ( ) ; this . _init = function ( ) { this . registerEvent ( this . EVENT_MENUITEM_SELECTED ) ; this . registerEvent ( this . EVENT_MENU_OPENED ) ; this . registerEvent ( this . EVENT_MENU_CLOSED ) ; this . registerEvent ( this . EVENT_FORM_OPENED ) ; this . registerEvent ( this . EVENT_FORM_CLOSED ) ; this . registerEvent ( this . EVENT_SWARA_SELECTED ) ; this . registerEvent ( this . EVENT_NOTHING_SELECTED ) ; this . registerEvent ( this . EVENT_NEWSWARASPACER_SELECTED ) ; this . registerEvent ( this . EVENT_LYRIC_SELECTED ) ; this . registerEvent ( this . EVENT_HEADING_SELECTED ) ; this . registerEvent ( this . EVENT_NOTATION_INSERTMODE ) ; this . registerEvent ( this . EVENT_CONTENTAREA_MOUSECLICKED ) ; this . registerEvent ( this . EVENT_SWARATOOLBAR_LABELCHANGED ) ; this . registerEvent ( this . EVENT_SWARATOOLBAR_STAYICHANGED ) ; this . registerEvent ( this . EVENT_SWARATOOLBAR_SPEEDCHANGED ) ; this . registerEvent ( this . EVENT_SWARATOOLBAR_LENGTHCHANGED ) ; this . registerEvent ( this . EVENT_SWARATOOLBAR_DELETESWARA ) ; this . registerEvent ( this . EVENT_SWARATOOLBAR_GAMAKACHANGED ) ; this . registerEvent ( this . EVENT_LYRICTOOLBAR_LABELCHANGED ) ; this . registerEvent ( this . EVENT_FONT_ADDED ) ; this . registerEvent ( this . EVENT_GAMAKA_ADDED ) ; } this . _init ( ) ; }
@class
 represents the swara notation editor event manager
@class represents the swara notation editor event manager
/**
     * register an event with manager
     * @param {EVENT_TYPE} typ	event type
     */ /**
     * add a listener for an event type - the event type is registered if
     * not already done.
     *
     * @param {EVENT_TYPE} typ		event type
     * @param {EventListener} listener	event listener whose onEvent method would be called when
     *					event is posted
     */ /**
     * post an event - the event is delivered to all listeners who have
     * registered to receive this event via {@link addListener}
     * @param	{EVENT_TYPE} evt	the event type
     * @param		     src	the event src (depends on event type)
     * @param		     data	the event data (depends on event type)
     */ /**
     * @type Array
     * an associated array of registered listeners for various events
     * @private
     */ /**
     * (internal) initializer function
     * @private
     */