(a) In an action for divorce or for legal separation, for placement of a child when one or both parents have died, or as part of a child-in-need-of-aid proceeding for a child in state custody under AS 47.10, the court may, if it has jurisdiction under AS 25.30.300 - 25.30.320, and is an appropriate forum under AS 25.30.350 and 25.30.360, during the pendency of the action, or at the final hearing or at any time thereafter during the minority of a child of the marriage, make, modify, or vacate an order for the custody of or visitation with the minor child that may seem necessary or proper, including an order that provides for visitation by a grandparent or other person if that is in the best interests of the child. The court shall hear custody proceedings related to a child in state custody under AS 47.10 as part of the child-in-need-of-aid proceedings, as provided under AS 47.10.113, unless notice is provided to all parties to the child-in-need-of-aid proceedings and no party objects to hearing the custody proceedings in another appropriate forum.
(b) If a guardian ad litem for a child is appointed, the appointment shall be made under the terms of AS 25.24.310(c).
(c) The court shall determine custody in accordance with the best interests of the child under AS 25.20.060 - 25.20.130. In determining the best interests of the child the court shall consider
(1) the physical, emotional, mental, religious, and social needs of the child;
(2) the capability and desire of each parent to meet these needs;
(3) the child's preference if the child is of sufficient age and capacity to form a preference;
(4) the love and affection existing between the child and each parent;
(5) the length of time the child has lived in a stable, satisfactory environment and the desirability of maintaining continuity;
(6) the willingness and ability of each parent to facilitate and encourage a close and continuing relationship between the other parent and the child, except that the court may not consider this willingness and ability if one parent shows that the other parent has sexually assaulted or engaged in domestic violence against the parent or a child, and that a continuing relationship with the other parent will endanger the health or safety of either the parent or the child;
(7) any evidence of domestic violence, child abuse, or child neglect in the proposed custodial household or a history of violence between the parents;
(8) evidence that substance abuse by either parent or other members of the household directly affects the emotional or physical well-being of the child;
(9) other factors that the court considers pertinent.
(d) In awarding custody the court may consider only those facts that directly affect the well-being of the child.
(e) Notwithstanding the provisions of (d) of this section, in awarding custody the court shall comply with the provisions of 25 U.S.C. 1901 - 1963 (P.L. 95-608, the Indian Child Welfare Act of 1978).
(f) If the issue of child custody is before the court at the time it issues a judgment under AS 25.24.160, the court shall concurrently issue a judgment for custody under this section unless, subject to AS 25.24.155, the court delays the custody decision for a later time.
(g) There is a rebuttable presumption that a parent who has a history of perpetrating domestic violence against the other parent, a child, or a domestic living partner may not be awarded sole legal custody, sole physical custody, joint legal custody, or joint physical custody of a child.
(h) A parent has a history of perpetrating domestic violence under (g) of this section if the court finds that, during one incident of domestic violence, the parent caused serious physical injury or the court finds that the parent has engaged in more than one incident of domestic violence. The presumption may be overcome by a preponderance of the evidence that the perpetrating parent has successfully completed an intervention program for batterers, where reasonably available, that the parent does not engage in substance abuse, and that the best interests of the child require that parent's participation as a custodial parent because the other parent is absent, suffers from a diagnosed mental illness that affects parenting abilities, or engages in substance abuse that affects parenting abilities, or because of other circumstances that affect the best interests of the child.
(i) If the court finds that both parents have a history of perpetrating domestic violence under (g) of this section, the court shall either
(1) award sole legal and physical custody to the parent who is less likely to continue to perpetrate the violence and require that the custodial parent complete a treatment program; or
(2) if necessary to protect the welfare of the child, award sole legal or physical custody, or both, to a suitable third person if the person would not allow access to a violent parent except as ordered by the court.
(j) If the court finds that a parent has a history of perpetrating domestic violence under (g) of this section, the court shall allow only supervised visitation by that parent with the child, conditioned on that parent's participating in and successfully completing an intervention program for batterers, and a parenting education program, where reasonably available, except that the court may allow unsupervised visitation if it is shown by a preponderance of the evidence that the violent parent has completed a substance abuse treatment program if the court considers it appropriate, is not abusing alcohol or psychoactive drugs, does not pose a danger of mental or physical harm to the child, and unsupervised visitation is in the child's best interests.
(k) The fact that an abused parent suffers from the effects of the abuse does not constitute a basis for denying custody to the abused parent unless the court finds that the effects of the domestic violence are so severe that they render the parent unable to safely parent the child.
(l) Except as provided in AS 25.20.095 and 25.20.110, a court may not consider a parent's activation to military service and deployment in determining the best interest of the child under (c) of this section. In this subsection, “deployment” has the meaning given in AS 25.20.095.