/**	lib:			js-dfc-hbar*	*	description:	horizontal bar for DFC controls (DFCButton)**	created:		Feb. 24, 2003*	*	contributed:	Wolfgang Schramm**	methods:		add				create	events:		onChange				onBeforeChange*/DFCHBar = function() {		DFCEvent.call(this);		this._aControl			= new Array();		this._hSelectedCtrl		= null;			// currently selected control	this._sEvent_onChange		= 'onChange';	this._sEvent_onBeforeChange	= 'onBeforeChange';	this._registerEvent(this._sEvent_onChange);	this._registerEvent(this._sEvent_onBeforeChange);}DFCHBar.prototype = new DFCEvent();DFCHBar.prototype.add = function(dfcControl) {	// dfcControl		DFC control which must implement	//				methods:	create, select	//				events:	onCommand		this._aControl[this._aControl.length]	= dfcControl;}DFCHBar.prototype.create = function(hWin, opt_domParent) {	this._hWin			= hWin;	this._hDoc			= hWin.document;	this._domParent		= opt_domParent || hWin.document.body;	// DOM parent element for the button	var domDoc	= this._hDoc;	var domCont, domTB, domTR, domTD;	var domCtrl;		// a table container keeps all controls in one line	domCont = domDoc.createElement('table');	domCont.setAttribute('border', '0', 0);	domCont.setAttribute('cellpadding', '0', 0);	domCont.setAttribute('cellspacing', '0', 0);		domTB = domDoc.createElement('tbody');			domTR = domDoc.createElement('tr');							// loop: all dfc controls				for (var iControl = 0; iControl < this._aControl.length; iControl++) {									dfcCtrl = this._aControl[iControl];										domTD = domDoc.createElement('td');							dfcCtrl.create(this._hWin, domTD);												// add eventlistener if it's a DFCEvent control						if (dfcCtrl.DFCEvent) {							dfcCtrl.addEventListener('onBeforeCommand',	this._onBeforeCommand, this);							dfcCtrl.addEventListener('onCommand',		this._onCommand, this);						}											domTR.appendChild(domTD);				}							domTB.appendChild(domTR);			domCont.appendChild(domTB);	this._domParent.appendChild(domCont);}DFCHBar.prototype._onBeforeCommand = function(dfcControl) {	// callback when an onBeforeCommand event occures in a dfc control		this._raiseEvent(this._sEvent_onBeforeChange, dfcControl);}DFCHBar.prototype._onCommand = function(dfcControl) {	// callback when an onCommand event occures in a dfc control		// nothing happens if current control is the already selected one	if (dfcControl == this._hSelectedCtrl) { return; }		// deselect last selected control	if (this._hSelectedCtrl) {		this._hSelectedCtrl.select(false);	}	// set current control	this._hSelectedCtrl = dfcControl;		this._raiseEvent(this._sEvent_onChange, dfcControl);}