(a) Circuit courts shall have the power and duty to appoint a guardian ad litem to a proceeding to represent an incompetent party who is not represented by a guardian or next friend and, for the protection of the interests of a nonresident party who is not represented before the court and has not been personally served with notice, to appoint an attorney ad litem to give notice to the nonresident of the pendency and nature of the proceeding as is provided by law with respect to proceedings in courts of equity.
(b) The appointment of a guardian ad litem or attorney ad litem may be made by the clerk of the court at any time after the initiation of a proceeding by the filing of a petition, subject to the approval of the court.