


function assignValue(availableBoxId, selectedBoxId)
{
  availableBox = document.getElementById(availableBoxId);
  selectedBox = document.getElementById(selectedBoxId);
  
  var length = availableBox.options.length;
  var i=0;
  while (i<length)
  {
    if (availableBox.options[i] && availableBox.options[i].selected)
    {
      selectedBox.options[selectedBox.length] = 
        new Option(availableBox.options[i].text, availableBox.options[i].value, availableBox.options[i].selected);
      availableBox.options[i] = null;
      length = availableBox.options.length;
    }
    else
    {
      i++;
    }
  }
}

function unAssignValue(availableBoxId, selectedBoxId)
{
  availableBox = document.getElementById(availableBoxId);
  selectedBox = document.getElementById(selectedBoxId);
  
  var length = selectedBox.options.length;
  var i=0;
  while (i<length)
  {
    if (selectedBox.options[i] && selectedBox.options[i].selected)
    {
      availableBox.options[availableBox.length] = 
        new Option(selectedBox.options[i].text, selectedBox.options[i].value, selectedBox.options[i].selected);
      selectedBox.options[i] = null;
      length = selectedBox.options.length;
    }
    else
    {
      i++;
    }
  }
  
}
