Function xGetTargetIndex