
97 Cal.Rptr.2d 374 (2000)
81 Cal.App.4th 1082
MARYLAND CASUALTY COMPANY et al., Cross-complainants and Respondents,
v.
NATIONWIDE MUTUAL INSURANCE COMPANY, Cross-defendant and Appellant.
National Union Fire Insurance Company of Pittsburgh, Pennsylvania et al., Cross-complainants and Respondents,
v.
Nationwide Mutual Insurance Company, Cross-defendant and Appellant.
Nos. D032972, D033116.
Court of Appeal, Fourth District, Division One.
June 6, 2000.
Rehearing Denied June 27, 2000.
Review Denied September 13, 2000.
*375 Daniels, Baratta & Fine and Lance Orloff, Los Angeles, for Cross-defendant and Appellant.
Branson, Brinkop, Griffith & Strong and John H. Podesta, for Cross-complainant and Respondent National Union Fire Insurance Company of Pittsburgh, Pennsylvania.
Haight, Brown & Bonesteel, Robert V. Closson and Terrell A. Quealy, San Diego, for Cross-complainant and Respondent Maryland Casualty Company.
HALLER, Acting P.J.
This case involves the allocation of defense costs among insurerstwo of which paid for the insured's defense (Maryland Casualty Company and National Union Fire Insurance Company) and one of which did not (Nationwide Mutual Insurance Company). The court shifted the entire defense burden to Nationwide under equitable subrogation principles. We conclude the court erred because the equitable contribution doctrine, not subrogation, *376 applies. We reverse and remand for the court to equitably allocate defense costs among these insurers.

FACTS[1]
Nielsen Construction Company, a general contractor, was hired to build a residential development. Nielsen retained numerous subcontractors to assist on the project, including West Coast Sheet Metal Inc. (West Coast) and R.W. Strang Mechanical, Inc. (Strang). The subcontract agreements required West Coast and Strang to name Nielsen "as an additional named insured and ... provide[ ] specifically that such policies are primary and non-contributing with any other insurance carried or available to [Nielsen]."
Pursuant to these agreements, West Coast and Strang obtained liability insurance coverage from Nationwide and purchased additional insured endorsements. The endorsements stated that Nielsen was an insured under the policy "but this insurance with respect to [Nielsen] applies only to the extent that [Nielsen] is held liable for your acts or omissions arising out of and in the course of operations performed for [Nielsen]...." The West Coast endorsement also contained the following typewritten language in capitalized letters: "`Coverage provided to the additional insured under this endorsement is primary, but only with respect to acts or omissions of the named insured. Any other insurance maintained by the additional insured is deemed to be excess.'"
Nielsen was also insured under its own commercial general liability policies issued by respondents Maryland and National Union. Although those policies are not part of the appellate record, it is undisputed these policies, as purchased by Nielsen, were primary policies.[2]
When the homeowners association sued Nielsen for construction defects, Nielsen tendered defense of the action to its own insurers (Maryland and National Union), and to each of the subcontractor insurers under the additional insured endorsements. Maryland and National Union ultimately paid for Nielsen's defense in the action.
Maryland and National Union brought claims against each subcontractor insurer for recovery of the defense costs under equitable subrogation and equitable contribution theories, asserting the subcontractor insurers were primarily responsible for Nielsen's defense under their additional insured endorsements. Although the other subcontractor insurers ultimately settled with Maryland and National Union, Nationwide denied it had a defense duty.
In Maryland Casualty Co. v. Nationwide Ins. Co., supra, 65 Cal.App.4th 21, 76 Cal.Rptr.2d 113, we determined Nationwide owed a defense duty based on the additional insured endorsements, and remanded for the court to determine the amount Nationwide owed to Maryland and National Union. We reasoned that, under the particular language of the additional insured endorsements, Nationwide's policies *377 covered Nielsen's vicarious liability for the acts of West Coast and Strang, and that Nationwide had a corresponding duty to defend Nielsen against claims potentially alleging this liability.
On remand, Maryland and National Union moved for summary judgment against Nationwide solely on the basis of the equitable subrogation doctrine. Maryland and National Union sought to recover all of their remaining defense costs, including amounts pertaining only to Nielsen's own negligence. The court granted summary judgment in favor of Maryland and National Union, ruling that Nationwide was obligated to pay for these insurers' unreimbursed defense costs. The court awarded Maryland $725,260.30 and awarded National Union $721,750.[3]
Nationwide appeals, contending the trial court erred in applying the equitable subrogation doctrine to shift the entire remaining burden of Nielsen's defense to Nationwide. Nationwide maintains Maryland and National Union were entitled only to a portion of the defense costs under an equitable contribution theory. We agree, and remand for the court to apply the equitable contribution doctrine to determine an appropriate allocation of defense costs among Maryland, National Union, and Nationwide.

