1021-1038

CODE OF CIVIL PROCEDURE
SECTION 1021-1038




1021.  Except as attorney's fees are specifically provided for by
statute, the measure and mode of compensation of attorneys and
counselors at law is left to the agreement, express or implied, of
the parties; but parties to actions or proceedings are entitled to
their costs, as hereinafter provided.



1021.4.  In an action for damages against a defendant based upon
that defendant's commission of a felony offense for which that
defendant has been convicted, the court may, upon motion, award
reasonable attorney's fees to a prevailing plaintiff against the
defendant who has been convicted of the felony.



1021.5.  Upon motion, a court may award attorneys' fees to a
successful party against one or more opposing parties in any action
which has resulted in the enforcement of an important right affecting
the public interest if: (a) a significant benefit, whether pecuniary
or nonpecuniary, has been conferred on the general public or a large
class of persons, (b) the necessity and financial burden of private
enforcement, or of enforcement by one public entity against another
public entity, are such as to make the award appropriate, and (c)
such fees should not in the interest of justice be paid out of the
recovery, if any. With respect to actions involving public entities,
this section applies to allowances against, but not in favor of,
public entities, and no claim shall be required to be filed therefor,
unless one or more successful parties and one or more opposing
parties are public entities, in which case no claim shall be required
to be filed therefor under Part 3 (commencing with Section 900) of
Division 3.6 of Title 1 of the Government Code.
   Attorneys' fees awarded to a public entity pursuant to this
section shall not be increased or decreased by a multiplier based
upon extrinsic circumstances, as discussed in Serrano v. Priest, 20
Cal. 3d 25, 49.


1021.6.  Upon motion, a court after reviewing the evidence in the
principal case may award attorney's fees to a person who prevails on
a claim for implied indemnity if the court finds (a) that the
indemnitee through the tort of the indemnitor has been required to
act in the protection of the indemnitee's interest by bringing an
action against or defending an action by a third person and (b) if
that indemnitor was properly notified of the demand to bring the
action or provide the defense and did not avail itself of the
opportunity to do so, and (c) that the trier of fact determined that
the indemnitee was without fault in the principal case which is the
basis for the action in indemnity or that the indemnitee had a final
judgment entered in his or her favor granting a summary judgment, a
nonsuit, or a directed verdict.



1021.7.  In any action for damages arising out of the performance of
a peace officer's duties, brought against a peace officer, as
defined in Chapter 4.5 (commencing with Section 830) of Title 3 of
Part 2 of the Penal Code, or against a public entity employing a
peace officer or in an action for libel or slander brought pursuant
to Section 45 or 46 of the Civil Code, the court may, in its
discretion, award reasonable attorney's fees to the defendant or
defendants as part of the costs, upon a finding by the court that the
action was not filed or maintained in good faith and with reasonable
cause.


