 NBC would maintain its ratings lead until 1999, the year after it lost the AFC television rights to CBS, which overtook it for first place.After "Friends" and "Frasier" ended their runs in 2004, NBC largely struggled in the ratings until 2013.Although it would be helped by its exclusive rights to the Olympic Games (a deal effective with the 2000 Summer Olympics in which, along with retaining its existing rights to the Summer Olympics, it assumed the exclusive rights to the Winter Olympics from CBS starting in 2002), the network's ratings troubles were also abetted by a slow decline in its sports division's event portfolio that began with the earlier loss of broadcast rights to the AFC to CBS, and later its share of Major League Baseball rights to Fox in 2000 and its contract with the National Basketball Association (NBA) to ABC and ESPN in 2002.