
952 A.2d 511 (2008)
402 N.J. Super. 7
James FEIGENBAUM, Sam Feigenbaum and Syma Feigenbaum Testamentary Trust, Plaintiffs,
v.
Frank GUARACINI, Jr., and Elizabeth Guaracini, Defendants/Third-Party Plaintiffs-Respondents, and
Wakefern Food Corp., Defendant/Third-Party Plaintiff-Appellant,
v.
Vineland Supermarket, Inc., and The Estate of Jay Daunoras, Third-Party Defendants.
Docket No. A-0338-06T5
Superior Court of New Jersey, Appellate Division.
Argued April 14, 2008.
Decided July 29, 2008.
*514 Edward T. Kole, argued the cause for appellant (Wilentz, Goldman & Spitzer, P.C., attorneys; Mr. Kole, of counsel and on the brief, Woodbridge; M. Matthew Mannion and Kristen Benedetto, on the brief).
William J. Martin, Westmont, argued the cause for respondents (Martin, Gunn & Martin, attorneys; Mr. Martin, on the brief).
Before Judges PARRILLO, S.L. REISNER and GILROY.
The opinion of the court was delivered by
GILROY, J.A.D.
This appeal arises out of a commercial lease of a 25,200 square foot store (the Property) in the Lincoln Shopping Center, in Vineland. Defendant/third-party plaintiff, Wakefern Food Corp., appeals from two August 4, 2006 orders of the Law Division, which: 1) granted summary judgment in favor of defendants Frank Guaracini, Jr., and Elizabeth Guaracini (the Guaracinis), in the amount of $30,000; and 2) denied its motion for summary judgment against the Guaracinis.
This commercial landlord-tenant matter requires us to analyze the law of suretyship, guaranty, indemnification and equitable subrogation. Based on that analysis, we conclude that the trial court mistakenly exercised its discretion in applying equitable subrogation to hold Wakefern liable to the Guaracinis. Accordingly, we reverse.
Plaintiffs James Feigenbaum, Sam Feigenbaum, and the Syma Feigenbaum Testamentary Trust (collectively, the Feigenbaums) are the owners of the Lincoln Shopping Center. On August 19, 1996, the Feigenbaums entered into a lease agreement with Frank Guaracini, Jr. Supermarkets, Inc. (GSI), whereby GSI agreed to lease the Property to use as a supermarket for a term of ten years.[1] Pursuant to the lease, GSI was obligated to pay a fixed rent of $7,500 per month, together with a payment proportionate to its share of all: (a) real estate taxes; (b) common area maintenance costs; and (c) fire and extended coverage insurance premiums. The lease did not impose an obligation on GSI to pay the Feigenbaums' legal expenses and costs, if the Feigenbaums instituted legal proceedings to enforce the terms of the lease on default of GSI; except, under Paragraph 15 of the lease, GSI agreed to pay the Feigenbaums reasonable legal fees and other expenses incurred by the Feigenbaums in obtaining possession of the Property, an exception not applicable to this matter.
On the same day the lease was executed, the Guaracinis executed a separate document, unconditionally guaranteeing to the Feigenbaums GSI's performance under the lease (the Guaranty). The Guaranty provided that it was a continuing obligation, that is, it would remain in effect and bind the Guaracinis during the full term of the lease. The Guaranty also provided that the Guaracinis would pay the Feigenbaums, on demand, all costs and expenses, including reasonable legal fees and disbursements that may be incurred by the Feigenbaums in enforcing either GSI's obligations under the lease, or the *515 Guaracini's obligations under the Guaranty.
On May 19, 1998, GSI assigned the lease to Wakefern. Under the assignment, Wakefern agreed to indemnify GSI against any claims or damages, including "reasonable legal fees and disbursements," arising from its default under the lease; however, Wakefern did not agree to indemnify the Guaracinis personally. On December 23, 1998, with the consent of the Feigenbaums, Wakefern reassigned the lease to third-party defendant Vineland Supermarket, Inc. Under the assignment, Vineland agreed to indemnify Wakefern and its predecessor in interest, GSI, from and against any claims or damages, including reasonable legal fees and disbursements, arising from Vineland's failure to perform under the lease. Vineland's sole shareholder, Jay Daunoras, personally guaranteed a portion of Vineland's obligations to Wakefern.[2]
In July 2003, Vineland failed to pay the monthly rent. On March 2, 2004, the Feigenbaums filed their complaint, seeking all monies due under the lease against the Guaracinis and Wakefern. Each defendant filed an answer, not only asserting cross-claims for contribution or indemnification against each other, but also third-party complaints against Vineland and Daunoras.[3]
On completion of discovery, the Feigenbaums, the Guaracinis, and Wakefern cross-moved for summary judgment. The Feigenbaums claimed that the Guaracinis were primarily liable as guarantors of the lease, and Wakefern was liable as assignee of the lease from GSI. The Feigenbaums estimated their damages through August 31, 2006, at $616,815.66, which included projected attorneys' fees and costs through trial in the sum of $32,113.95.
On April 20, 2006, the trial judge entered two orders supported by a written decision, which: 1) granted the Feigenbaums partial summary judgment on liability only against Wakefern for its breach of the lease, but denied the Feigenbaums' motion against the Guaracinis; and 2) denied the Guaracinis' cross-motion against the Feigenbaums. On May 11, 2006, the judge entered a third order, which granted Wakefern partial summary judgment, directing that Vineland indemnify Wakefern for any and all liability or judgments that may be entered against it, and that Daunoras's Estate indemnify Wakefern for any and all liability or judgments that may be entered against Wakefern in an amount equal to 50% of the balance of the base rent due under the lease.
On June 2, 2006, the Guaracinis settled with the Feigenbaums for $30,000. However, the Guaracinis continued to assert their cross-claims against Wakefern, seeking to recoup the $30,000 paid to the Feigenbaums. On June 5, 2006, the morning of trial, after the Feigenbaums advised that they were no longer pursuing their claim for attorneys' fees and costs, Wakefern settled with the Feigenbaums for $500,000. On June 22, 2006, the Feigenbaums executed a general release in favor of the Guaracinis. The Guaracinis and Wakefern next filed a second round of cross-motions for summary judgment.
*516 On August 4, 2006, the trial judge granted the Guaracinis summary judgment against Wakefern in the amount of $30,000, determining that the Guaracinis were entitled to equitable subrogation against Wakefern; and denied Wakefern's cross-motion. In granting partial summary judgment to the Guaracinis, the judge stated in relevant part:
These are cross-motions for summary judgment concerning the issue of . . . liability as claimed on the part of the Guaracinis [for] reimbursement by Wakefern of the $30,000 that they paid to the plaintiffs in settlement of the default of contract in which the Guaracinis  these parties were guarantors of a corporation's lease obligations with the plaintiff[s], which lease obligations were in turn, assigned to defendant, Wakefern Food Corporation and, in fact, those lease obligations were, in turn, assigned [to Vineland Supermarket]. The matter was settled.
Wakefern being the assignee of the Guaracini [Supermarket], which no longer was solvent, and . . . Wakefern had assumed that obligation. The facts are, that in turn they assumed the [lease and then]  they assigned the lease to another party which defaulted. The Guaracini individuals, [guaranteed] . . . the Guaracini [Supermarket's] obligation, and . . . now seek reimbursement of the $30,000 damages that they paid to the plaintiff[s] in settlement of the suit.
The Guaracinis could have sought, if it were a viable entity . . . reimbursement from the entity they were guaranteeing, the [Guaracini Supermarket]. And, it could [have] for that matter, although contested by Wakefern, [sought] reimbursement from an assignee of the corporate entity which they were guarantor for and for which they paid $30,000.
The defaulting parties were down the line as we know in this matter. Wakefern was a defaulting party because their assignee was a defaulting party. Wakefern paid in settlement the . . . amount of $500,000 to the plaintiffs, the Feigenbaums, who are the landlords and the Guaracini individuals paid the $30,000.
Wakefern says, however, that was an obligation of which Wakefern, or its successor, had no obligation  that that was strictly a matter of the [G]uaranty itself. Certainly, the Guaracinis could look to the Guaracini [Supermarket] for that reimbursement, and [its] assignees [who] were defaulting parties. Wakefern may not have been the immediate defaulting party, but their assignee was a defaulting party.
Whether the $30,000 was for strictly attorneys' fees of plaintiffs, or general damages [is] a distinction without a difference[.] [The] Guaracinis, the guarantors, are  are entitled to reimbursement from the defaulting party. And that would be true whether it was Guaracini [Supermarket] . . . or an assignee of that party, in this case, Wakefern.
And, for those reasons, the defendant, Guaracinis, and yes, no doubt it's on a theory of subrogation, but it's a viable theory that is not excluded because it's a new theory. The facts are the same throughout this litigation, so I am going to grant the motion of [the] Guaracinis for summary judgment against Wakefern for the $30,000 reimbursement of their damages paid to plaintiff, Feigenbaum, and consequently I'm denying Wakefern's motion for summary judgment. . . .
[(Emphasis added).]
On appeal, Wakefern argues: 1) the trial judge erred by not dismissing the Guaracinis' cross-claim for indemnification because *517 there was no contractual obligation of Wakefern to indemnify the Guaracinis, and common law indemnification is not applicable to contract disputes; 2) the Guaracinis failed to prove that they were entitled to recover the $30,000 they paid to the Feigenbaums because the Guaracinis failed to demonstrate that: a) they were liable on the Feigenbaums' claim; b) the $30,000 settlement was reasonable; and c) the settlement had reduced the Feigenbaums' claim against Wakefern because they only settled the attorneys' fee claim, for which Wakefern was not obligated; 3) the trial judge erred in granting summary judgment to the Guaracinis because the Guaracinis' equitable subrogation claim had not been asserted prior to the motion; 4) suretyship law was not applicable because the Guaracinis were guarantors, not sureties; and 5) the trial judge misapplied the theory of equitable subrogation because the equities favor Wakefern, not the Guaracinis.
We agree that the trial judge erred as a matter of law in granting summary judgment to the Guaracinis and in denying Wakefern's cross-motion. Accordingly, we need not address Wakefern's procedural argument that the Guaracinis had failed to plead equitable subrogation prior to raising the claim for the first time on its second motion for summary judgment.
A trial court will grant summary judgment to the moving party "if the pleadings, depositions, answers to interrogatories and admissions on file, together with the affidavits, if any, show that there is no genuine issue as to any material fact challenged and that the moving party is entitled to a judgment or order as a matter of law." R. 4:46-2(c); see also Brill v. Guardian Life Ins. Co. of Am., 142 N.J. 520, 523, 666 A.2d 146 (1995). "An issue of fact is genuine only if, considering the burden of persuasion at trial, the evidence submitted by the parties on the motion, together with all legitimate inferences therefrom favoring the non-moving party, would require submission of the issue to the trier of fact." R. 4:46-2(c).
On appeal, "the propriety of the trial court's order is a legal, not a factual, question." Pressler, Current N.J. Court Rules, comment 3.2.1 on R. 2:10-2 (2008). "We employ the same standard that governs trial courts in reviewing summary judgment orders." Prudential Prop. & Cas. Ins. Co. v. Boylan, 307 N.J.Super. 162, 167, 704 A.2d 597 (App.Div), certif. denied, 154 N.J. 608, 713 A.2d 499 (1998).
The trial judge granted summary judgment to the Guaracinis under the principle of equitable subrogation. "[D]ecisions concerning [the application of an equitable doctrine] ordinarily are left to the sound discretion of the trial court. `An appellate court should not substitute its judgment for that of the trial judge unless there is a showing of clear abuse of that discretion.'" Kurzke v. Nissan Motor Corp. in U.S.A., 164 N.J. 159, 165, 752 A.2d 708 (2000) (quoting Civic S. Factors Corp. v. Bonat, 65 N.J. 329, 333, 322 A.2d 436 (1974)). However, a violation of the standard "arises when a decision is `made without a rational explanation, inexplicably depart[s] from established policies, or rest[s] on an impermissible basis.'" Flagg v. Essex County Prosecutor, 171 N.J. 561, 571, 796 A.2d 182 (2002) (quoting Achacoso-Sanchez v. Immigration and Naturalization Serv., 779 F.2d 1260, 1265 (7th Cir.1985)).
To determine whether the doctrine of equitable subrogation was properly applied against Wakefern, we first examine the relationship of the parties on appeal to each other; to GSI; and to the Feigenbaums. Because the relationships among the parties vary, we address each of the principles of indemnification, guaranty, *518 and suretyship. Each concerns an agreement, whereby one party assumes the obligation to reimburse another party or to protect the other party from loss, under certain defined circumstances.
There are three parties to a suretyship contract: (1) "an obligee who is owed a debt or duty;" (2) "a primary obligor, who is responsible for the payment of the debt or performance of the duty;" "and [(3)] a secondary obligor, or surety, who agrees to answer for the primary obligor's debt or duty." Cruz-Mendez v. ISU/Ins. Servs., 156 N.J. 556, 568, 722 A.2d 515 (1999). Under the suretyship contract, the surety assumes a direct and primary obligation. Id. at 569, 722 A.2d 515. Accordingly, "[a]n obligee may bypass the primary obligor and enforce the obligation directly against the surety." Id. at 568, 722 A.2d 515.
A guaranty contract is similar to that of a suretyship contract because "[u]nder a guaranty contract, the guarantor, in a separate contract with the obligee, promises to answer for the primary obligor's debt on the default of the primary obligor." Ibid.; see also Fengya v. Fengya, 156 N.J.Super. 340, 345, 383 A.2d 1170 (App.Div.1978) (quoting 1 Couch on Insurance, § 1:55 (2d ed. 1966)). However, although similar in concept, the two forms of contract differ because in a suretyship contract the obligee has "[t]he availability of a direct action against a secondary obligor," Cruz-Mendez, supra, 156 N.J. at 568, 722 A.2d 515, whereas under a contract of guaranty, he or she does not.
Contracts of indemnification differ from contracts of suretyship and guaranty. The primary distinction is that under a contract of indemnity, "the promissor undertakes to protect the promissee against loss or liability to a third person, whereas [under contracts of guaranty or suretyship, the] undertaking is to protect the promissee from the acts of a third person." Fengya, supra, 156 N.J.Super. at 345, 383 A.2d 1170 (quoting 1 Couch on Insurance, supra, § 1:55). Another difference "is that the promise in an indemnity contract is an original and not a collateral undertaking, while a contract of guaranty is a secondary and not a primary obligation, and can exist only where there is some principle or substantive liability to which it is collateral." Ibid. "The absence of the relationship between the obligee and the secondary obligor distinguishes a contract of indemnity from one of guaranty." Cruz-Mendez, supra, 156 N.J. at 568, 722 A.2d 515.
We determine that the Guaracinis entered into a contract of guaranty with the Feigenbaums. The Feigenbaums contracted to lease the Property to GSI. On the same day that the lease agreement was executed, the Guaracinis entered into a separate contract with the Feigenbaums to answer for GSI's default on the lease. Ibid. However, unlike the Guaracinis, Wakefern did not enter into a guaranty agreement, but rather into an indemnification agreement with GSI only.
Wakefern entered into an assignment of lease for the Property with GSI, and assumed all of the rights and duties of GSI under the lease. The assignment contained a provision whereby Wakefern agreed to indemnify and hold GSI harmless from and against any damages that GSI only may suffer as a consequence of Wakefern's breach of the lease. Because Wakefern's obligation ran only to GSI, not to the Feigenbaums or the Guaracinis, and because Wakefern undertook to protect GSI only against loss or liability to a third-person, Wakefern's obligation was that of an indemnitor. Fengya, supra, 156 N.J.Super. at 345, 383 A.2d 1170. The issue remains whether these relationships *519 permit the Guaracinis to recover from Wakefern under the doctrine of equitable subrogation.
Subrogation is "`[t]he substitution of one person in the place of another with reference to a lawful claim, demand or right, so that he who is substituted succeeds to the rights of the other in relation to the debt or claim, and its rights, remedies or securities.'" Hanover Ins. Co. v. Borough of Atl. Highlands, 310 N.J.Super. 599, 603, 709 A.2d 328 (Law Div.1997) (quoting Black's Law Dictionary (5th Ed. 1979)), aff'd, 310 N.J.Super. 568, 709 A.2d 236 (App.Div.), certif. denied, 156 N.J. 383, 718 A.2d 1212 (1998). The principle is an equitable device intended "to compel the ultimate discharge of an obligation by the one who in good conscience ought to pay it." Standard Acc. Ins. Co. v. Pellecchia, 15 N.J. 162, 171, 104 A.2d 288 (1954). The doctrine "promote[s] `essential justice' between the parties." Hayes v. Pittsgrove Twp. Bd. of Educ., 269 N.J.Super. 449, 454-55, 635 A.2d 998 (App.Div.1994) (quoting Culver v. Ins. Co. of N. Am., 115 N.J. 451, 456, 559 A.2d 400 (1989)).
Nevertheless, "a subrogee's rights can rise no higher than those of the subrogor." Id. at 455, 635 A.2d 998. "As the right of subrogation turns on the obligation or duty that the third party itself owes the subrogor, subrogation is wholly dependent on the merits of the subrogor's claim against the third party." Holloway v. State, 125 N.J. 386, 396, 593 A.2d 716 (1991). Moreover, "[t]he subrogee, [who] succeeds to the position of the subrogor, may recover only if the subrogor likewise could have recovered; the subrogee gains no additional rights and is subject to all defenses that were available to the subrogors." Ibid.
Subrogation rights may be created in three different ways: "(1) by agreement; (2) by statute; or (3) judicially as an equitable device to compel the ultimate discharge of an obligation by the one who should in good conscience pay it." First Union Nat'l Bank v. Nelkin, 354 N.J.Super. 557, 565, 808 A.2d 856 (App. Div.2002) (citing Culver, supra, 115 N.J. at 456, 559 A.2d 400). The doctrine of equitable subrogation should not be imposed "`where its enforcement would be inconsistent with the terms of a contract or when the contract, either expressly or by implication, forbids its application.'" Culver, supra, 115 N.J. at 456, 559 A.2d 400 (quoting Ganger v. Moffett, 8 N.J. 73, 80, 83 A.2d 769 (1951)). Equitable subrogation may only be imposed "if the cause is just and enforcement is consonant with right and justice." Standard Acc. Ins., supra, 15 N.J. at 173, 104 A.2d 288.
As stated, subrogation rights may be created in three ways: by agreement, by statute, or by judicial means. The first two methods are not applicable. There was no contractual relationship, either oral or written, between Wakefern and the Guaracinis, nor did the Guaracinis possess a statutory basis for subrogation. Accordingly, the only means which could justify subrogation is that of "a judicial `device of equity to compel the ultimate discharge of an obligation by the one who in good conscience ought to pay it.'" Culver, supra, 115 N.J. at 456, 559 A.2d 400 (quoting Aetna Ins. Co. v. Gilchrist Bros., Inc., 85 N.J. 550, 560, 428 A.2d 1254 (1981)).
We conclude that the trial judge mistakenly granted the Guaracinis the right of equitable subrogation against Wakefern for several reasons. First, the record does not contain evidence that Wakefern knew of the Guaracinis' guaranty to the Feigenbaums when Wakefern contracted with GSI to accept the assignment of the lease. The lease assignment only bound Wakefern to indemnify GSI for *520 damages caused by a default under the lease. The Guaracinis, the owners of GSI, had the opportunity to negotiate from Wakefern a promise to indemnify them from any demand by the Feigenbaums on their personal Guaranty, including the obligation to pay attorneys' fees and costs. Yet, they failed to do so.
That failure, together with the absence of proof of Wakefern's awareness of the Guaracinis' guaranty to the Feigenbaums, precludes the Guaracinis from seeking reimbursement of monies paid in settlement under the principle of equitable subrogation. Because Wakefern only assumed a duty to GSI and there is no evidence that it was aware of the Guaracinis' guaranty, we concluded that it would be contrary to fundamental fairness to compel Wakefern to reimburse the Guaracinis. See Graziano v. Grant, 326 N.J.Super. 328, 342, 741 A.2d 156 (App.Div.1999) ("[A] court of equity has a broad range of discretion to fashion the appropriate remedy," but "it is not the function of the court to make a better contract for the parties, or to supply terms that have not been agreed upon.").
Secondly, the judge mistakenly failed to adhere to the purpose of equitable subrogation when he ordered Wakefern to reimburse the Guaracinis. The doctrine is only appropriately imposed against the "one who in good conscience ought to pay" the debt. Here, Vineland was the primary defaulting party, and as such, was the party who ought to have paid. Unfortunately, Vineland is no longer a viable entity.
Moreover, although not determinative of the issue on appeal, we question whether the $30,000 paid in settlement by the Guaracinis represented reimbursement of attorneys' fees and expenses owed under the Guaranty, rather than general rent damages under the lease.[4] If the former, Wakefern would not be liable to the Guaracinis. The Guaracinis' right of subrogation against Wakefern depends on the merits of the Feigenbaums' claim against Wakefern, and that claim is subject to all defenses which Wakefern had against any claims of the Feigenbaums. Holloway, supra, 125 N.J. at 396, 593 A.2d 716. Here, the Feigenbaums did not have a direct claim against Wakefern for attorneys' fees and expenses for a breach of the lease. The Feigenbaums' only claim for attorneys' fees and expenses was against the Guaracinis under the Guaranty. Accordingly, the Guaracinis did not succeed to a right of subrogation to recoup any monies paid to the Feigenbaums for attorneys' fees and costs against Wakefern.
The Guaracinis argue that Wakefern's acceptance of the lease assignment dissolved the Guaracinis' relationship with GSI and created in its place a new relationship among the Feigenbaums, the Guaracinis, and Wakefern. The Guaracinis contend that under this new relationship the Feigenbaums remained the obligee; Wakefern became the principal obligor; and they became the secondary obligors. The Guaracinis assert that under the Restatement (Third) of Suretyship and Guaranty: Incidents of Suretyship Status § 20, 22 (1995), that as secondary obligors *521 they possessed the right of subrogation against the principal obligor. We disagree.
Even assuming the validity of the Guaracinis' argument that Wakefern's assumption of the lease placed Wakefern in the same position as GSI to the Guaracinis, the Restatement does not hold a primary obligor liable to a secondary obligor, unless the primary obligor has notice of the secondary obligation. Ibid. Here, the record is devoid of any evidence that Wakefern had actual notice of the Guaracinis' Guaranty to the Feigenbaums. Because there is no evidence of such notice, Wakefern does not have a duty to reimburse the Guaracinis. Restatement (Third) of Suretyship and Guaranty, supra, § 22.
Because we conclude that the Guaracinis did not have the right of equitable subrogation against Wakefern to recoup the $30,000 paid in settlement to the Feigenbaums, we: 1) reverse the two orders of August 4, 2006, which granted summary judgment in favor of the Guaracinis in the amount of $30,000 and denied Wakefern's motion for summary judgment; and 2) exercise original jurisdiction and enter summary judgment in favor of Wakefern.
Reversed.
NOTES
[1]  Abe Feigenbaum and the Syma Feigenbaum Testamentary Trust were the original landlords under the lease. In the fall of 2004, Abe Feigenbaum transferred his ownership interest in the shopping center to James Feigenbaum and Sam Feigenbaum.
[2]  Daunoras's guaranty defines the term "obligations" as meaning "an amount equal to fifty (50%) percent of the balance of Base Rent due under the Lease at the time of a default thereunder payable as due. The obligations shall be reduced by fifty (50%) percent of any Base Rent received in mitigation from a third party."
[3]  After Daunoras died on October 19, 2005, Wakefern amended its third-party complaint to substitute the Estate of Jay Daunoras as a third-party defendant.
[4]  Because we conclude that the Guaracinis were not entitled to equitable subrogation against Wakefern as a matter of law, we need not remand the matter to the trial court to determine whether the settlement monies paid by the Guaracinis to the Feigenbaums represented the settlement of the Feigenbaums' claim for attorneys' fees and costs. However, the record contains evidence that it did. Plaintiffs' demand for attorneys' fees through trial were projected at $32,113.95; and the Guaracinis paid $30,000 to the Feigenbaums, after which the Feigenbaums immediately advised the parties that they were no longer pursuing their claims for attorneys' fees and costs.
