var defaultBgColor = "";
var highlightBgColor = "#C1C9E1";
var selectBgColor = "#D5E5FE";
var oldBgColor = "";
var selectedObj;
var selectedSubObj;

function highlight(thisObj)
{
  oldBgColor = thisObj.bgColor;
  thisObj.bgColor = highlightBgColor;
}

function unHighlight(thisObj)
{
  thisObj.bgColor = oldBgColor;
}

function selectOption(thisObj)
{
  if (selectedObj) selectedObj.bgColor = defaultBgColor;
  thisObj.bgColor = selectBgColor;
  oldBgColor = selectBgColor;
  selectedObj = thisObj;
}

function selectSubOption(thisObj)
{
  if (selectedSubObj) selectedSubObj.bgColor = defaultBgColor;
  thisObj.bgColor = selectBgColor;
  oldBgColor = selectBgColor;
  selectedSubObj = thisObj;
}