function ToolBarDisplayManager(parent) 
{
    /**
     * {@link EventListener} interface implementation
     */
    this.onEvent = function(evt, src) {
	var newtb;
	if( evt == EventManager.EVENT_SWARA_SELECTED || evt == EventManager.EVENT_NEWSWARASPACER_SELECTED ) {
	    newtb  = this._stb;
	}
	else if( evt == EventManager.EVENT_HEADING_SELECTED ) {
	    newtb  = this._htb;
	}
	else if( evt == EventManager.EVENT_LYRIC_SELECTED )
	    newtb  = this._ltb;
	if( this.curToolBar != newtb ) {
	    this.curToolBar.fToolBar.getContent().style.display = "none";
	    newtb.fToolBar.getContent().style.display = "";
	    this.curToolBar = newtb;
	}
	newtb.onShow();
    }

    /**
     * (testing aid) get the swara tool bar manager
     */
    this.getSwaraToolBarManager = function() { return this._stb; }

    /**
     * (testing aid) get the lyric tool bar manager
     */
    this.getLyricToolBarManager = function() { return this._ltb; }

    /**
     * (testing aid) get the heading tool bar manager
     */
    this.getHeadingToolBarManager = function() { return this._htb; }

    /**
     * the swara tool bar
     * @type SwaraToolBarManager
     * @private
     */
    this._stb = new SwaraToolBarManager(parent);
    /**
     * the lyric tool bar
     * @type SwaraToolBarManager
     * @private
     */
    this._ltb = new LyricToolBarManager(parent);
    /**
     * the heading tool bar
     * @type SwaraToolBarManager
     * @private
     */
    this._htb = new HeadingToolBarManager(parent);

    /**
     * parent of the toobar
     * @type DOMElement
     * @private
     */
    this.fParent = parent;

    /**
     * the currently shown toolbar
     * @private
     */
    this.curToolBar = this._stb;

    /**
     * are in insert mode for notations?
     * @type boolean
     * @private
     */
    this.fInsertMode = false;

    this.fFormsOpened = 0;
    
    // register later so that text-boxes inside toolbars get notified first (kludgy?)
    EventManager.addListener(EventManager.EVENT_SWARA_SELECTED, this);
    EventManager.addListener(EventManager.EVENT_NEWSWARASPACER_SELECTED, this);
    EventManager.addListener(EventManager.EVENT_LYRIC_SELECTED, this);
    EventManager.addListener(EventManager.EVENT_HEADING_SELECTED, this);
}
/**
 * @class
 * manages all the toolbars deciding when to show which one. It implements
 * ths {@link EventListener} interface
 */
@class
manages all the toolbars deciding when to show which one. It implements
ths  EventListener interface
@class manages all the toolbars deciding when to show which one . It implements ths EventListener interface
function ToolBarDisplayManager(parent) 
{
    this.onEvent = function(evt, src) {
	var newtb;
	if( evt == EventManager.EVENT_SWARA_SELECTED || evt == EventManager.EVENT_NEWSWARASPACER_SELECTED ) {
	    newtb  = this._stb;
	}
	else if( evt == EventManager.EVENT_HEADING_SELECTED ) {
	    newtb  = this._htb;
	}
	else if( evt == EventManager.EVENT_LYRIC_SELECTED )
	    newtb  = this._ltb;
	if( this.curToolBar != newtb ) {
	    this.curToolBar.fToolBar.getContent().style.display = "none";
	    newtb.fToolBar.getContent().style.display = "";
	    this.curToolBar = newtb;
	}
	newtb.onShow();
    }
    this.getSwaraToolBarManager = function() { return this._stb; }
    this.getLyricToolBarManager = function() { return this._ltb; }
    this.getHeadingToolBarManager = function() { return this._htb; }
    this._stb = new SwaraToolBarManager(parent);
    this._ltb = new LyricToolBarManager(parent);
    this._htb = new HeadingToolBarManager(parent);
    this.fParent = parent;
    this.curToolBar = this._stb;
    this.fInsertMode = false;
    this.fFormsOpened = 0;
    EventManager.addListener(EventManager.EVENT_SWARA_SELECTED, this);
    EventManager.addListener(EventManager.EVENT_NEWSWARASPACER_SELECTED, this);
    EventManager.addListener(EventManager.EVENT_LYRIC_SELECTED, this);
    EventManager.addListener(EventManager.EVENT_HEADING_SELECTED, this);
}
function ToolBarDisplayManager ( parent ) { this . onEvent = function ( evt , src ) { var newtb ; if ( evt == EventManager . EVENT_SWARA_SELECTED || evt == EventManager . EVENT_NEWSWARASPACER_SELECTED ) { newtb = this . _stb ; } else if ( evt == EventManager . EVENT_HEADING_SELECTED ) { newtb = this . _htb ; } else if ( evt == EventManager . EVENT_LYRIC_SELECTED ) newtb = this . _ltb ; if ( this . curToolBar != newtb ) { this . curToolBar . fToolBar . getContent ( ) . style . display = "none" ; newtb . fToolBar . getContent ( ) . style . display = "" ; this . curToolBar = newtb ; } newtb . onShow ( ) ; } this . getSwaraToolBarManager = function ( ) { return this . _stb ; } this . getLyricToolBarManager = function ( ) { return this . _ltb ; } this . getHeadingToolBarManager = function ( ) { return this . _htb ; } this . _stb = new SwaraToolBarManager ( parent ) ; this . _ltb = new LyricToolBarManager ( parent ) ; this . _htb = new HeadingToolBarManager ( parent ) ; this . fParent = parent ; this . curToolBar = this . _stb ; this . fInsertMode = false ; this . fFormsOpened = 0 ; EventManager . addListener ( EventManager . EVENT_SWARA_SELECTED , this ) ; EventManager . addListener ( EventManager . EVENT_NEWSWARASPACER_SELECTED , this ) ; EventManager . addListener ( EventManager . EVENT_LYRIC_SELECTED , this ) ; EventManager . addListener ( EventManager . EVENT_HEADING_SELECTED , this ) ; }
@class
 manages all the toolbars deciding when to show which one.
@class manages all the toolbars deciding when to show which one .
/**
     * {@link EventListener} interface implementation
     */ /**
     * (testing aid) get the swara tool bar manager
     */ /**
     * (testing aid) get the lyric tool bar manager
     */ /**
     * (testing aid) get the heading tool bar manager
     */ /**
     * the swara tool bar
     * @type SwaraToolBarManager
     * @private
     */ /**
     * the lyric tool bar
     * @type SwaraToolBarManager
     * @private
     */ /**
     * the heading tool bar
     * @type SwaraToolBarManager
     * @private
     */ /**
     * parent of the toobar
     * @type DOMElement
     * @private
     */ /**
     * the currently shown toolbar
     * @private
     */ /**
     * are in insert mode for notations?
     * @type boolean
     * @private
     */ // register later so that text-boxes inside toolbars get notified first (kludgy?)
