Section 14. (a) The district attorney, or the attorney general at the request of the district attorney, may petition the court for a trial. In any trial held pursuant to this section, either the person named in the petition or the petitioning party may demand, in writing, that the case be tried to a jury and, upon such demand, the case shall be tried to a jury. Such petition shall be made within 14 days of the filing of the report of the two qualified examiners. If such petition is timely filed within the allowed time, the court shall notify the person named in the petition and his attorney, the district attorney and the attorney general that a trial by jury will be held within 60 days to determine whether such person is a sexually dangerous person. The trial may be continued upon motion of either party for good cause shown or by the court on its own motion if the interests of justice so require, unless the person named in the petition will be substantially prejudiced thereby. The person named in the petition shall be confined to a secure facility for the duration of the trial.
(b) The person named in the petition shall be entitled to the assistance of counsel and shall be entitled to have counsel appointed if he is indigent in accordance with section 2 of chapter 211D. In addition, the person named in the petition may retain experts or professional persons to perform an examination on his behalf. Such experts or professional persons shall be permitted to have reasonable access to such person for the purpose of the examination as well as to all relevant medical and psychological records and reports of the person named in the petition. If the person named in the petition is indigent under said section 2 of said chapter 211D, the court shall, upon such person's request, determine whether the expert or professional services are necessary and shall determine reasonable compensation for such services. If the court so determines, the court shall assist the person named in the petition in obtaining an expert or professional person to perform an examination and participate in the trial on such person's behalf. The court shall approve payment for such services upon the filing of a certified claim for compensation supported by a written statement specifying the time expended, services rendered, expenses incurred and compensation received in the same case or for the same services from any other source. The court shall inform the person named in the petition of his rights under this section before the trial commences. The person named in the petition shall be entitled to have process issued from the court to compel the attendance of witnesses on his behalf. If such person intends to rely upon the testimony or report of his qualified examiner, the report must be filed with the court and a copy must be provided to the district attorney and attorney general no later than ten days prior to the scheduled trial.
(c) Juvenile and adult court probation records, psychiatric and psychological records and reports of the person named in the petition, including the report of any qualified examiner, as defined in section 1, and filed under this chapter, police reports relating to such person's prior sexual offenses, incident reports arising out of such person's incarceration or custody, oral or written statements prepared for and to be offered at the trial by the victims of the person who is the subject of the petition and any other evidence tending to show that such person is or is not a sexually dangerous person shall be admissible at the trial if such written information has been provided to opposing counsel reasonably in advance of trial.
(d) If after the trial, the jury finds unanimously and beyond a reasonable doubt that the person named in the petition is a sexually dangerous person, such person shall be committed to the treatment center or, if such person is a youth who has been adjudicated as a delinquent, to the department of youth services until he reaches his twenty-first birthday, and then to the treatment center for an indeterminate period of a minimum of one day and a maximum of such person's natural life until discharged pursuant to the provisions of section 9. The order of commitment, which shall be forwarded to the treatment center and to the appropriate agency with jurisdiction, shall become effective on the date of such person's parole or in all other cases, including persons sentenced to community parole supervision for life pursuant to section 133C of chapter 127, on the date of discharge from jail, the house of correction, prison or facility of the department of youth services.
(e) If the person named in the petition is scheduled to be released from jail, house of correction, prison or a facility of the department of youth services at any time prior to the final judgment, the court may temporarily commit such person to the treatment center pending disposition of the petition.