
937 P.2d 1222 (1997)
130 Idaho 148
Robynne L. McKAY, a single person; and Co-Ad, Inc., as guardian ad litem for Daniel Wayne McKay Butler, a minor and disabled person, Plaintiffs-Appellants,
v.
R. Bruce OWENS and Jane Doe Owens, husband and wife, and the marital community composed thereof, Howard & Owens, P.A., an Idaho professional services corporation; Howard L. Manweiler and Jane Doe Manweiler, husband and wife, and the marital community composed thereof, and Manweiler, Bevis & Cameron, P.A., an Idaho professional services corporation, Defendants-Respondents.
No. 22134.
Supreme Court of Idaho, Boise, December 1996 Term.
May 20, 1997.
*1223 William F. Lee, Boise; and Robert B. Gould argued, Seattle, WA, for the appellant.
Evans Keane, L.L.P., Boise, for respondent Manweiler. William McCurdy argued.
Cosho, Humphrey, Greener & Welsh, Boise, for respondent Owens. Steven B. Price argued.
SILAK, Justice.
This is a legal malpractice case, stemming from an underlying medical malpractice action. In the medical malpractice suit, Henry E. Houst, Jr. (Houst) and respondent R. Bruce Owens (Owens) represented the interests of appellant Robynne L. McKay (McKay) and her disabled son Daniel, while respondent Howard Manweiler (Manweiler) was appointed by the court to act as guardian ad litem (guardian) for Daniel. McKay was separately represented at the minor's compromise hearing by Allen Ellis (Ellis), and James Baugh (Baugh) acted as an additional guardian for a trust to be set up for Daniel. Neither Houst nor Baugh is a party to this action.
The medical malpractice action settled, and after all parties agreed to it at the minor's compromise hearing, the court approved the settlement. McKay subsequently filed a legal malpractice action against Manweiler and Owens (collectively referred to as the Respondents). This appeal follows the district court's granting of summary judgment in favor of the Respondents, and the court's subsequent decision to grant sanctions, attorney fees, and costs against McKay and Ellis.


*1224 I.