DISCUSSION

I. Equitable Subrogation Doctrine is not Applicable

Nationwide contends the court erred in granting summary judgment on respondents' equitable subrogation claims.
In the insurance context, equitable subrogation and equitable contribution doctrines each pertain to the allocation of costs when there is more than one potentially responsible insurance company. But the two doctrines are "entirely different" concepts. (Fireman's Fund Ins. Co. v. Maryland Casualty Co. (1998) 65 Cal. App.4th 1279, 1293, 77 Cal.Rptr.2d 296 (Fireman's Fund).)
Equitable subrogation allows an insurer that paid coverage or defense costs to be placed in the insured's position to pursue a full recovery from another insurer who was primarily responsible for the loss. (Fireman's Fund, supra, 65 Cal. App.4th at p. 1291, 77 Cal.Rptr.2d 296.) Because this doctrine shifts the entire cost burden, the moving party insurer must show the other insurer was primarily liable for the loss and that the moving party's equitable position is inferior to that of the second insurer. (Id. at pp. 1291, 1296, 77 Cal.Rptr.2d 296; see Fireman's Fund Ins. Co. v. Wilshire Film Ventures, Inc. (1997) 52 Cal.App.4th 553, 556, 60 Cal.Rptr.2d 591.) This doctrine commonly applies to shift defense costs between primary and excess insurers. (See Signal Companies, Inc. v. Harbor Ins. Co. (1980) 27 Cal.3d 359, 367-368, 165 Cal.Rptr. 799, 612 P.2d 889; Reliance Nat. Indemnity Co. v. General Star Indemnity Co., supra, 72 Cal. App.4th at pp. 1080-1081, 85 Cal.Rptr.2d 627.) As between those two insurers, the primary insurer is obligated to defend the insured and must bear 100 percent of the defense costs until the primary limits have been exhausted. (See Signal Companies, Inc. v. Harbor Ins. Co., supra, 27 Cal.3d at p. 368, 165 Cal.Rptr. 799, 612 P.2d 889; Hartford Accident & Indemnity Co. v. Superior Court (1994) 23 Cal.App.4th 1774, 1779-1780, 29 Cal.Rptr.2d 32.) Thus, an excess insurer that pays defense costs will frequently obtain a full recovery against the primary insurer on an equitable subrogation theory.
Equitable contribution, on the other hand, applies to apportion costs among *378 insurers that share the same level of liability on the same risk as to the same insured (Fireman's Fund, supra, 65 Cal. App.4th at pp. 1293-1294, 77 Cal.Rptr.2d 296.) It "arises when several insurers are obligated to indemnify or defend the same loss or claim, and one insurer has paid more than its share of the loss or defended the action without any participation by the others." (Id. at p. 1293, 77 Cal.Rptr.2d 296.) "The purpose of this rule of equity is to accomplish substantial justice by equalizing the common burden shared by coinsurers, and to prevent one insurer from profiting at the expense of others." (Ibid.; see American Continental Ins. Co. v. American Casualty Co. (1999) 73 Cal. App.4th 508, 513, 86 Cal.Rptr.2d 560.)
Respondents recognize the distinction between these contribution and subrogation theories, and concede that their policies were primary and covered the same insured (Nielsen) and the same risks as did Nationwide's policy. They nonetheless argue they were entitled to recover all of their remaining defense costs under the equitable subrogation doctrine because the typewritten language in West Coast's Nationwide policy converted their policies into excess policies, eliminating any defense duty on their part.
We agree that courts generally enforce the terms of insurance policies pertaining to allocation issues and the characterization of a policy as "primary" or "excess." (See Reliance Nat. Indent. Co. v. General Star Indemnity Co., supra, 72 Cal.App.4th at p. 1075, 85 Cal. Rptr.2d 627.) But respondents' interpretation of Nationwide's insurance policies is not reasonable. As with other types of contracts, the goal of insurance contract interpretation "is to give effect to the mutual intent of the parties. [Citation.] If contract language is clear and explicit, we ascertain this intent from the written provisions and go no further. [Citation.]" (Maryland Casualty Co. v. Nationwide Ins. Co., supra, 65 Cal.App.4th at p. 28, 76 Cal.Rptr.2d 113.) But where the language is in any respect ambiguous or uncertain, the court must determine the interpretation that is most "`consistent with the insured's objectively reasonable expectations.'" (Id. at p. 30, 76 Cal. Rptr.2d 113.) In so doing, "the court must interpret the language in context, with regard to its intended function in the policy. [Citation.] `[L]anguage in a contract must be construed in the context of that instrument as a whole, and in the circumstances of that case....'" (Reliance Nat. Indemnity Co. v. General Star Indemnity Co., supra, 72 Cal.App.4th at p. 1074, 85 Cal.Rptr.2d 627, italics omitted.)
The relevant policy provision added Nielsen as an insured under each subcontractor's policy but stated "this insurance with respect to [Nielsen] applies only to the extent that [Nielsen] is held liable for your acts or omissions arising out of and in the course of operations performed for [Nielsen]...." West Coast's policy's typewritten addition stated: "Coverage provided to the additional insured under this endorsement is primary, but only with respect to acts or omissions of the named insured. Any other insurance maintained by the additional insured is deemed to be excess."
Reading these provisions in a consistent and reasonable manner, the basic additional insured provision created the limited vicarious liability coverage for the additional insured, and the typewritten provisions confirmed the limited nature of the coverage, and then characterized this limited coverage as primary to any other policy. (See Maryland Casualty Co. v. Nationwide Ins. Co., supra, 65 Cal.App.4th at pp. 30-34, 76 Cal.Rptr.2d 113.) Under this interpretation, the equitable subrogation doctrine is inapplicable because each insurer remains primarily responsible for the defense. The typewritten language merely guides the allocation of coverage and defense costs with respect to vicarious liability claims pertaining to the named subcontractor.
*379 Respondents urge us to apply another interpretation, asserting that the final sentence of the typewritten provision "[a]ny other insurance maintained by the additional insured is deemed to be excess" means that Nielsen's other insurance policiesincluding the policies in which it is the named insuredare excess to Nationwide's policy. While it may be possible to interpret the sentence in this manner when reading the words in isolation, it is not reasonable when viewing the sentence in context of the entire insurance policy. Respondents' interpretation would alter the purpose and nature of the additional insured endorsement by creating coverage for all of Nielsen's direct acts and for the other subcontractors' acts. It would not be reasonable for the parties to so carefully delineate the limited scope of the additional insured coverage, and then in a single final sentence indirectly eliminate this limitation. While the final typewritten sentence refers to "excess" coverage, the endorsement does not state that Nationwide's coverage supersedes other primary coverage for Nielsen's own as opposed to vicariousliability as to the entire project. The endorsement is not reasonably susceptible to respondents' interpretation.
Moreover, respondents' position is not reasonable when viewed in the commercial context in which the policies arise. Nielsen, the general contractor, purchased its own primary coverage from Maryland and National Union and then bargained for each subcontractor to name it as an additional insured for its liability arising from each subcontractor's acts. The homeowners association sought to recover against Nielsen based on strict liability, Nielsen's own negligence, and the negligence of many of the subcontractors. To conclude that because Nationwide agreed to cover Nielsen's vicarious liability for two of the many subcontractors that were sued, it should be saddled with the entire remaining cost of the defense pertaining to acts having nothing to do with its insureds merely because it initially denied a defense duty, would not be within the reasonable expectations of the parties.
"The test as to whether [a] party has the right to maintain the action for subrogation `involves a consideration of, and must necessarily depend upon the respective equities of the parties.'" (Reliance Nat. Indemnity Co., supra, 72 Cal.App.4th at p. 1081, 85 Cal.Rptr.2d 627.) It would not be equitable in this case to permit the contractor's primary insurance carriers to be relieved entirely of their defense obligations and to instead place this burden on an insurer for two of the numerous subcontractors on the project.
Maryland's reliance on Buss v. Superior Court (1997) 16 Cal.4th 35, 65 Cal.Rptr.2d 366, 939 P.2d 766 is misplaced. Buss held an insurer has a duty to defend an entire action, but the insurer may later seek reimbursement from its insured for defense costs allocable solely to claims for which there was no potential coverage. (Id. at pp. 49-53, 65 Cal.Rptr.2d 366, 939 P.2d 766.) Unlike Buss, the issue here is not the scope of Nationwide's duty to defend. It is the allocation of costs among several insurers each of which had a duty to defend. Maryland maintains that because we held in our prior decision that Nationwide had a duty to defend, Nationwide was obligated under Buss to provide a "complete" defense for all claims. This assertion, however, proves nothing when determining the applicability of the equitable subrogation doctrine. The critical point is that respondents and Nationwide had parallel "complete" duties to defend. Nationwide had a duty to defend Nielsen because there was a potential Nielsen would be vicariously liable for Strang or West Coast's alleged negligence. Likewise, Maryland and National Union had a duty to defend Nielsen because there was a potential Nielsen would be liable for its own negligence. Respondents undertook that duty, and Nationwide did not. The question now is the portion of the costs that Nationwide should equitably share for *380 this duty. Buss does not provide an answer to this question.
Respondents' reliance on Rossmoor Sanitation, Inc. v. Pylon, Inc. (1975) 13 Cal.3d 622, 119 Cal.Rptr. 449, 532 P.2d 97 is similarly misplaced. Rossmoor involved the rights and obligations of parties to an indemnity agreement (a general contractor/indemnitor and an owner/indemnitee), and of the parties' respective insurers. Rossmoor upheld the lower court's finding that the contractor was negligent and the owner was not actively negligent, requiring the contractor to indemnify the owner under the terms of the parties' indemnity contract. (Id, at p. 633, 119 Cal.Rptr. 449, 532 P.2d 97.) Rossmoor additionally held the owner's insurance coverage provided by a direct insurer was excess over coverage provided by an additional insured provision in the contractor's policy. (Id, at pp. 633-634, 119 Cal.Rptr. 449, 532 P.2d 97.) But the court did not hold an indemnitee's policy will always be excess. The court instead made clear it was reaching its conclusion based on the particular circumstances of the case. (Id. at p. 634, 119 Cal.Rptr. 449, 532 P.2d 97.) The court said the "one factor" it found "compelling" was that the parties had specifically bargained for the contractor to bear the entire costs resulting from its negligent conduct and for the owner to be relieved of any liability where it was not actively negligent. (Ibid.)
In this case, there was no evidence showing that Nielsen and the two subcontractors had agreed the subcontractors would be responsible for costs that did not pertain to their work. Thus, the factual record does not support respondents' position on the insurance allocation issues. Moreover, Rossmoor did not "purport to establish a general rule" that the terms of the underlying indemnity contract are necessarily controlling in determining the relative obligations of the parties' insurance companies. (Reliance Nat. Indemnity Co., supra, 72 Cal.App.4th at p. 1081, 85 Cal.Rptr.2d 627.) While the factual circumstances in Rossmoor may have created a relationship between the indemnity contract and the insurance allocation issues, there was no similar basis for the relationship in this case.[4]
National Union next directs us to Shell Oil Co. v. Winterthur Swiss Ins. Co. (1993) 12 Cal.App.4th 715, 15 Cal.Rptr.2d 815, where the court stated (1) an excess insurer does not have a duty to defend until the primary insurer's limits are exhausted; and (2) "[g]ross disparity between primary and excess liability limits does not create an equitable duty to contribute to defense costs." (Id, at pp. 768, 769, 15 Cal. Rptr.2d 815.) Because these statements were made in the context of an excess and primary policy, they are inapplicable here where we are dealing only with carriers that are primary carriers with respect to certain obligations and excess and primary as to others.
In sum, we conclude the fact that one of Nationwide's policies imposed on Nationwide the primary obligation to pay for the additional insured's vicarious liability coverage does not mean that Maryland and National Union are entitled to shift the entire obligation of Nielsen's defense to Nationwide. An excess policy is one where no insurance obligation or defense duty attaches until the insurance limits for an underlying policy are exhausted. Respondents' policies remained primary policies with respect to Nielsen's own negligence, creating an immediate obligation to defend. While respondents had the right to obtain a partial reimbursement from other equally responsible insurers, they could do so only under the equitable contribution doctrine. Under these circumstances, the court erred in granting summary judgment on respondents' equitable subrogation claim.


*381 II. Equitable Contribution

Respondents alternatively contend the trial court properly granted summary judgment because Nationwide failed to proffer appropriate evidence of a proper division of costs under the equitable contribution theory. This argument is unavailing because Nationwide did not have an obligation to come forward with allocation evidence. Respondents asserted their summary judgment motions based solely on the equitable subrogation doctrine. Because Maryland and National Union failed to prove the circumstances permitted application of subrogation principles, the burden did not shift to Nationwide to show the proper division of costs under the equitable contribution doctrine. (See Code Civ. Proc., § 437c, subd. (o)(2); Crouse v. Brobeck, Phleger & Harrison (1998) 67 Cal.App.4th 1509, 1534-1535, 80 Cal. Rptr.2d 94.)
We also reject Maryland's argument that Nationwide waived its right to seek allocation because it did not assert an affirmative defense of defense cost allocation. Maryland specifically alleged an equitable contribution theory in its complaint. This allegation was sufficient to raise the allocation issue. Nationwide did not have any additional duty to repeat the equitable contribution theory as an affirmative defense in its answer.

III. Trial Court's Obligation on Remand

We remand the case for the trial court to allocate defense costs under the equitable contribution theory. In so doing, we reject Nationwide's argument that we should determine its equitable share of the defense costs based on evidence presented in opposition to the summary judgment. The proper allocation of costs is within a trial court's broad discretion. (See Montrose Chemical Corp. v. Admiral Ins. Co. (1995) 10 Cal.4th 645, 681, fn. 19, 42 Cal.Rptr.2d 324, 913 P.2d 878; Armstrong World Industries, Inc. v. Aetna Casualty & Surety Co. (1996) 45 Cal.App.4th 1, 51-55, 52 Cal.Rptr.2d 690.) The trial court did not have the opportunity to exercise this discretion.
While there is no single required method of apportionment, the ultimate goal of equitable contribution must be "to accomplish substantial justice by equalizing the common burden shared by coinsurers, and to prevent one insurer from profiting at the expense of others." (Fireman's Fund v. Maryland Casualty Co., supra, 65 Cal. App.4th at p. 1293, 77 Cal.Rptr.2d 296.) Consistent with this objective, courts have developed several methods to quantify the insurers' respective risks and achieve an equitable apportionment of loss, including methods based on policy limits, time on the risk, policy limits multiplied by time on the risk, equal shares, and other factors. (See Stonewall Ins. Co. v. City of Palos Verdes Estates (1996) 46 Cal.App.4th 1810, 1853-1854, fn. 14, 54 Cal.Rptr.2d 176; Armstrong World Industries, Inc. v. Aetna Casualty & Surety Co., supra, 45 Cal.App.4th at pp. 51-55, 52 Cal.Rptr.2d 690.)
On remand, the trial court should consider all relevant factors, including the policy terms, to achieve an equitable apportionment of defense costs. We note that while Nielsen's settlement proposal of defense cost apportionment may be a relevant factor, the trial court has the discretion to determine the admissibility and weight of this evidence.

DISPOSITION
The judgment is reversed. On remand, the trial court shall apply the equitable contribution doctrine and reallocate the defense costs among the parties in accordance with the insurance contracts and equitable principles. Nationwide is entitled to costs on appeal.
NARES, Acting P.J., and McDONALD, J., concur.
NOTES
[1]  Many of the relevant facts are set forth in our prior decision in this case, Maryland Casualty Co. v. Nationwide Ins. Co. (1998) 65 Cal.App.4th 21, 76 Cal.Rptr.2d 113. For convenience, we set forth those facts again here. Additionally, we will refer jointly to Maryland Insurance Company (Maryland) and National Union Fire Insurance Company (National Union) as respondents. Our reference to National Union includes American International Specialty Lines Insurance Company, whose position in this action is identical to National Union's position. We will refer to appellant Nationwide Mutual Insurance Company as Nationwide.
[2]  "`Primary coverage is insurance coverage whereby, under the terms of the policy, liability attaches immediately upon the happening of the occurrence that gives rise to liability. ... [¶] "Excess" ... is coverage whereby, under the terms of the policy, liability attaches only after a predetermined amount of primary coverage has been exhausted.'" (Reliance Nat. Indemnity Co. v. General Star Indemnity Co. (1999) 72 Cal.App.4th 1063, 1076, 85 Cal.Rptr.2d 627.)
[3]  National Union presented evidence showing it had paid approximately $1.2 million in defense costs, and had recovered $564,894 from other additional insurers and/or subcontractors. Maryland presented evidence showing it had paid approximately $1.3 million in defense costs, and had recovered $613,549 from other additional insurers and/or subcontractors.
[4]  For similar reasons, we are unpersuaded by respondents' focus on the subcontractors' contractual agreement to procure insurance coverage. The issue here concerns a dispute between insurance carriers, not a dispute between the parties to the underlying contracts. The subcontractors' compliance with their agreements to procure insurance is not at issue here.
