

function toggle(input1, input2, enabled)
{
  enable(input1, !enabled);
  enable(input2, enabled);
}

function enable(input, enabled)
{
  if (enabled)
  {
    input.style.backgroundColor = "white";
  }
  else
  {
    input.value = '';
    if (input.selectedIndex != 0)
      input.selectedIndex = 0;
    input.style.backgroundColor = "gray";
  }
    
  input.disabled = !enabled;
}