/////////////////////////////////////////////////////////////////////////////
// Written by Rob Tietje for PTAC SDCOC.
// (c) Copyright SDCOC.  All rights Reserved.
/////////////////////////////////////////////////////////////////////////////

function CheckOther(combobox, msg)
{
	if (combobox.selectedIndex == combobox.length - 1)
	{
		var pref = prompt(msg);
		if (pref != null && pref != "")
		{
			var len = combobox.length;

			for (var idx = 0; idx < len; idx++)
				if (combobox.options[idx].text.toLowerCase() == pref.toLowerCase())
				{
					combobox.selectedIndex = idx;
					break;
				}

			if (idx == len)
			{
				var optObj = document.createElement('option');
				optObj.text = pref;

				try
				{
					combobox.add(optObj, combobox.options[len - 1]);
				}
				catch(ex)
				{
					combobox.add(optObj, len - 1);
				}

				combobox.selectedIndex = len - 1;
			}
		}
	}
}