In most states, a person under the age of 18 who breaks the law is tried in juvenile court. The public prosecutor files a petition with the court to try the offender as a child. There are a number of exceptions to this practice. If the child is over the age of 16, he or she can be tried as an adult for offenses such as murder, kidnapping, rape, armed robbery, carjacking, drug dealing, and a number of other serious crimes. In most states, a child charged with a repeated felony, or with a particularly heinous (HAY-nus) crime may be tried as an adult. If a child is arrested, the police must immediately inform the parents or guardians, and the child is usually detained in a special facility or juvenile detention center. The civil and legal rights of a child are essentially the same as those guaranteed to an adult, but a juvenile doesn't have the right to a jury trial. Instead, trials in juvenile court are tried by a judge. In juvenile court, the delinquent child is represented by an attorney. In most states, the trial of a juvenile on a felony charge may be open to the public, but judges can opt to hold a closed trial in the case of sexual offenses, or if it's believed that this would be in the best interest of the child. Judges in juvenile court are often given great discretion in devising a punishment or program that will lead to rehabilitation. In some jurisdictions, there are limitations on the period of time a convicted juvenile can be incarcerated, but these policies differ greatly among the states.