1021.8.  (a) Whenever the Attorney General prevails in a civil
action to enforce Section 17537.3, 22445, 22446.5, 22958, 22962, or
22963 of the Business and Professions Code, Section 52, 52.1, 55.1,
or 3494 of the Civil Code, the Corporate Securities Law of 1968
(Division 1 (commencing with Section 25000) of Title 4 of the
Corporations Code or the California Commodity Law of 1990 (Division
4.5 (commencing with Section 29500) of Title 4 of the Corporations
Code), Section 1615, 2014, or 5650.1 of the Fish and Game Code,
Section 4458, 12598, 12606, 12607, 12989.3, 16147, 66640, 66641, or
66641.7 of the Government Code, Section 13009, 13009.1, 19958.5,
25299, 39674, 41513, 42402, 42402.1, 42402.2, 42402.3, 42402.4,
43016, 43017, 43154, 104557, or 118950 of the Health and Safety Code,
Section 308.1 or 308.3 of the Penal Code, Section 2774.1, 4601.1,
4603, 4605, 30820, 30821.6, 30822, 42847, or 48023 of the Public
Resources Code, Section 30101.7 of the Revenue and Taxation Code, or
Section 275, 1052, 1845, 13261, 13262, 13264, 13265, 13268, 13304,
13331, 13350, or 13385 of the Water Code, the court shall award to
the Attorney General all costs of investigating and prosecuting the
action, including expert fees, reasonable attorney's fees, and costs.
Awards under this section shall be paid to the Public Rights Law
Enforcement Special Fund established by Section 12530 of the
Government Code.
   (b) This section applies to any action pending on the effective
date of this section and to any action filed thereafter.
   (c) The amendments made to this section by Chapter 227 of the
Statutes of 2004 shall apply to any action pending on the effective
date of these amendments and to any action filed thereafter.



1021.9.  In any action to recover damages to personal or real
property resulting from trespassing on lands either under cultivation
or intended or used for the raising of livestock, the prevailing
plaintiff shall be entitled to reasonable attorney's fees in addition
to other costs, and in addition to any liability for damages imposed
by law.



1021.10.  Notwithstanding any other provision of law, in an action
brought in the name of the people of the State of California against
any person for failure to comply with Chapter 10A (commencing with
Section 375) of Title 15 of the United States Code, otherwise known
as the "Jenkins Act," the court, to the extent not expressly
prohibited by federal law, shall award fees and costs, including
reasonable attorney's fees, to the people if the people succeed on
any claim to enforce the Jenkins Act. Any attorney's fees awarded
under this section shall be in addition to any other remedies or
penalties available under all other laws of this state.




1022.  When several actions are brought on one bond, undertaking,
promissory note, bill of exchange, or other instrument in writing, or
in any other case for the same cause of action, against several
parties who might have been joined as defendants in the same action,
no costs can be allowed to the plaintiff in more than one of such
actions, which may be at his election, if the party proceeded against
in the other actions were, at the commencement of the previous
action, openly within this State; but the disbursements of the
plaintiff must be allowed to him in each action.



1023.  The fees of referees are such reasonable sum as the court may
fix for the time spent in the business of the reference; but the
parties may agree, in writing, upon any other rate of compensation,
and thereupon such rates shall be allowed.



1024.  When an application is made to the court or referee to
postpone a trial, the payment of the expenses occasioned by the
postponement may be imposed, in the discretion of the court or
referee, as a condition of granting the same.



1025.  When, in an action for the recovery of money only, the
defendant alleges in his answer that before the commencement of the
action he tendered to the plaintiff the full amount to which he was
entitled, and thereupon deposits in court, for plaintiff, the amount
so tendered, and the allegation is found to be true, the plaintiff
can not recover costs, but must pay costs to the defendant.



1026.  (a) Except as provided in subdivision (b), in an action
prosecuted or defended by a personal representative, trustee of an
express trust, guardian, conservator, or a person expressly
authorized by statute, costs may be recovered as in an action by or
against a person prosecuting or defending in the person's own right.
   (b) Costs allowed under subdivision (a) shall, by the judgment, be
made chargeable only upon the estate, fund, or party represented,
unless the court directs the costs to be paid by the fiduciary
personally for mismanagement or bad faith in the action or defense.



1027.  When the decision of a court of inferior jurisdiction in a
special proceeding is brought before a court of higher jurisdiction
for a review, in any other way than by appeal, the same costs must be
allowed as in cases on appeal, and may be collected in the manner
provided for enforcement of money judgments generally, or in such
manner as the court may direct, according to the nature of the case.




1028.  Notwithstanding any other provisions of law, when the State
is a party, costs shall be awarded against it on the same basis as
against any other party and, when awarded, must be paid out of the
appropriation for the support of the agency on whose behalf the State
appeared.



1028.5.  (a) In any civil action between a small business or a
licensee and a state regulatory agency, involving the regulatory
functions of a state agency as applied to a small business or a
licensee, if the small business or licensee prevails, and if the
court determines that the action of the agency was undertaken without
substantial justification, the small business or licensee may, in
the discretion of the court, be awarded reasonable litigation
expenses in addition to other costs. Funds for such expenses and
costs shall be paid from funds in the regular operating budget of the
state regulatory agency where the appropriation therefor encompasses
the payment of such costs and expenses, and not from unappropriated
money in the General Fund.
   (b) "Reasonable litigation expenses" means any expenses not in
excess of seven thousand five hundred dollars ($7,500) which the
judge finds were reasonably incurred in opposing the agency action,
including court costs, expenses incurred in administrative
proceedings, attorney's fees, witness fees of all necessary
witnesses, and such other expenses as were reasonably incurred.
   (c) "Small business" means a business activity that is all of the
following:
   (1) Independently owned and operated.
   (2) Not dominant in its field of operation.
   (3) Not exceeding the following annual gross receipts or other
criteria in the categories of:
   (A) Agriculture, one million dollars ($1,000,000).
   (B) General construction, nine million five hundred thousand
dollars ($9,500,000).
   (C) Special trade construction, five million dollars ($5,000,000).
   (D) Retail trade, two million dollars ($2,000,000).
   (E) Wholesale trade, nine million five hundred thousand dollars
($9,500,000).
   (F) Services, two million dollars ($2,000,000).
   (G) Transportation and warehousing, one million five hundred
thousand dollars ($1,500,000).
   (H) A manufacturing enterprise not exceeding 250 employees.
   (I) A health care facility not exceeding 150 beds or one million
five hundred thousand dollars ($1,500,000) in annual gross receipts.
   (J) Generating and transmitting electric power not exceeding 4,500
megawatt hours annually.
   (d) "Licensee" means any person licensed by a state agency who
does not qualify as a small business, but whose annual gross receipts
from the use of such license do not exceed one million dollars
($1,000,000).
   (e) A small business or a licensee shall be deemed to prevail in
any action in which there is no adjudication, stipulation, or
acceptance of liability on the part of the small business or
licensee.
   (f) A small business or licensee shall not be deemed to have
prevailed in actions commenced at the instance of, or on the basis of
a complaint filed by, a person who is not an officer, employee, or
other agent of the state regulatory agency if the action is dismissed
by the agency upon a finding of no cause for the action, or is
settled by the agency and small business or licensee without a
finding of fault.
   (g) Section 800 of the Government Code shall not apply to actions
which are subject to the provisions of this section.
   (h) Every state regulatory agency against which litigation
expenses have been awarded under this section shall, at the time of
submission of its proposed budget pursuant to Section 13320 of the
Government Code, submit a report to the Department of Finance and the
Legislature as to the amount of those expenses awarded and paid
during the fiscal year.
   (i) This section shall be known and may be cited as the
Carpenter-Katz Small Business Equal Access to Justice Act of 1981.




1029.  When any county, city, district, or other public agency or
entity, or any officer thereof in his official capacity, is a party,
costs shall be awarded against it on the same basis as against any
other party and, when awarded, must be paid out of the treasury
thereof.



1029.5.  (a) Whenever a complaint for damages is filed against any
architect, landscape architect, engineer, building designer, or land
surveyor, duly licensed as such under the laws of this state, in an
action for error, omission, or professional negligence in the
creation and preparation of plans, specifications, designs, reports
or surveys which are the basis for work performed or agreed to be
performed on real property, any such defendant may, within 30 days
after service of summons, move the court for an order, upon notice
and hearing, requiring the plaintiff to file an undertaking in a sum
not to exceed five hundred dollars ($500) as security for the costs
of defense as provided in subdivision (d), which may be awarded
against the plaintiff. The motion shall be supported by affidavit
showing that the claim against the defendant is frivolous.
   At the hearing upon the motion, the court shall order the
plaintiff to file the undertaking if the defendant shows to the
satisfaction of the court that (i) the plaintiff would not suffer
undue economic hardship in filing the undertaking, and (ii) there is
no reasonable possibility that the plaintiff has a cause of action
against each named defendant with respect to whom the plaintiff would
otherwise be required to file the undertaking. No appeal shall be
taken from any order made pursuant to this subdivision to file or not
to file the undertaking.
   A determination by the court that the undertaking either shall or
shall not be filed or shall be filed as to one or more defendants and
not as to others, shall not be deemed a determination of any one or
more issues in the action or of the merits thereof. If the court,
upon any such motion, makes a determination that an undertaking be
filed by the plaintiff as to any one or more defendants, the action
shall be dismissed as to the defendant or defendants, unless the
undertaking required by the court has been filed within such
reasonable time as may be fixed by the court.
   (b) This section does not apply to a complaint for bodily injury
or for wrongful death, nor to an action commenced in a small claims
court.
   (c) Whenever more than one such defendant is named, the
undertaking shall be increased to the extent of not to exceed five
hundred dollars ($500) for each additional defendant in whose favor
the undertaking is ordered not to exceed the total of three thousand
dollars ($3,000).
   (d) In any action requiring an undertaking as provided in this
section, upon the dismissal of the action or the award of judgment to
the defendant, the court shall require the plaintiff to pay the
defendant's costs of defense authorized by law. Any sureties shall be
liable for such costs in an amount not to exceed the sum of five
hundred dollars ($500) or the amount of the undertaking, whichever is
lesser, for each defendant with respect to whom the sureties have
executed an undertaking.



1029.6.  (a) Whenever a complaint for damages for personal injuries
is filed against a physician and surgeon, dentist, registered nurse,
dispensing optician, optometrist, pharmacist, registered physical
therapist, podiatrist, licensed psychologist, osteopathic physician
and surgeon, chiropractor, clinical laboratory bioanalyst, clinical
laboratory technologist, or veterinarian, duly licensed as such under
the laws of this state, or a licensed hospital as the employer of
any such person, in an action for error, omission, or negligence in
the performance of professional services, or performance of
professional services without consent, any such defendant may, within
six months after service of summons, move the court for an order,
upon notice to plaintiff and all defendants having appeared in the
action, and hearing, requiring the plaintiff to file an undertaking
in a sum not to exceed five hundred dollars ($500) as security for
the costs of defense as provided in subdivision (d), which may be
awarded against the plaintiff. The motion shall be supported by
affidavit showing that the claim against the defendant is frivolous.
Any defendant having appeared in the action and within 30 days after
receipt of notice may join with the moving party requesting an order
under this section as to the additional defendant. The failure of any
defendant to join with the moving party shall preclude that
defendant from subsequently requesting an order under this section.
   At the hearing upon the motion, the court shall order the
plaintiff to file the undertaking if the defendant shows to the
satisfaction of the court that: (i) the plaintiff would not suffer
undue economic hardship in filing the undertaking and (ii) there is
no reasonable possibility that the plaintiff has a cause of action
against each named defendant with respect to whom the plaintiff would
otherwise be required to file the undertaking.
   A determination by the court that an undertaking either shall or
shall not be filed or shall be filed as to one or more defendants and
not as to others, shall not be deemed a determination of any one or
more issues in the action or of the merits thereof. If the court,
upon any such motion, makes a determination that an undertaking be
filed by the plaintiff as to any one or more defendants, the action
shall be dismissed as to that defendant or defendants, unless the
undertaking required by the court shall have been filed within the
reasonable time as may be fixed by the court.
   (b) This section does not apply to a complaint in an action
commenced in a small claims court.
   (c) Whenever more than one defendant is named, the undertaking
shall be increased to the extent of not to exceed five hundred
dollars ($500) for each additional defendant in whose favor the
undertaking is ordered, not to exceed the total of one thousand
dollars ($1,000).
   (d) In any action requiring an undertaking as provided in this
section, upon the dismissal of the action or the award of judgment to
the defendant, the court shall require the plaintiff to pay the
defendant's court costs. Any sureties shall be liable for those costs
in an amount not to exceed the sum of five hundred dollars ($500) or
the amount of the undertaking, whichever is lesser, for each
defendant with respect to whom the sureties have executed an
undertaking. If the plaintiff prevails in the action against any
defendant with respect to whom an undertaking has been filed, the
defendant shall pay the costs to plaintiff incurred in defending the
motion for dismissal authorized by this section.
   (e) Any defendant filing a motion under this section or joining
with a moving party under this section is precluded from subsequently
filing a motion for summary judgment.
   (f) Any defendant filing a motion for summary judgment is
precluded from subsequently filing a motion, or joining with a moving
party, under this section.



1029.8.  (a) Any unlicensed person who causes injury or damage to
another person as a result of providing goods or performing services
for which a license is required under Division 2 (commencing with
Section 500) or any initiative act referred to therein, Division 3
(commencing with Section 5000), or Chapter 2 (commencing with Section
18600) or Chapter 3 (commencing with Section 19000) of Division 8,
of the Business and Professions Code, or Chapter 2 (commencing with
Section 25210) or Chapter 3 (commencing with Section 25230) of Part 3
of Division 1 of Title 4 of the Corporations Code, shall be liable
to the injured person for treble the amount of damages assessed in a
civil action in any court having proper jurisdiction. The court may,
in its discretion, award all costs and attorney's fees to the injured
person if that person prevails in the action.
   (b) This section shall not be construed to confer an additional
cause of action or to affect or limit any other remedy, including,
but not limited to, a claim for exemplary damages.
   (c) The additional damages provided for in subdivision (a) shall
not exceed ten thousand dollars ($10,000).
   (d) For the purposes of this section, the term "unlicensed person"
shall not apply to any of the following:
   (1) Any person, partnership, corporation, or other entity
providing goods or services under the good faith belief that they are
properly licensed and acting within the proper scope of that
licensure.
   (2) Any person, partnership, corporation, or other entity whose
license has expired for nonpayment of license renewal fees, but who
is eligible to renew that license without the necessity of applying
and qualifying for an original license.
   (3) Any person, partnership, or corporation licensed under Chapter
6 (commencing with Section 2700) or Chapter 6.5 (commencing with
Section 2840) of the Business and Professions Code, who provides
professional nursing services under an existing license, if the
action arises from a claim that the licensee exceeded the scope of
practice authorized by his or her license.
   (e) This section shall not apply to any action for unfair trade
practices brought against an unlicensed person under Chapter 4
(commencing with Section 17000) of Part 2 of Division 7 of the
Business and Professions Code, by a person who holds a license that
is required, or closely related to the license that is required, to
engage in those activities performed by the unlicensed person.




1030.  (a) When the plaintiff in an action or special proceeding
resides out of the state, or is a foreign corporation, the defendant
may at any time apply to the court by noticed motion for an order
requiring the plaintiff to file an undertaking to secure an award of
costs and attorney's fees which may be awarded in the action or
special proceeding. For the purposes of this section, "attorney's
fees" means reasonable attorney's fees a party may be authorized to
recover by a statute apart from this section or by contract.
   (b) The motion shall be made on the grounds that the plaintiff
resides out of the state or is a foreign corporation and that there
is a reasonable possibility that the moving defendant will obtain
judgment in the action or special proceeding. The motion shall be
accompanied by an affidavit in support of the grounds for the motion
and by a memorandum of points and authorities. The affidavit shall
set forth the nature and amount of the costs and attorney's fees the
defendant has incurred and expects to incur by the conclusion of the
action or special proceeding.
   (c) If the court, after hearing, determines that the grounds for
the motion have been established, the court shall order that the
plaintiff file the undertaking in an amount specified in the court's
order as security for costs and attorney's fees.
   (d) The plaintiff shall file the undertaking not later than 30
days after service of the court's order requiring it or within a
greater time allowed by the court. If the plaintiff fails to file the
undertaking within the time allowed, the plaintiff's action or
special proceeding shall be dismissed as to the defendant in whose
favor the order requiring the undertaking was made.
   (e) If the defendant's motion for an order requiring an
undertaking is filed not later than 30 days after service of summons
on the defendant, further proceedings may be stayed in the discretion
of the court upon application to the court by the defendant by
noticed motion for the stay until 10 days after the motion for the
undertaking is denied or, if granted, until 10 days after the
required undertaking has been filed and the defendant has been served
with a copy of the undertaking. The hearing on the application for
the stay shall be held not later than 60 days after service of the
summons. If the defendant files a motion for an order requiring an
undertaking, which is granted but the defendant objects to the
undertaking, the court may in its discretion stay the proceedings not
longer than 10 days after a sufficient undertaking has been filed
and the defendant has been served with a copy of the undertaking.
   (f) The determinations of the court under this section have no
effect on the determination of any issues on the merits of the action
or special proceeding and may not be given in evidence nor referred
to in the trial of the action or proceeding.
   (g) An order granting or denying a motion for an undertaking under
this section is not appealable.



1031.  In actions for the recovery of wages for labor performed,
where the amount of the demand, exclusive of interest, does not
exceed three hundred dollars ($300), the court shall add, as part of
the cost, in any judgment recovered by the plaintiff or
cross-complainant, an attorney's fee not exceeding 20 percent of the
amount recovered.



1032.  (a) As used in this section, unless the context clearly
requires otherwise:
   (1) "Complaint" includes a cross-complaint.
   (2) "Defendant" includes a cross-defendant or a person against
whom a complaint is filed.
   (3) "Plaintiff" includes a cross-complainant or a party who files
a complaint in intervention.
   (4) "Prevailing party" includes the party with a net monetary
recovery, a defendant in whose favor a dismissal is entered, a
defendant where neither plaintiff nor defendant obtains any relief,
and a defendant as against those plaintiffs who do not recover any
relief against that defendant. When any party recovers other than
monetary relief and in situations other than as specified, the
"prevailing party" shall be as determined by the court, and under
those circumstances, the court, in its discretion, may allow costs or
not and, if allowed may apportion costs between the parties on the
same or adverse sides pursuant to rules adopted under Section 1034.
   (b) Except as otherwise expressly provided by statute, a
prevailing party is entitled as a matter of right to recover costs in
any action or proceeding.
   (c) Nothing in this section shall prohibit parties from
stipulating to alternative procedures for awarding costs in the
litigation pursuant to rules adopted under Section 1034.



1033.  (a) Costs or any portion of claimed costs shall be as
determined by the court in its discretion in a case other than a
limited civil case in accordance with Section 1034 where the
prevailing party recovers a judgment that could have been rendered in
a limited civil case.
   (b) When a prevailing plaintiff in a limited civil case recovers
less than the amount prescribed by law as the maximum limitation upon
the jurisdiction of the small claims court, the following shall
apply:
   (1) When the party could have brought the action in the small
claims division but did not do so, the court may, in its discretion,
allow or deny costs to the prevailing party, or may allow costs in
part in any amount as it deems proper.
   (2) When the party could not have brought the action in the small
claims court, costs and necessary disbursements shall be limited to
the actual cost of the filing fee, the actual cost of service of
process, and, when otherwise specifically allowed by law, reasonable
attorneys' fees. However, those costs shall only be awarded to the
plaintiff if the court is satisfied that prior to the commencement of
the action, the plaintiff informed the defendant in writing of the
intended legal action against the defendant and that legal action
could result in a judgment against the defendant that would include
the costs and necessary disbursements allowed by this paragraph.



1033.5.  (a) The following items are allowable as costs under
Section 1032:
   (1) Filing, motion, and jury fees.
   (2) Juror food and lodging while they are kept together during
trial and after the jury retires for deliberation.
   (3) Taking, video recording, and transcribing necessary
depositions including an original and one copy of those taken by the
claimant and one copy of depositions taken by the party against whom
costs are allowed, and travel expenses to attend depositions.
   (4) Service of process by a public officer, registered process
server, or other means, as follows:
   (A) When service is by a public officer, the recoverable cost is
the fee authorized by law at the time of service.
   (B) If service is by a process server registered pursuant to
Chapter 16 (commencing with Section 22350) of Division 8 of the
Business and Professions Code, the recoverable cost is the amount
actually incurred in effecting service, including, but not limited
to, a stakeout or other means employed in locating the person to be
served, unless those charges are successfully challenged by a party
to the action.
   (C) When service is by publication, the recoverable cost is the
sum actually incurred in effecting service.
   (D) When service is by a means other than that set forth in
subparagraph (A), (B), or (C), the recoverable cost is the lesser of
the sum actually incurred, or the amount allowed to a public officer
in this state for that service, except that the court may allow the
sum actually incurred in effecting service upon application pursuant
to paragraph (4) of subdivision (c).
   (5) Expenses of attachment including keeper's fees.
   (6) Premiums on necessary surety bonds.
   (7) Ordinary witness fees pursuant to Section 68093 of the
Government Code.
   (8) Fees of expert witnesses ordered by the court.
   (9) Transcripts of court proceedings ordered by the court.
   (10) Attorney's fees, when authorized by any of the following:
   (A) Contract.
   (B) Statute.
   (C) Law.
   (11) Court reporter fees as established by statute.
   (12) Models and blowups of exhibits and photocopies of exhibits
may be allowed if they were reasonably helpful to aid the trier of
fact.
   (13) Any other item that is required to be awarded to the
prevailing party pursuant to statute as an incident to prevailing in
the action at trial or on appeal.
   (b) The following items are not allowable as costs, except when
expressly authorized by law:
   (1) Fees of experts not ordered by the court.
   (2) Investigation expenses in preparing the case for trial.
   (3) Postage, telephone, and photocopying charges, except for
exhibits.
   (4) Costs in investigation of jurors or in preparation for voir
dire.
   (5) Transcripts of court proceedings not ordered by the court.
   (c) Any award of costs shall be subject to the following:
   (1) Costs are allowable if incurred, whether or not paid.
   (2) Allowable costs shall be reasonably necessary to the conduct
of the litigation rather than merely convenient or beneficial to its
preparation.
   (3) Allowable costs shall be reasonable in amount.
   (4) Items not mentioned in this section and items assessed upon
application may be allowed or denied in the court's discretion.
   (5) When any statute of this state refers to the award of "costs
and attorney's fees," attorney's fees are an item and component of
the costs to be awarded and are allowable as costs pursuant to
subparagraph (B) of paragraph (10) of subdivision (a). Any claim not
based upon the court's established schedule of attorney's fees for
actions on a contract shall bear the burden of proof. Attorney's fees
allowable as costs pursuant to subparagraph (B) of paragraph (10) of
subdivision (a) may be fixed as follows: (A) upon a noticed motion,
(B) at the time a statement of decision is rendered, (C) upon
application supported by affidavit made concurrently with a claim for
other costs, or (D) upon entry of default judgment. Attorney's fees
allowable as costs pursuant to subparagraph (A) or (C) of paragraph
(10) of subdivision (a) shall be fixed either upon a noticed motion
or upon entry of a default judgment, unless otherwise provided by
stipulation of the parties.
   Attorney's fees awarded pursuant to Section 1717 of the Civil Code
are allowable costs under Section 1032 of this code as authorized by
subparagraph (A) of paragraph (10) of subdivision (a).




1034.  (a) Prejudgment costs allowable under this chapter shall be
claimed and contested in accordance with rules adopted by the
Judicial Council.
   (b) The Judicial Council shall establish by rule allowable costs
on appeal and the procedure for claiming those costs.



1034.5.  In unlawful detainer proceedings, the plaintiff who
recovers judgment for possession of premises, and who advances or
pays to the sheriff or marshal the expenses required for the eviction
of any persons in possession or occupancy of the premises and the
personal property of such persons, shall, after being advised by the
sheriff or marshal of the exact amount necessarily used and expended
to effect the eviction, be allowed to file a request for the same
pursuant to rules adopted by the Judicial Council.



1036.  In any inverse condemnation proceeding, the court rendering
judgment for the plaintiff by awarding compensation, or the attorney
representing the public entity who effects a settlement of that
proceeding, shall determine and award or allow to the plaintiff, as a
part of that judgment or settlement, a sum that will, in the opinion
of the court, reimburse the plaintiff's reasonable costs,
disbursements, and expenses, including reasonable attorney,
appraisal, and engineering fees, actually incurred because of that
proceeding in the trial court or in any appellate proceeding in which
the plaintiff prevails on any issue in that proceeding.




1038.  (a) In any civil proceeding under the California Tort Claims
Act or for express or implied indemnity or for contribution in any
civil action, the court, upon motion of the defendant or
cross-defendant, shall, at the time of the granting of any summary
judgment, motion for directed verdict, motion for judgment under
Section 631.8, or any nonsuit dismissing the moving party other than
the plaintiff, petitioner, cross-complainant, or intervenor, or at a
later time set forth by rule of the Judicial Council adopted under
Section 1034 determine whether or not the plaintiff, petitioner,
cross-complainant, or intervenor brought the proceeding with
reasonable cause and in the good faith belief that there was a
justifiable controversy under the facts and law which warranted the
filing of the complaint, petition, cross-complaint, or complaint in
intervention. If the court should determine that the proceeding was
not brought in good faith and with reasonable cause, an additional
issue shall be decided as to the defense costs reasonably and
necessarily incurred by the party or parties opposing the proceeding,
and the court shall render judgment in favor of that party in the
amount of all reasonable and necessary defense costs, in addition to
those costs normally awarded to the prevailing party. An award of
defense costs under this section shall not be made except on notice
contained in a party's papers and an opportunity to be heard.
   (b) "Defense costs," as used in this section, shall include
reasonable attorneys' fees, expert witness fees, the expense of
services of experts, advisers, and consultants in defense of the
proceeding, and where reasonably and necessarily incurred in
defending the proceeding.
   (c) This section shall be applicable only on motion made prior to
the discharge of the jury or entry of judgment, and any party
requesting the relief pursuant to this section waives any right to
seek damages for malicious prosecution. Failure to make the motion
shall not be deemed a waiver of the right to pursue a malicious
prosecution action.
   (d) This section shall only apply if the defendant or
cross-defendant has made a motion for summary judgment, judgment
under Section 631.8, directed verdict, or nonsuit and the motion is
granted.