FACTS AND PROCEDURAL BACKGROUND
In 1987, McKay gave birth to Daniel by emergency caesarean section. Daniel has been severely disabled since birth, and in 1989, McKay filed a medical malpractice action on behalf of herself and Daniel against St. Luke's Regional Medical Center (St. Luke's) and her obstetrician. Her attorneys at that time were Houst and Owens. That same year, Manweiler was asked to be guardian ad litem for Daniel, although he was not appointed by the court until the minor's compromise hearing in 1992.
McKay alleges that Owens and Manweiler agreed to settle the case without her approval and over her repeated objections. She states that she felt that there was nothing she could do to reject the settlement after Owens and Manweiler accepted it, although the minor's compromise hearing had not yet been held and Houst told her she did not have to accept anything she did not want to. After becoming dissatisfied with Owens' representation, McKay retained Ellis to represent her interests in the medical malpractice action. She alleges that she attempted to find new counsel to take the medical malpractice action to trial, but that no one would represent her because of Owens' lien rights on attorney fees, and because the new counsel would have to split the attorney fees with Owens in some fashion.
Before the minor's compromise hearing, McKay filed objections to, among other things, the proposed compromise, and to Manweiler's appointment as guardian. McKay contends that she never withdrew two of her objections to the settlement. One of those objections was that she never agreed to the settlement. However, as discussed below, she clearly agreed to the settlement at the minor's compromise hearing. The second objection, which McKay also contends was never withdrawn, was stated as follows: "As presently postured, Robynne McKay objects to the settlement which is proposed. However, if the attorney fees and other matters are clarified, she will reluctantly consent to the settlement." The transcript from the minor's compromise hearing reflects that not only did McKay and Ellis agree to the settlement at the hearing, but that they specifically withdrew their objection to the attorney fees, as well as the other objections McKay made. Finally, neither she nor Ellis objected to Houst's statement that "all concerns presented by Robin [sic] McKay, pursuant to her objection filed by Mr. Allen Ellis, have been resolved."
After Ellis made his statement withdrawing the objections, the magistrate court asked: "[w]ith that, then, Mr. Ellis, you're saying you agree with the recitation of what the settlement is and you are recommending that for your client?" (emphasis added). Ellis responded "[y]es, Your Honor" [with the stipulation that money to be paid to McKay in 1997 and 2002 was in settlement of her personal injury claim]. Later, the Court again asked:
THE COURT: Now, Mr. Ellis, I'm sure that you have looked at this a lot longer than I have, and you're satisfied that it's a fair resolution, and you want this for your client?
MR. ELLIS: That is correct, Your Honor.
THE COURT: Okay. And, Ms. McKay, now, this is complex. I'm sure you've spent a lot more time on it than I have, obviously, too. And you talked to your lawyers at the counsel table, and your lawyer, Mr. Ellis. So do you feel that you have a good understanding of it, and approval of it?
MS. ROBIN [sic] MCKAY: Yes.
THE COURT: And is there anything you want to say?
MS. ROBIN [sic] MCKAY: Not (indiscernible).
McKay alleges that despite the preceding dialogue with the court, she agreed to the settlement only after she was unable to find other representation, and then only to "mitigate her damages." She also alleges that she never was truly satisfied with the settlement, and argues that she never really agreed to it.
In an affidavit in the record, Ellis stated that "I advised plaintiff Robynne McKay to withdraw her objection to the proposed minor's *1225 compromise in order to mitigate her damages as required by law prior to her bring [sic] malpractice and breach of fiduciary duty claims." Therefore, Ellis advised McKay to tell the court she approved the settlement, even though she now alleges that she never truly agreed to the settlement. McKay also stated in an affidavit that:
After discussions with Mr. Ellis, and cognizant of my duty to mitigate damages, I agreed to withdraw my objections to the Minor's Compromise such that Daniel would receive as much as possible from the defendant hospital St. Luke's and the defendant doctor....
At the minor's compromise hearing, in response to direct questions from the magistrate judge, Houst, Owens, Manweiler and Baugh gave their consent to the settlement. The magistrate court in the minor's compromise hearing then approved the settlement. McKay, Manweiler, Owens, Houst, and Ellis signed a "Release of All Claims and Indemnity Agreement." This release was signed after the minor's compromise hearing, and therefore was not before the magistrate judge. While that agreement specifically released St. Luke's and the obstetrician from further liability, it specifically preserved any claims McKay might have had against Owens. On appeal, no one disputes that the release did not bar any legal malpractice claims McKay might have.
In 1994, McKay's new attorneys, Robert Gould (Gould) and William Lee (Lee), filed a legal malpractice complaint against Owens and Manweiler. The complaint alleged negligence in representing a client, willful disobedience of a client's instructions, and failure to exercise discretion in good faith. Essentially, the complaint was that Owens and Manweiler settled the medical malpractice claim without McKay's consent, and that the amount of the settlement was insufficient. Manweiler filed a motion to dismiss under I.R.C.P. 12(b)(6), which the trial court denied, and alternatively a motion for summary judgment under I.R.C.P. 56. The trial court granted summary judgment based on the doctrines of judicial estoppel and quasi-judicial immunity. Owens also filed a motion to dismiss, which the trial court treated as a motion for summary judgment and granted on the basis of the doctrine of judicial estoppel.
Manweiler and Owens then filed motions for sanctions under I.R.C.P. 11, as well as attorneys' fees and costs. The court awarded costs as a matter of right under I.R.C.P. 54(d)(1), although it denied discretionary costs. In addition, the court required McKay's counsel to pay Owens' and Manweiler's attorney fees and computer research costs as a sanction under I.R.C.P. 11. McKay appeals.

II.

ISSUES ON APPEAL
The issues on appeal are:
1. Whether the trial court erred in granting Owens' motion to dismiss and Manweiler's motion for summary judgment based on the doctrine of judicial estoppel.
2. Whether the trial court erred in granting Manweiler's motion for summary judgment based on the doctrine of quasi-judicial immunity.
3. Whether the trial court erred in granting Owens' and Manweiler's motions for attorneys' fees, costs, and sanctions.

III.

STANDARD OF REVIEW
This appeal follows the district court's decision granting Manweiler's motion for summary judgment and Owens' motion to dismiss for failure to state a claim upon which relief can be granted. However, because the court considered matters outside the pleadings, such as affidavits and the record from the minor's compromise hearing, it properly treated Owens' motion as one for summary judgment. I.R.C.P. 12(b) provides that:
[i]f, on a motion asserting the defense ... to dismiss for failure of the pleading to state a claim upon which relief can be granted, matters outside the pleading are presented to and not excluded by the court, the motion shall be treated as one for summary judgment....
*1226 When the Supreme Court reviews a district court's decision on summary judgment, it employs the same standard as that properly employed by the trial court when originally ruling on the motion. Thomson v. Idaho Ins. Agency, Inc., 126 Idaho 527, 529, 887 P.2d 1034, 1036 (1994). Summary judgment is proper "if the pleadings, depositions, and admissions on file, together with the affidavits, if any, show that there is no genuine issue as to any material fact and that the moving party is entitled to judgment as a matter of law." I.R.C.P. 56(c). Finally, this Court liberally construes all disputed facts in favor of the non-moving party, and will draw all reasonable inferences and conclusions supported by the record in favor of the party opposing the motion. 126 Idaho at 529, 887 P.2d at 1036.

