My question involves emancipation laws for the State of: California

This may be lengthy, but my friend desperately needs this information. Please bear with me as I dictate her story:

From what I understand, Ally (not her real name) lives with her father, and her younger brother Chris lives with their mother. Both parents are separated but live in the same apartment complex.

Ally is 17 and will turn 18 this September, but she has considered emancipation from her parents and is also seeking custody of her fourteen-year-old brother.

She is a senior in high school and holds a full-time job. I understand that in order to be granted emancipation she needs to demonstrate full independence and live on her own.

She's willing to wait until she turns 18, but her main concern is her brother's well being. The mother is unstable and physically and mentally abusive, something which can be proven and attested to in court. Ally herself suffered such abuse when the parents were still together, and the stories I've heard are horrific. What Ally wants to do is gain legal custody of her brother and pull him out of the same environment, but she is completely unsure of how to do it.

It would be so much easier if her father wasn't such a weak and indecisive person. Sometimes he sides with the mother, and now he suddenly wishes to take legal action against her and fight for custody of the brother himself. It's all a terribly confusing and overwhelming situation. There is no telling whether or not he'll actually follow through with the idea and he may just leave things the way they are, which he has done before.

To summarize, if my friend can prove self-sufficience, as a minor or when she becomes an adult, what else would be necessary in order for her to attain full custody of her younger brother and hopefully take the two of them to a healthier living environment? What optinos/programs are out there to help support her if she needs it? What should she apply for? How long does such a process take in court? She also worries for Chris's development and fears that cross-examinations and the like will damage him in his most formative years as a growing teenager. Would a year of court proceedings really surpass the potential level of damage that could be attained if he continued to live with his unstable mother?