	//	========== OBJECT BOHButton ==========
	function BOHButton(xi_Form, xi_AddToForm, 
					   xi_ButtonName, xi_Function, xi_Submit, xi_Validate, xi_Confirm, xi_PreSubmitFunc, xi_PostSubmitFunc, xi_Parent_obj)
	{
		var	Form_elt;
		var	Child_elt;
		//var	SortSet_OrderField_elt;
		var	SplitName = new Array();
		if		 (typeof(xi_Form) == 'object')	Form_elt = xi_Form;
		else if	((typeof(xi_Form) == 'string')	&& !(Form_elt = document.getElementById(xi_Form)))
				alert('new BOHButton : Could not locate form ' + xi_Form);
		if(typeof(xi_ButtonName) != 'string')
		{	
			var	spec = xi_ButtonName;
			xi_ButtonName = spec[0]; xi_Function = spec[1]; xi_Submit = spec[2]; 
			xi_Validate = spec[3]; xi_Confirm = spec[4]; xi_PreSubmitFunc = spec[5]; xi_PostSubmitFunc = spec[6];
		}
		this.ID = xi_ButtonName;
		if(!(this.Button_elt = document.getElementById('Btn_' + xi_ButtonName)))
			alert('new BOHButton : Could not locate button Btn_' + xi_ButtonName);
		else
		{
			if(this.Button_elt.BOHButton)	alert('Duplicate definition for button object ' + this.Button_elt.id);
			else
			{
				this.Button_elt.BOHButton = this;
				// Attach to child elts so click event can find object
				for(var ChildNr in this.Button_elt.childNodes)
				{
					Child_elt = this.Button_elt.childNodes[ChildNr];
					if(Child_elt.nodeType == 1)	Child_elt.BOHButton = this;
				}
			}
			
			this.ButtonName		= xi_ButtonName;
			this.Function		= xi_Function;
			this.Submit			= xi_Submit;
			this.Validate		= xi_Validate;
			this.Confirm		= xi_Confirm;
			this.PreSubmitFunc	= xi_PreSubmitFunc;
			this.PostSubmitFunc	= xi_PostSubmitFunc;
			this.Parent_obj		= xi_Parent_obj;
			
			if(this.Button_elt.src)
			{
				SplitName = this.Button_elt.src.match(/^(.+)\.(.+)/);
	
				this.OutSrc = this.Button_elt.src;
				this.OverSrc =  SplitName[1] + 'Over' + '.' + SplitName[2];
		
				O3_AddEvent(this.Button_elt, 'mouseover', BOHButton_mouseover_event, false);
				O3_AddEvent(this.Button_elt, 'mouseout', BOHButton_mouseout_event, false);
			}

			O3_AddEvent(this.Button_elt, 'click', BOHButton_click_event, false);

			this.Valid 			= true;
			if(Form_elt)
			{
				this.Form_elt = Form_elt;
				if(xi_AddToForm)
				{
					if(!Form_elt.BOHForm)	new BOHForm(Form_elt);
					Form_elt.BOHForm.addButton(this);
				}	
			}
		}

	}	


	BOHButton.prototype.mouseover =	function ()
	{
		if(this.Button_elt) this.Button_elt.src = this.OverSrc;
	}

	BOHButton.prototype.mouseout =	function ()
	{
		if(this.Button_elt) this.Button_elt.src = this.OutSrc;
	}

	BOHButton.prototype.click =	function (xi_Event)
	{
		//if(this.Function)	alert('Click with function');
		if(this.Function && !this.Function(this, xi_Event))	return false;

		if(this.Form_elt && this.Submit)	return this.Form_elt.BOHForm.submit(this.ButtonName, this.Validate, this.Confirm, this.PreSubmitFunc, this.PostSubmitFunc);
		return false;
	}


	function BOHButton_mouseover_event(xi_Event)	{ return BOH_EventTarget(xi_Event).BOHButton.mouseover(); }
	function BOHButton_mouseout_event(xi_Event)		{ return BOH_EventTarget(xi_Event).BOHButton.mouseout(); }
	function BOHButton_click_event(xi_Event)		{ BOH_PreventDefault(xi_Event); return BOH_EventTarget(xi_Event).BOHButton.click(xi_Event); }
	
	//	Function for use by subrec buttons in their definitions
	function BOHButton_showSubRec(xi_BOHButton, xi_Event)
	{
		//var	SubRec_elt = document.getElementById('div_' + xi_BOHButton.ButtonName);
		var	SubRec_elt = document.getElementById(xi_BOHButton.ID);
		
		if(!SubRec_elt)	SubRec_elt =  document.getElementById('div_' + xi_BOHButton.ID);	// Transitional : To be removed when migration to new naming complete
		
		if(SubRec_elt)	SubRec_elt.BOHSubRec.show(xi_Event); 
	}


