function getTeams( choices, url ) {
  var leftSide = "";
  var rightSide = "";
  var numInputs = choices.length - 1;

  for ( var left = 0; left < numInputs; left = left + 2 ) {
    if ( ( choices.elements[left] ).checked ) leftSide = choices.elements[left].value;
  }
  for ( var right = 1; right < numInputs; right = right + 2) {
    if ( ( choices.elements[right] ).checked ) rightSide = choices.elements[right].value;
  }

  if( rightSide < leftSide ) {
    var tempSide = leftSide;
    leftSide = rightSide;
    rightSide = tempSide;
  }

  if ( ( leftSide == "" ) || ( rightSide == "" ) ) {
      alert( "Only one team was selected. Please also select a team from the other list." );
  } else if ( leftSide == rightSide ) {
      alert( "The same team was chosen in both lists. Please select two different teams." );
  } else {
    window.location.href = url + leftSide + '-' + rightSide + '/';
  }
}

