function getAllUsedCountriesIds            () { return getAllIDs( getAllUsedCountries()             ); }
function getCountry($countryId)
{
    foreach (getAllUsedCountries() as $country) {
        if ($country['id'] == $countryId) {
            return $country;
        }
    }
}
function regionChoice($competitions)
{
    #----------------------------------------------------------------------
    global $chosenRegionId;
    $options[] = array('', 'World');
    $options[] = array('', '');
    foreach (getAllUsedContinents() as $row) {
        $options[] = array($row['id'], $row['name']);
    }
    $options[] = array('', '');
    if ($competitions) {
        foreach (getAllUsedCountriesCompetitions() as $row) {
            $options[] = array($row['id'], $row['name']);
        }
    } else {
        foreach (getAllUsedCountries() as $row) {
            $options[] = array($row['id'], $row['name']);
        }
    }
    return choice('regionId', 'Region', $options, $chosenRegionId);
}