﻿function initListBox(elm)
{
	if (window._listBoxFunctions == null)
	{
		window._listBoxFunctions = 
		{
			_onKeyReturnHandler: [],
		
			onkeyup: function(eventObj)
			{				
				try 
				{
					eventObj = extendEventObj(eventObj);					
					if (eventObj.keyCode == 13)
					{
						if (this._onKeyReturnHandler)
							this._onKeyReturnHandler();
					}
				}
				catch(e) {displayErr("ListBox_OnKeyUp", e);}
			}	
		};
	}
	
	var initOnKeyReturnHandler = elm._onKeyReturnHandler;
	
	elm = initComboBox(elm);
	elm = Object.extend(elm, window._listBoxFunctions);

	elm._onKeyReturnHandler = initOnKeyReturnHandler;

	return elm;
}
