EXHIBIT 10.40 AGREEMENT OF ------------ NON-DISTURBANCE AND ATTORNMENT ------------------------------ This Agreement (the "Agreement") is made is made as of July 28, 1999, by and among ASP SCRIPPS, L.L.C., a Delaware limited liability company ("Landlord"), and The Keith Companies, Inc., a California corporation ("Subtenant"). RECITALS -------- WHEREAS, under that certain Lease, dated May 21, 1993, between Scripps Center Associates, a California general partnership, predecessor-in-interest to Landlord, and Canon Computer Systems, Inc., a California corporation ("Tenant"), as amended by that certain First Amendment to Lease, dated July 30, 1999 (collectively, the "Lease"), regarding space in the buildings located at 2995 and 2955 Red Hill Avenue, Costa Mesa, California (collectively, the "Premises"), as more particularly described in the Lease, Landlord does lease, let, and demise the Premises to Tenant for the period of time and upon the covenants, terms, and conditions therein stated; and WHEREAS, under that certain Sublease dated July 29, 1999, between Tenant and Subtenant (hereinafter referred to as the "Sublease"), Tenant did sublease, let, and demise a portion of the Premises (the "Sublease Premises") located in the 2955 Red Hill Avenue building, to Subtenant for the period of time and upon the covenants, terms, and conditions therein stated; and WHEREAS, Landlord has consented to the Sublease; and WHEREAS, Landlord is willing to agree that in the event Landlord elects to terminate the Lease due to a default by Tenant, Landlord will succeed to Tenant's interest in the Sublease, and Subtenant is willing to agree to attorn to Landlord in that event upon the covenants, terms, and conditions set forth hereinbelow. AGREEMENT --------- NOW, THEREFORE, in consideration of the covenants, terms, conditions and agreements herein contained, and in consideration of other good and valuable consideration, each to the other, the sufficiency and receipt of which are hereby acknowledged, the parties hereto agree, covenant, and warrant as follows: 1. Subject to the observance and performance by Subtenant of all of the covenants, terms and conditions of the Sublease and in any modification or amendment specified herein or subsequently approved by Landlord on the part of Subtenant to be observed and performed, in the event the Lease is terminated due to a default by Tenant, Landlord hereby covenants that. provided that Subtenant is not then in default of the Sublease beyond any applicable notice and cure period provided in the Sublease, the Sublease and any modifications or amendments specified herein or hereafter approved by Landlord will continue in full force and effect, and Landlord shall recognize the Sublease and any modifications or amendments specified herein or subsequently approved by Landlord and Subtenant's rights thereunder, and will thereby establish direct privity of estate and contract between Landlord and Subtenant with the same force and effect and with the same relative priority in time and right as though the Sublease and any modification or amendment specified herein or subsequently approved by Landlord were directly made from Landlord in favor of Subtenant; provided, however, that notwithstanding anything in this Agreement to the contrary, in the event of a termination of the Sublease and the recognition of the Sublease as set forth herein, the terms of Section 14 of the Sublease have no applicability as between Landlord and Subtenant. 2. Subtenant agrees that in the event of any act or omission by Tenant under the Sublease which would give Subtenant the right, either immediately or after a period of time, to terminate the Sublease, whether or not set forth in the Sublease, Subtenant will not exercise any such right to terminate until (i) it shall have given written notice of the act or omission to Landlord, and (ii) if the default by Tenant is of a nature which can be cured by the Landlord, and if the Landlord is proceeding with diligence to cure such default, Subtenant shall have given the Landlord the time periods set forth in the Lease for Landlord's cure of such default, in order to cure such default, provided that any such cure period shall not commence to run until Landlord's receipt of written notice from Subtenant of such default. 3. That in the event the Lease is terminated due to a default by Tenant, Subtenant hereby covenants and agrees to make full and complete attornment to Landlord as substitute sublessor upon the same terms, covenants and conditions as provided in the Sublease and all extensions or renewals thereof, so as to establish direct privity of estate and contract between the Landlord and Subtenant with the same force and effect as though the Sublease and all modifications and amendments thereof specified herein or hereafter consented to by Landlord, together with all guarantees of Subtenant's obligations under the Sublease, were originally made directly between Landlord and Subtenant (except as specifically set forth in this Agreement). Subtenant will thereafter make all payments directly to Landlord. Subtenant waives all joinder and/or service of any and all actions at law by Landlord to gain possession of the Premises. It shall not be necessary, except as required by law, for Landlord to name Subtenant as a party prosecute any action at law to gain possession of the Premises, and unless required by law Landlord agrees not to name Subtenant in any such proceeding. 4. Notwithstanding anything contained herein to the contrary, or anything to the contrary in the Sublease or in any modifications or amendments thereto (except as set forth below), in the event the Lease is terminated due to a default by Tenant, then Landlord and Subtenant hereby covenant and agree that Landlord and its respective assignees shall not be: (a) Liable for any act or omission of Tenant, or its successors or assigns, except in the event that Landlord recognizes the Sublease pursuant to the non-disturbance provisions of Paragraph I of this Agreement, then Landlord shall be liable for the performance of the obligations of the Sublandlord under the Sublease from and after the effective date of such recognition. -2- (b) Subject to any offsets or defenses which Subtenant might have as to Tenant, or its successors or assigns, or to any claim for damages against Tenant, or its successors or assigns. (c) Required or obligated to credit Subtenant with any rent or additional rent paid by Subtenant to Tenant more than thirty (30) days in advance. (d) Bound by any amendments or modifications of the Sublease made at any time (whether before or after the Lease is terminated) without Landlord's consent. (e) Bound to or liable for refund of all or any part of any security deposit deposited by Subtenant with Tenant for any purpose unless and until such security deposit shall have been delivered by Tenant to and actually received by Landlord. In the event of receipt of any such security deposit, Landlord's obligations with respect thereto shall be limited to the amount of such security deposit actually received by Landlord, and Landlord shall be entitled to all rights, privileges and benefits of Tenant set forth in the Sublease with respect thereto. (f) Liable to Subtenant under the Sublease or otherwise from and after such time as the Landlord ceases to be the owner of the Building. Nothing in this Paragraph 4 shall be intended to waive or impair any liability Landlord may have to Subtenant pursuant to the non-disturbance provisions of Paragraph 1 above. In addition, Subtenant reserves its rights to any and all claims or causes of action against Canon Computer Systems, Inc., a California corporation, for prior losses or damages. 5. Subtenant covenants and agrees as follows for the benefit and reliance of Landlord: that it will not, without the express written consent of Landlord: (i) Cancel, terminate, modify, alter, amend or surrender the Sublease, except as may be consented to by Landlord; or (ii) Enter into any agreement with Tenant, its successors or assigns, which grants any concession with respect to the Sublease or which reduces the rent called for thereunder; or (iii) Make any offset or claim against rents, or prepay rent more than one (1) month in advance. 6. Landlord and Subtenant hereby agree as follows: (a) That neither this Agreement, nor anything to the contrary in the aforesaid Sublease or in any modifications or amendments thereto shall, prior to Landlord succeeding to the interest of Tenant, its successors or assigns, under the Sublease, operate to give rise to or create any responsibility or liability for the control, care, management or repair of the Sublease -3- Premises upon Landlord, or impose responsibility for the carrying out by Landlord of any of the covenants, terms and conditions of the Sublease or of any modification or amendment specified herein or hereafter consented to by Landlord. Notwithstanding anything to the contrary in the Sublease, Landlord, its successors and assigns, shall be responsible for performance of only those covenants and obligations of the Sublease accruing after the Lease is terminated due to a default by Tenant, and Landlord's obligations to Subtenant shall be further limited as provided in this Agreement. Notwithstanding anything in this Agreement to the contrary, Landlord acknowledges and agrees that prior to termination of the Lease by Landlord and the recognition and attornment provided for herein, Subtenant shall have no right pursuant to the Sublease or this Agreement to take direct action under any circumstances against Landlord in the name of Tenant. (b) That in the event Landlord succeeds to the interest of Tenant, its successors or assigns, under the Sublease and becomes the substitute sublessor, it is agreed that Landlord may assign its interest as substitute sublessor without the consent of Subtenant. (c) Subtenant hereby acknowledges and agrees that in the event Landlord succeeds to the interest of Tenant, its successors or assigns, under the Sublease, that any liability or obligation of the Landlord as sublessor under the Sublease shall be limited to Landlord's equity interest in the building in which the Subleased Premises are located and no recourse shall be had to any other assets of Landlord. (d) It is specifically agreed that Subtenant shall not, as to Landlord, require cure of any such default which is personal to Tenant, its successors or assigns, and therefore not susceptible of cure by Landlord. (e) Upon Landlord's written request of Subtenant given at any time after the termination of the Lease by Landlord, Subtenant (as tenant) agrees to execute a lease of the Sublease Premises with Landlord or its successor (as landlord) upon the same terms and conditions as the Sublease between Tenant and Subtenant (except with respect to any provisions eliminated therefrom pursuant to the terms of this Agreement, which lease shall cover any unexpired term of the Sublease existing at the time of such termination. 7. Any notices to Subtenant or Landlord hereunder shall be sent by United States certified or registered mail, postage prepaid, return. receipt requested, or delivered personally, addressed as follows: Subtenant: The Keith Companies, Inc. 2955 Redhill Avenue Costa Mesa, California 92626 With a copy to: Rutan & Tucker, LLP 611 Anton Boulevard, Suite 1400 Costa Mesa, California 92626 Attention: Adam N. Volkert, Esq. -4- Landlord: Amresco, Inc. 700 North Pearl Street, Suite 1700 Dallas, Texas 75201 Attention: Mr. Andy Doughtie With a copy to: Allen, Matkins, Leck, Gamble & Mallory 1999 Avenue of the Stars, Suite 1800 Los Angeles, California 90067 Attn: Cheryl S. Prell, Esq. or as to each party, to such other address as the party may designate by a notice given in accordance with the requirements contained in this Section 7. 8. This Agreement contains the entire agreement between the parties hereto. No variations, modifications or changes herein or hereof shall be binding upon any party hereto unless set forth in a document duly executed by or on behalf of such party. 9. This instrument may be executed in multiple counterparts, all of which shall be deemed originals and with the same effect as if all parties hereto had signed the same document All of such counterparts shall be construed together and shall constitute one instrument, but in making proof, it shall only be necessary to produce one such counterpart executed by the party against whom it is being enforced. 10. Whenever used herein, the singular number shall include the plural, the plural the singular, and the use of any gender shall include all genders. The words, "Landlord" and "Subtenant" shall include their heirs, executors, administrators, beneficiaries, successors and assigns. 11. Counterparts. This Agreement may be executed in counterparts, each of ------------ which shall be deemed an original, and all such counterparts, when taken together, shall constitute one and the same agreement. -5- IN WITNESS WHEREOF, the parties hereto have caused this Agreement to be signed, sealed and delivered in their respective names and in their behalf; and if a corporation, by its officers duly authorized, as of the 28th day of July, 1999. "Landlord": ASP SCRIPPS, L.L.C., a Delaware limited liability company By: /s/ SCOTT R. FITZGERALD -------------------------------- Its: Vice President -------------------------------- "Subtenant": The Keith Companies, Inc., A California corporation By: /s/ ERIC C. NIELSEN -------------------------------- Its: President -------------------------------- By: /s/ GARY CAMPANARO -------------------------------- Its: Secretary -------------------------------- -6-