GENEVA — The Lebanese group Islamic Jihad said it would be ready to free all its detainees in the context of a global release of prisoners, according to the text of a letter to United Nations Secretary-General Javier Perez de Cuellar made available Monday.The letter, a French translation of which was released by the UN here, said: "It is necessary to act to free our fighters lying in the prisons of occupied Palestine and of Europe, and to resolve the question of people we are holding as well as the problem of their families." The letter added: "We ask you to work personally within the framework of a global solution for the liberation of all detainees in the world. "In this event, we would be prepared to lead to its completion the process which we have begun today, and to liberate within 24 hours the people we are detaining." Freed British hostage John McCarthy, who was released Thursday, handed the letter, written in Arabic, to Mr. Perez de Cuellar at a British Air Force base Sunday. The letter for the most part railed against the UN and against the great powers for their inconsistent application of UN resolutions and principles of justice. It contrasted their attitude to the massacres of Palestinians in Sabra and Shatilla in west Beirut, or the abduction of what it said were 3,000 Muslims in east Beirut, and the disappearance of four Iranian diplomats in Beirut. It referred also to the US shooting down of an Iranian airliner over the Gulf during the Iran-Iraq war and the "barbaric massacres" in the Saudi Arabian city of Mecca during pilgrimages there. Turning on the sixth page to the hostages, it said: "The question of detainees and prisoners in the world today is one of the consequences of the confrontation between us and the forces of international arrogance led by America, the mother of iniquity throughout the world, and its offspring, Israel."