function ComboList(comboId, formName, formSelectionField)
{
	this.comboList = null;
	this.comboSelection = null;
	this.comboOptions = null;
	this.form = null;
	this.formSelectionField = null;
	this.comboExpanded = false;
	
	this.init = function()
				{
					self.comboList = document.getElementById(comboId);
					self.form = document.forms[formName];
					self.formSelectionField = self.form[formSelectionField];
					self.comboOptions = self.comboList.getElementsByTagName('li');
					
					self.updateComboSelection();
					self.setComboOptionsEvents();
					self.hideComboOptions();
				}
				
	this.getComboDefaultSelection = function()
								{
									var selectedValue = self.formSelectionField.value;
									for (var i=0; i<self.comboOptions.length; i++)
									{
										if(self.comboOptions[i].id == selectedValue)
										{
											return self.comboOptions[i];
											break;
										}
									}
									return self.comboOptions[0];
								}
				
	this.updateComboSelection = function(optionSelected)
								{
									self.comboSelection = (optionSelected)?optionSelected:self.getComboDefaultSelection();
									self.comboSelection.firstChild.className = 'selected';
									self.comboSelection.onclick = self.showComboOptions;
									self.comboList.insertBefore(self.comboSelection, self.comboList.firstChild);
								}
								
	this.setComboOptionsEvents = function()
									{
										var i;
										for(i=0; i<self.comboOptions.length;i++)
										{
											if (self.comboOptions[i] != self.comboSelection)
												self.comboOptions[i].onclick = self.comboOptionClick;
										}
									}
	
	this.comboOptionClick = function()
								{										
									self.formSelectionField.value = this.id;
									self.updateComboSelection(this);
									self.hideComboOptions();
								}
	
	this.showComboOptions = function()
								{
									if (self.comboExpanded == false)
									{
										var i;
										for (i=0; i<self.comboOptions.length; i++)
											self.comboOptions[i].style.display = 'block';
										self.comboExpanded = true;
									}
									else
										self.hideComboOptions();
								}
								
	this.hideComboOptions = function()
								{
									var i;
									for (i=0; i<self.comboOptions.length; i++)
									{
										if (self.comboOptions[i] != self.comboSelection)
										{
											self.comboOptions[i].style.display = 'none';
											self.comboOptions[i].firstChild.className = '';
											self.comboOptions[i].onclick = self.comboOptionClick;
										}
										self.comboExpanded = false;
									}
								}
	
	var self = this;
}