// ***************************************************************************

function selectSubject (select_src, select_dest)
{
  var n = select_src.options.length;
  var nSelected = 0;
  
  // Loop through the selected subjects in subject_src and add them to
  // the reviewed subject list.
  for (var i = 0; i < n; i++)
  {
    if (select_src.options[i].selected == true)
    {
      // Make sure that this subject doesn't already exist in the review list.
      var bFound = false;
      var n2 = select_dest.options.length;
      for (var j = 0; j < n2; j++)
      {
        if (select_src.options[i].value == select_dest.options[j].value)
        {
          bFound = true;
          break;
        }
      }
      
      if (!bFound)
      {
        // Increase the review select list by one and then add the entry.
        var idx = ++select_dest.length;
        select_dest.options[idx-1].value = select_src.options[i].value;
        select_dest.options[idx-1].text  = select_src.options[i].text;
      }
      
      nSelected++;
    }
  }
  
  if (nSelected == 0)
  {
//      alert ("Please make a selection.");
  }

//  alert ("hi");
  
  return false;
}

// ***************************************************************************

function clearSubjects (html_select)
{
  html_select.length = 0;
}

// ***************************************************************************

// The items in the subject list have to be selected so they are passed
// to the next page when "Find Programs" is clicked.
function setToSelected (html_select)
{
  var n = html_select.options.length;
  for (var i = 0; i < n; i++)
    html_select.options[i].selected = true;
}

// ***************************************************************************
