function DropDownNav()
{
	this.Attach = DropDownNav_Attach;
	this.AddInstruction = DropDownNav_AddInstruction;
	this.AddNavigation = DropDownNav_AddNavigation;
	this.AddSeparator = DropDownNav_AddSeparator;
}

function DropDownNav_Attach(sSelectID)
{
	var elmSelect = document.getElementById(sSelectID);
	if (this._elmAttachedSelect == null)
		{
		elmSelect.onchange = DropDownNav_OnChange;
		this._elmAttachedSelect = elmSelect;
		}
	else
		throw "You have already attached a SELECT element to this drop-down navigation object."
}

function DropDownNav_AddNavigation (sText, sLink)
{
	if (sLink.length > 0 && this._elmAttachedSelect.options.length == 0)
		throw "Navigation objects may not be the first item added."
	var oOption = document.createElement("option");
	oOption.text = sText;
	oOption.value = sLink;
	this._elmAttachedSelect.add(oOption);
}

function DropDownNav_AddInstruction (sText)
{
	this.AddNavigation (sText, "");	
}

function DropDownNav_AddSeparator ()
{
	this.AddNavigation ("", "");	
}

function DropDownNav_OnChange ()
{
	var oOption = this.options[this.selectedIndex];
	var sLink = oOption.value;
	if (sLink.length != 0)
		window.navigate (sLink);
	else
		this.selectedIndex = 0;
}