function ComboBox_Select( value, description )
{
	var obj_form = eval( this.formname );
	var obj_control = eval( this.formname + "." + this.control );
	obj_control.value = value
	for( i = 0; i < obj_form.elements.length; i++ ){
		if( obj_form.elements [ i ].name == this.control ){
			obj_form.elements [ i + 1 ].value = description
			break;
		}
	}
}

function ComboBox_OnSelect( index )
{
	var value = this.options [ index ].value;
	var description =  this.options [ index ].description;
	this.Select( value, description );
	var wnd = eval( "window_" + this.control );
	wnd.hidePopup();
	if( this.autopostback ){
		var obj_form = eval( this.formname );
        	SetEventValue( this.formname + '$EventValue', this.control );
		DoFormSubmit( this.formname );
	}
}

function ComboItem( value, description )
{
	this.value = value;
	this.description = description;
}

function ComboBox( formname, control, options, autopostback )
{
	this.formname = formname;
	this.control = control;
	this.options = options;
	this.autopostback = autopostback;
	this.OnSelect = ComboBox_OnSelect;
	this.Select = ComboBox_Select;
}