IV.

ANALYSIS

A. The Trial Court Did Not Err In Granting The Motions For Summary Judgment Based On The Doctrine Of Judicial Estoppel.
The district court granted the summary judgment motions based on the doctrine of judicial estoppel. McKay argues that she should not be judicially estopped, because she had to accept the settlement in order to "mitigate her damages," and because under the circumstances she had no other choice.
This Court has previously considered and adopted the doctrine of judicial estoppel. Loomis v. Church, 76 Idaho 87, 277 P.2d 561 (1954). In Loomis, the plaintiff-appellant sued the driver of a car in which she had been a passenger, alleging the driver caused an accident with a truck by failing to stop at a stop sign. However, the plaintiff had previously recovered from the truck owner, after stating that the car's driver had stopped at the stop sign. The Court held that the plaintiff could not recover from the car's driver, and set forth the doctrine of judicial estoppel:
It is quite generally held that where a litigant, by means of such sworn statements, obtains a judgment, advantage or consideration from one party, he will not thereafter, by repudiating such allegations and by means of inconsistent and contrary allegations or testimony, be permitted to obtain a recovery or a right against another party, arising out of the same transaction or subject matter.
Id. at 93-94, 277 P.2d at 565 (citations omitted). See also Saint Alphonsus Reg'l. Med. Ctr. v. Bannon, 128 Idaho 41, 44, 910 P.2d 155, 158 (1995) (stating that the position asserted in the later action must be contrary); Middlekauff v. Lake Cascade, Inc., 110 Idaho 909, 915, 719 P.2d 1169, 1175 (1986) (reiterating that the plaintiff must have obtained a judgment, advantage, or consideration from a party in the earlier proceeding).
The Ninth Circuit has applied the doctrine of judicial estoppel, and recently stated the doctrine and the policies behind it:
Judicial estoppel, sometimes also known as the doctrine of preclusion of inconsistent positions, precludes a party from gaining an advantage by taking one position, and then seeking a second advantage by taking an incompatible position ...
Rissetto v. Plumbers and Steamfitters Local 343, 94 F.3d 597, 600 (9th Cir.1996). There are also important policies behind judicial estoppel. In Rissetto, the Ninth Circuit stated that:
The policies underlying preclusion of inconsistent positions are general considerations of the orderly administration of justice and regard for the dignity of judicial proceedings.... Judicial estoppel is intended to protect against a litigant playing fast and loose with the courts ... Because it is intended to protect the dignity of the judicial process, it is an equitable doctrine invoked by a court at its discretion.
Id. at 601 (quoting Russell v. Rolfs, 893 F.2d 1033, 1037 (9th Cir.1990), cert. denied, 501 U.S. 1260, 111 S.Ct. 2915, 115 L.Ed.2d 1078 (1991)).
While we have not previously considered judicial estoppel in the context of legal malpractice, appellate courts of other states have done so. In Brown v. Small, 251 Mont. 414, 825 P.2d 1209 (1992), Brown accepted a settlement from an insurance company, after which his attorneys discovered a mid-term endorsement giving additional coverage. *1227 Brown's attorneys then negotiated a larger settlement, principally on the basis that the insurance company had hidden the endorsement in bad faith. Brown accepted the settlement, then sued the attorneys, alleging that they were negligent in not finding the endorsement sooner.
The Supreme Court of Montana held that Brown's legal malpractice claim was barred by judicial estoppel, noting that "[t]he rule's purpose is to suppress fraud and prevent abuse of the judicial process by deliberate shifting of positions to suit the exigencies of a particular action. ..." Id. at 1212 (emphasis in original) (citations omitted). The court also held that:
The doctrine applies with additional force here because Brown's allegation in the second complaint against the insurer resulted in a net recovery by him of almost $75,000. After accepting the benefits of that allegation, Brown cannot now change his position and allege that negligence by Small and Doubek was the real reason they did not discover the mid-term endorsement sooner.
Id.
In Owen v. Knop, 853 S.W.2d 638 (Tex. App.1993), the court considered a legal malpractice action arising from a medical malpractice suit. In the underlying action, Owen alleged that she did not know nor could she have known of the doctor's negligence until she received a correct diagnosis from another doctor. After that case settled, Owen filed a legal malpractice action, alleging that her attorney negligently failed to file the medical malpractice suit in a timely manner and otherwise "preserve her claim for damages." Id. at 640. (Owen contended that she received a smaller settlement because there was a possible statute of limitations defense). The court noted that judicial estoppel does not operate if the prior statements were "made inadvertently due to mistake, fraud, or duress," but "[o]ne may not assert a position contrary to that alleged or admitted under oath in a former proceeding." Id. at 641.
In Owen, as in the case at bar, the plaintiff claimed that she had to take inconsistent positions due to her attorney's malpractice. In response to that argument, the court stated:
This contention is without merit. The rationale underlying the theory of judicial estoppel is the preservation of the sanctity of the oath and the elimination of prejudice in the administration of justice. One may not assert a particular position in order to serve one purpose, then assert a wholly contrary position to serve another. This Owen improperly attempted to do, and she cannot be allowed to assert that the purported malfeasance of her own attorney made her do it.
Id. at 643.
In Winmark v. Miles & Stockbridge, 109 Md.App. 149, 674 A.2d 73 (1996), the appellant had failed to list its possible legal malpractice claim against the respondents on the personal property schedule in a bankruptcy action. The court found that the legal malpractice claim was barred by judicial estoppel, and admonished that:
If parties in court were permitted to assume inconsistent positions in the trial of their causes, the usefulness of courts of justice would in most cases be paralyzed; the coercive process of the law, available only between those who consented to its exercise, could be set at naught by all. But the rights of all men, honest and dishonest, are in the keeping of the courts, and consistency of proceeding is therefore required of all those who come or are brought before them. It may accordingly be laid down as a broad proposition that one who, without mistake induced by the opposite party, has taken a particular position deliberately in the course of litigation, must act consistently with it; one cannot play fast and loose.
Id. 674 A.2d at 79-80 (quoting Kramer v. Globe Brewing Co., 175 Md. 461, 2 A.2d 634 (1938)).
The elements of judicial estoppel have been met in this case. McKay, as the litigant, stated in court that she agreed to the settlement. Ellis admits that he encouraged her to agree in court to the settlement, and he himself stated in court that he concurred with the settlement. Moreover, McKay and *1228 Ellis specifically withdrew previously filed objections to the settlement. McKay filed objections to the settlement on the following bases:
1. Owens entered into the settlement without McKay's consent and failed to provide her with information regarding the case;
2. Manweiler approved the settlement without McKay's consent;
3. McKay objected to the settlement as proposed, but also stated that "if the attorney fees and other matters are clarified ... [I would] reluctantly consent to the settlement";
4. Houst and Owens did not have standing to bring the petition since neither was Daniel's parent;
5 . Manweiler had never been appointed guardian ad litem and had never consulted with McKay regarding the litigation; and
6. No part of the settlement proceeds had been allocated to McKay, contrary to her instructions.
McKay also registered concerns, although not specific objections, about the lack of a present value amount, a contingent fee agreement, statement of hours and services rendered by the attorneys, and a breakdown of costs in the settlement agreement. McKay also requested $25,000 to be paid on July 1, 1995, to compensate her for the lack of consent, and requested a reduction in attorney fees.
At the minor's compromise hearing, McKay specifically waived her objections on the standing issue, Manweiler's appointment as guardian ad litem, the cost breakdown, the attorney fees, the present value calculation, and McKay's share of the settlement. McKay concedes in her opening brief on appeal that "[o]n the record in open court, Robynne and Ellis both withdrew their written objection to the Minor's Compromise hearing and approved the settlement with the underlying health care professionals." To the contrary, in her reply brief, she argues that she never withdrew her objections regarding the fair value of the settlement and the unauthorized settlement. However, the portions of the transcript from the minor's compromise hearing, quoted in Section I of this opinion, clearly reflect that McKay and Ellis agreed to the settlement, without reserving any objections. The magistrate gave Ellis and McKay the opportunity to raise new and continuing objections, and they did not. Instead, they both clearly registered their agreement to the settlement. Therefore, we hold that McKay withdrew her objections to the Minor's compromise. This becomes important because the very bases for McKay's legal malpractice claim were waived as objections: that Owens and Manweiler settled the medical malpractice claim without McKay's consent, and that the damages awarded pursuant to the settlement agreement were insufficient.
By taking the position of agreeing to the settlement, McKay obtained an advantage (the settlement) from one party (the medical malpractice defendant). She cannot now repudiate that statement made in open court in front of a judge, and by means of her inconsistent positions, obtain a recovery against another party, arising out of the same transaction. While Owens and Manweiler were not parties to the medical malpractice action, as attorneys in the case, they were so intimately intertwined with the medical malpractice proceedings that this legal malpractice action can be termed to be "arising out of the same transaction."
McKay asserts that she never really meant to approve the settlement, and that she always intended to file this legal malpractice action. Judicial estoppel, with its attendant policies, is tailor-made to prevent just such a tactic, and to block the "secret or subjective intent" of the litigant. The sanctity of court proceedings is something that cannot be trifled with, nor will we permit a party to play fast and loose with the courts. To allow McKay's argument that Owens' and Manweiler's alleged malpractice "forced" her to lie in court, desecrates the sanctity of court proceedings, and impedes the administration of justice. In order to properly carry out its duties in approving a minor's compromise, a court must be fully informed of the nature and status of the agreements. To mislead the court by stating that one agrees to a *1229 settlement when one does not, adversely affects the court's ability to discharge its duties, and impedes the administration of justice. The concept of "telling the truth" in such an important matter must be imputed to Daniel's mother and attorney Allen Ellis. Hence Daniel, via his mother McKay, basically held the "trump card" to this proposed settlement. Everyone involved changed their positions based upon McKay's and Ellis's intentionally false and misleading statements. Therefore, we hold that McKay's claims in this case against Manweiler and Owens are barred by the doctrine of judicial estoppel.
McKay cites several cases for the proposition that a legal malpractice action may be brought after settlement of the underlying case. However, none of those cases involved judicial estoppel, and in each, the alleged malpractice was not discovered until after the settlement had been approved. Therefore, the cases are distinguishable. See Malfabon v. Garcia, 111 Nev. 793, 898 P.2d 107 (1995); Grayson v. Wofsey, Rosen, Kweskin & Kuriansky, 231 Conn. 168, 646 A.2d 195 (1994); Barr v. Day, 124 Wash.2d 318, 879 P.2d 912 (1994).
This decision does not mean that attorneys will never be accountable for their negligence whenever there has been a settlement in the underlying transaction. If a client does not learn of the grounds for, or facts giving rise to, legal malpractice until after the settlement has been approved, the policies behind judicial estoppel will not be furthered, and the doctrine should not be employed. For guidance purposes and to avoid misapplication of judicial estoppel, it should be made clear that the concept should only be applied when the party maintaining the inconsistent position either did have, or was chargeable with, full knowledge of the attendant facts prior to adopting the initial position. Stated another way, the concept of judicial estoppel takes into account not only what a party states under oath in open court, but also what that party knew, or should have known, at the time the original position was adopted. Thus, the knowledge that the party possesses, or should have possessed, at the time the statement is made is determinative as to whether that person is "playing fast and loose" with the court.
The situation would also be different, for example, if an attorney committed malpractice by neglecting to include a defendant in the complaint. In that case, assuming that the client was not aware of the malpractice before agreeing to the settlement, the client may have a legal malpractice claim. The conduct giving rise to the legal malpractice claim, while potentially affecting the amount of the final settlement agreement, is not part and parcel of the settlement agreement. The client could still agree to the settlement while retaining the right to file a legal malpractice action.
In contrast, McKay's legal malpractice claim goes to the heart of the settlement itself: that Owen and Manweiler settled the case without her consent, and that the settlement amount is insufficient. The case could not be "settled," as a matter of law, without the compromise of the minor's claim being approved by the court. As discussed previously, McKay assented to the settlement without reservation or objection, and now is complaining about the very conduct she clearly approved at the minor's compromise hearing.
The argument might also be made that Loomis is distinguishable because in that case, the contrasting representations were clearly factual. In this case, McKay's representations were arguably legal as opposed to factual. However, judicial estoppel is designed to preclude inconsistent positions. At the minor's compromise hearing, McKay took the position that she agreed to the settlement. Now, she is taking the position that she did not agree to the settlement. Judicial estoppel is meant to prevent taking inconsistent positions, whether legal or factual, at least absent newly discovered evidence or fraud. In addition, McKay's assent to the settlement was, at least in part, a factual representation that she did in fact agree to the settlement. Therefore, Loomis may not be distinguishable.
McKay could have registered her continuing objection to the settlement, and the court would not have approved it. Idaho Code section 15-5-409a clearly states, "before the *1230 compromise shall be valid or of any effect the same shall be approved by the court of the county where the minor resides...." The magistrate judge recognized that fact when she stated, after Owens had noted two matters to be clarified:
"Well, I'll note your exceptions, but it seems to me this is the sort of thing that you should have resolved before you come into court here right now. And then I don't know that I can make a determination if you don't agree on this thing ... I think you either have a settlement or you don't.
McKay had many avenues open to her, none of which she chose to pursue. Where, as here, the client knows of the claim for legal malpractice before settlement occurs, but deceives the court by accepting the settlement, he or she will not be permitted to benefit from that deception. Accordingly, we affirm the district court's application of judicial estoppel in this case.

