NEW YORK (AP) — Elan says a federal judge ruled it violated the terms of an agreement with Biogen Idec to market the multiple sclerosis treatment Tysabri when it struck a separate deal to collaborate with Johnson & Johnson. Elan Corp. PLC said in a statement late Thursday that it respects the court decision but added it is "committed to working with Johnson & Johnson to close the transaction as quickly as possible consistent with" its earlier deal with Biogen Idec Inc. The company did not explain in the release how it planned to do that or whether it would appeal the decision by the U.S. District Court for the Southern District of New York. Elan and Biogen did not immediately respond to calls seeking comment. Johnson & Johnson agreed in July to take a $1.5 billion stake in Elan, and work with the Irish drugmaker to develop treatments for Alzheimer's disease. Tysabri is an intravenous infusion used to treat multiple sclerosis and Crohn's disease. About 43,000 patients were using the drug at the end of June, and Biogen has said total sales could be more than $1 billion this year. Elan and Biogen have been partners in marketing Tysabri since 2000. But Cambridge, Mass.-based Biogen said the Elan-J&J deal violated the terms of their agreement. The deal between Biogen and Elan says that if either partner is acquired by an outside company, the remaining partner will have the right to make an offer to buy all of the rights to Tysabri. Elan said in July that Johnson & Johnson might finance such an offer if Biogen were sold. The court agreed with Biogen that those comments were a breach of the partnership. The companies are not allowed to sell or give their Tysabri rights to another company without consent of the other partner. Elan filed suit against Biogen in August, saying it wanted to stop Biogen from ending the partnership.