B. In Performing His Duties As Guardian Ad Litem Pursuant To Idaho Code Section 5-306, Manweiler Was Acting As An Arm Of The Court And Is Therefore Protected By The Doctrine Of Quasi-Judicial Immunity.
Manweiler also argues that because a guardian ad litem acting under I.C. § 5-306 is an arm of the court, the guardian should be granted quasi-judicial immunity status. We have not previously considered this question in Idaho, but we note that the "arm of the court" analysis stems from an analysis employed by the United States Supreme Court. That Court stated that it has "applied a `functional approach'... which looks to `the nature of the function performed, not the identity of the actor who performed it.'" Buckley v. Fitzsimmons, 509 U.S. 259, 269, 113 S.Ct. 2606, 2613, 125 L.Ed.2d 209 (1993) (citations omitted). Therefore, the question becomes whether a guardian ad litem, acting under I.C. § 5-306, is functioning as an arm of the court.
The district court found that:
The guardian ad litem in Barr [v. Day, 124 Wash.2d 318, 879 P.2d 912 (1994)] performed the same functions that Mr. Manweiler performed in the underlying case here. The Washington court specifically held that `guardians ad litem in guardianship proceedings involving court approval of settlements of civil claims of incompetents act as an arm of the court, and are therefore entitled to quasi-judicial immunity from civil liability.' Id. 879 P.2d at 919.
Applying the analysis of Barr, the district court determined that the doctrine of quasi-judicial immunity applied in this case.
Federal jurisdictions have considered the quasi-judicial immunity issue as well, generally in the context of a custody dispute. The First, Eighth, and Sixth Circuits have extended absolute immunity to guardians involved in custody disputes and investigations of sexual abuse. Cok v. Cosentino, 876 F.2d 1, 3 (1st Cir.1989); Myers v. Morris, 810 F.2d 1437, 1467 (8th Cir.1987) (holding that "[t]he absolute immunity which is accorded persons acting as an integral part of the judicial process protects them from having to litigate the manner in which they performed their delegated functions."); Kurzawa v. Mueller, 732 F.2d 1456, 1458 (6th Cir.1984).
Several states have extended immunity to guardians in custody battles. Missouri noted that "at least in custody matters, the guardian ad litem has traditionally been viewed as functioning as an agent or arm of the court, to which it owes its principal duty of allegiance, and not strictly as legal counsel to a child client." State ex rel. Bird v. Weinstock, 864 S.W.2d 376, 384 (Mo.App. 1993). Further, the court found it important that the court is not bound by the guardian's recommendation. Id. at 385. See also Delcourt v. Silverman, 919 S.W.2d 777, 785 (Tex.App.1996) (holding that a guardian in a custody battle was entitled to judicial immunity, because the guardian's duty was to make impartial recommendations to the court). Several courts have also noted that if the guardian is compensated from the ward's resources, it makes it more likely that he is functioning in a manner similar to a private attorney. Delcourt, 919 S.W.2d at 786.
*1231 We are mindful that a rule by which guardian ad litem immunity under I.C. § 5-306 is determined on a case-by-case basis could lead to second-guessing, a hindsight analysis, and a chilling effect on the willingness of qualified individuals to serve as guardians. Therefore, while we will employ the functional analysis advocated by the United States Supreme Court, we will also avoid rules which would permit immunity to turn on the often fine-line distinctions between being an advocate or being a functionary of the court.
I.C. § 5-306, under which Manweiler was appointed, provides that:
When an infant or an insane or incompetent person is a party, he must appear either by his general guardian or by a guardian ad litem appointed by the court in which the action is pending in each case, or by a judge thereof, or a probate judge. A guardian ad litem may be appointed in any case when it is deemed by the court in which the action or proceeding is prosecuted, or by a judge thereof, expedient, to represent the infant, insane or incompetent person in the action or proceeding, notwithstanding he may have a general guardian and may have appeared by him.
Although I.C. § 5-306 states that the guardian is appointed to "represent" the infant, insane or incompetent person, that term is ambiguous. It may mean "in place of," or it may mean "on behalf of." See State ex rel Bird, 864 S.W.2d at 385. Therefore, the fact that "represent" appears in the statute is not dispositive.
In its summary judgment decision in the legal malpractice action, the district court stated that Manweiler acted as a guardian prior to his actual appointment, and was appointed nunc pro tunc at the minor's compromise hearing. That would militate against Manweiler being an arm of the court. In addition, Manweiler was ultimately paid from the proceeds of the settlement. However, there are also facts which show that he was acting as an arm of the court.
Using the functional analysis employed by the United States Supreme Court, the guardian's duty under I.C. § 5-306 is to consider all of the alternatives and give its recommendation to the Court based on what will be best for the ward. Therefore, the guardian can be seen as an "agent of the court." See Short by Oosterhous v. Short, 730 F.Supp. 1037, 1038 (D.Colo.1990) (discussing guardians in the child custody context). That function was amply illustrated in this case. Manweiler told the court that he thought that the settlement, as previously outlined, was fair to Daniel, particularly given the uncertainties of the case.
It is also important to note that Daniel's interests were represented by two attorneys: Henry Houst and Bruce Owens. If the settlement was not satisfactory, it was the duty of Houst and Owens to inform the court, and advocate a different position for Daniel. Manweiler's duty was to examine the settlement and facts of the case for the court and act as advisor to and as an arm of the court.
Although I.C. § 5-306 itself, and the proceedings below, do not provide a clear-cut answer to the issue, the policies behind quasi-judicial immunity lead us to the conclusion that guardians under I.C. § 5-306 should be given absolute quasi-judicial immunity. The Minnesota Supreme Court noted that although a guardian may even act as an advocate to some degree, quasi-judicial immunity is not inappropriate. Specifically, that court held that:
A guardian ad litem is an officer of the court. The guardian's duty is to act within the course of that judicial proceeding in furtherance of the best interests of the child for whom the guardian has been appointed. A guardian must be free, in furtherance of the goal for which the appointment was made, to engage in a vigorous and autonomous representation of the child. Immunity is necessary to avoid harassment from disgruntled parents who may take issue with any or all of the guardian's actions.
Tindell v. Rogosheske, 428 N.W.2d 386, 387 (Minn.1988) (citations omitted). Similarly, although written in the context of a custody dispute, the United States District Court for the District of Colorado stated that:
[t]o safeguard the best interests of the children, [], the guardian's judgment must *1232 remain impartial, unaltered by the intimidating wrath and litigious penchant of disgruntled parents. Fear of liability ... can warp judgment that is crucial to vigilant loyalty for what is best for the child; the guardian's focus must not be diverted to appeasement of antagonistic parents.
Short, 730 F.Supp. at 1039. Further, qualified attorneys might be unwilling to represent a child if "disgruntled or vituperative parents could hold the guardian ad litem personally responsible." Delcourt, 919 S.W.2d at 785.
That policy applies to guardians acting under I.C. § 5-306, who are appointed to represent the child. The guardian must act in the best interest of the child, not the parents. This case well illustrates the principle. Manweiler testified that, based upon his experience and after reviewing the settlement information, the compromise was in Daniel's best interests. It is absolutely essential that guardians are free to make such a determination, without fear that a parent, seeking a larger award or settlement amount, will later sue the guardian for legal malpractice. Therefore, we hold that guardians ad litem, appointed under I.C. § 5-306, operate under the cloak of absolute quasi-judicial immunity.
We note, however, that granting quasi-judicial immunity to a guardian does not leave the parties without recourse. The attorney-guardian is still subject to the Idaho Rules of Professional Conduct. Further, a court may remove the guardian if he or she is not performing his or her duties, and may also reject the guardian's recommendations. In addition, the parents may certainly take a position contrary to that of a guardian, and may seek appeal of an adverse position. McKay was well within her rights when she objected to Manweiler's appointment prior to the compromise hearing, and could have sustained that objection at the hearing. Finally, she could have maintained her objection to the settlement, as could her attorney. See State ex rel. Bird, 864 S.W.2d at 386. However, she did not exercise any of those options, and cannot now sue Manweiler, who is protected by absolute quasi-judicial immunity.

C. The Trial Court Did Not Err In Awarding Costs As A Matter Of Right Under I.R.C.P. 54(d)(1) And Attorney Fees As A Sanction Under I.R.C.P. 11.
McKay argues that the trial court's award of attorney fees under I.R.C.P. 54(e)(1) and I.C. § 12-121 should be reversed. However, the court did not award attorney fees under those provisions. Instead, it awarded attorney fees and computer-aided research costs as a sanction under I.R.C.P. 11. In so doing, the district court stated:
Before filing the First Amended Complaint, Plaintiffs' counsel had available to them, if they did not in fact possess, the transcript of the minor's compromise hearing and the pleadings of that action which included the written objection to the settlement, filed by Attorney Ellis, and the affidavit of Ms. McKay. By designating Attorney Ellis an expert in this action and by submitting an affidavit from him admitting he advised Ms. McKay to misrepresent herself to the Magistrate, Plaintiffs' counsel demonstrate they were aware of Attorney Ellis' misrepresentations, endorsed them and relied on them in pursuing this action. Such conduct is not reasonable under the circumstances and warrants Rule 11 sanctions.
We review an imposition of I.R.C.P. 11 sanctions for abuse of discretion. Sun Valley Shopping Ctr., Inc. v. Idaho Power Co., 119 Idaho 87, 94, 803 P.2d 993, 1000 (1991). I.R.C.P. 11 states that if an attorney signs a pleading, motion or other paper, the signature certifies that "to the best of the signer's knowledge, information, and belief after reasonable inquiry it is well grounded in fact and is warranted by existing law or a good faith argument" for a change in the law.
In this case, Lee and Gould had Ellis' affidavit in which he admitted that he "advised plaintiff Robynne McKay to withdraw her objection to the proposed minor's compromise in order to mitigate her damages as required by law prior to her bring [sic] malpractice and breach of fiduciary duty claims." Similarly, McKay admitted in an affidavit *1233 that she withdrew her objections "such that Daniel would receive as much as possible from the defendant hospital St. Luke's and the defendant doctor...." Even in the face of those admissions by both Ellis and McKay that they deliberately misled the magistrate judge in the minor's compromise hearing, Lee and Gould still filed the legal malpractice action, on the basis that McKay never really agreed to the settlement.
Such a case, based upon deliberate misstatements to a court of law, is not well grounded in fact or law, and the trial court's imposition of attorney fees and computer-aided research costs as a sanction under I.R.C.P. 11 was not an abuse of discretion.
McKay also argues that the award of discretionary costs should be reversed. However, the trial court awarded no discretionary costs. The only costs awarded were costs as a matter of right as the prevailing party under I.R.C.P. 54(d)(1). Since McKay does not appeal the imposition of those costs, we affirm that decision of the trial court.

D. Owens And Manweiler Are Entitled To Their Costs And Attorney Fees On Appeal.
Manweiler requests attorney fees on appeal pursuant to I.A.R. 41 and I.R.C.P. 11, while Owens requests attorney fees under I.A.R. 41, I.R.C.P. 11, and I.C. § 12-121, and costs under I.A.R. 40. Because this case was brought based upon deliberate misstatements to a court of law by both the litigant and her counsel acting in concert, we are left with the "abiding belief that the appeal has been brought or defended frivolously, unreasonably, or without foundation." Durrant v. Christensen, 117 Idaho 70, 74, 785 P.2d 634, 638 (1990). Therefore, pursuant to I.A.R. 41, we award attorney fees to the Respondents on appeal. Further, we award the Respondents their costs on appeal as the prevailing party under I.A.R. 40.

V.

CONCLUSION
Attorney Allen Ellis not only condoned but encouraged Robynne McKay to deliberately lie to and deceive the magistrate court about McKay's approval of the minor's compromise. Because McKay stated under oath that she was in agreement with the settlement, she is judicially estopped from now stating the directly opposite proposition. Further, Howard Manweiler, as a guardian ad litem acting under I.C. § 5-306, was acting as advisor to and arm of the court, and is therefore granted absolute quasi-judicial immunity.
In addition, we uphold the I.R.C.P. 11 sanctions and award of costs as a matter of right, and award costs and attorney fees to Manweiler and Owens on appeal.
JOHNSON and SCHROEDER, JJ., and WOOD, J. Pro Tem, concur.
McDEVITT, J., concurs in the result.
