
823 N.E.2d 986 (2005)
355 Ill. App.3d 516
291 Ill.Dec. 400
PEKIN INSURANCE COMPANY, Plaintiff-Appellant,
v.
David DIAL and Cynthia Cain, Defendants-Appellees.
No. 5-03-0646.
Appellate Court of Illinois, Fifth District.
Rule 23 Order Filed December 16, 2004.
Motion to Publish Granted January 20, 2005.
Opinion Filed January 20, 2005.
*988 Robert Marc Chemers, Pretzel & Stouffer, Chtd., Chicago, IL, for Appellant.
Christopher B. Daniels, Daniels Law Office, Centralia, IL, for Appellee Cynthia Cain.
Justice HOPKINS delivered the opinion of the court:
Cynthia Cain filed a sexual assault action against Dial Real Estate and Investments and David Dial (Dial), and Dial tendered the defense of Cain's action to his insurer, Pekin Insurance Company (Pekin). Pekin filed this action seeking a declaration that it had no duty to defend Dial in the Cain action. The trial court found that Pekin had a duty to defend Dial and that Pekin breached its duty to defend.
On appeal, Pekin argues that the trial court erred in finding that Cain's sexual assault allegations were covered by Pekin's insurance policy.
We reverse and enter a declaratory judgment for Pekin.

FACTS
Pekin issued a commercial general liability insurance policy, with an effective policy period from January 31, 2000, to January 31, 2001, to Dial as the insured "with respect to the conduct of [the] business." The policy provided:
"a. We will pay those sums that the insured becomes legally obligated to pay as damages because of `bodily injury' or `property damage' to which this insurance applies. We will have the right and duty to defend any `suit' seeking those damages. * * *
b. This insurance applies to `bodily injury' and `property damage' only if:
(1) The `bodily injury' or `property damage' is caused by an `occurrence' that takes place in the `coverage territory' * * *."
The policy defined the term "bodily injury" as "bodily injury, sickness[,] or disease sustained by a person, including death resulting from any of these at any time," and defined the term "occurrence" as "an accident, including continuous or repeated exposure to substantially the same general harmful conditions."
*989 The policy excluded the following from coverage:
"a. Expected or Intended Injury
`Bodily injury' or `property damage' expected or intended from the standpoint of the insured."
On October 12, 2001, Cain filed her third amended complaint, alleging, in count I, that between May 20, 2000, and June 26, 2000, Dial negligently touched, fondled, and exposed himself to her with the misapprehension of her desires and wishes. In count II, Cain alleged that Dial repeatedly, willfully, and without provocation touched, fondled, and exposed himself to her. Cain alleged that as a result of Dial's conduct, she suffered an upset stomach, headaches, and a loss of a normal life.
Dial tendered the defense of Cain's action to Pekin, Pekin refused Dial's tender, and on June 20, 2001, Pekin filed its declaratory judgment action, seeking a declaration that it had no duty to defend Dial because Dial's alleged conduct was intentional, because Dial's alleged conduct did not arise out of or within the course of his employment, and because Cain did not seek damages for "bodily injury" as contemplated by the insurance policy.
On January 28, 2002, Dial assigned to Cain any rights he had against Pekin. On May 3, 2002, pursuant to the terms of Dial and Cain's joint stipulation, the trial court entered an amended judgment in favor of Cain on count I of her third amended complaint, awarded Cain $300,000, and entered a judgment in favor of Dial on count II.
On October 9, 2002, Cain filed a counterclaim against Pekin alleging that Pekin breached its duty of good faith in failing to defend Dial against her action. On November 18, 2002, Pekin filed a motion for a judgment on the pleadings. On December 13, 2002, Cain filed a motion for summary judgment, requesting that the court order Pekin to pay the judgment rendered in her tort action against Dial.
On June 9, 2003, the trial court heard arguments on the motions. On October 8, 2003, the trial court found that Cain's complaint pled a cause of action that was potentially covered by the insurance policy and that Pekin breached its duty to defend Dial. The court denied Pekin's motion for a judgment on the pleadings and granted Cain's motion for a summary judgment. On October 16, 2003, Pekin filed its timely notice of appeal.

ANALYSIS
Although a summary judgment is a drastic means of disposing of litigation, it is appropriate in cases where there are no genuine issues of material fact and the moving party is entitled to a judgment as a matter of law. Crum & Forster Managers Corp. v. Resolution Trust Corp., 156 Ill.2d 384, 390-91, 189 Ill.Dec. 756, 620 N.E.2d 1073 (1993). "The construction of an insurance policy and a determination of the rights and obligations thereunder are questions of law for the court which are appropriate subjects for disposition by way of summary judgment. [Citations.]" Crum & Forster Managers Corp., 156 Ill.2d at 391, 189 Ill.Dec. 756, 620 N.E.2d 1073. We review de novo the trial court's decision to enter a summary judgment. Crum & Forster Managers Corp., 156 Ill.2d at 390, 189 Ill.Dec. 756, 620 N.E.2d 1073.
When construing an insurance policy, the court's primary function is to ascertain and enforce the parties' intentions as expressed in the agreement. Crum & Forster Managers Corp., 156 Ill.2d at 391, 189 Ill.Dec. 756, 620 N.E.2d 1073. The court must construe the policy as a whole, considering the type of insurance for which the parties contracted, the *990 risks undertaken and purchased, the subject matter insured, and the purposes of the contract. Crum & Forster Managers Corp., 156 Ill.2d at 391, 189 Ill.Dec. 756, 620 N.E.2d 1073. If the policy's terms are plain and unambiguous, the court affords them their plain, ordinary meaning and applies them as written. Crum & Forster Managers Corp., 156 Ill.2d at 391, 189 Ill.Dec. 756, 620 N.E.2d 1073.
To determine whether an insurer has a duty to defend its insured in a lawsuit, a court should generally apply an "eight corners rule"that is, the court should compare the four corners of the underlying tort complaint with the four corners of the insurance policy and determine whether the facts alleged in the underlying complaint fall within, or potentially within, the insurance policy's coverage. Crum & Forster Managers Corp., 156 Ill.2d at 393, 189 Ill.Dec. 756, 620 N.E.2d 1073; West American Insurance Co. v. Vago, 197 Ill.App.3d 131, 136, 143 Ill.Dec. 195, 553 N.E.2d 1181 (1990). Where the underlying complaint alleges facts that, if true, would not be covered under the policy, the insurer has no duty to defend. American Family Mutual Insurance Co. v. Chiczewski, 298 Ill.App.3d 1092, 1094, 233 Ill.Dec. 249, 700 N.E.2d 777 (1998). The factual allegations of the complaint, rather than the legal theory under which the action is brought, determine whether there is a duty to defend. Management Support Associates v. Union Indemnity Insurance Co. of New York, 129 Ill.App.3d 1089, 1097, 85 Ill.Dec. 37, 473 N.E.2d 405 (1984). The allegations of the complaint must be construed liberally, and any doubts must be resolved in favor of the insured. Vago, 197 Ill.App.3d at 136, 143 Ill.Dec. 195, 553 N.E.2d 1181.
"[W]hen a complaint against the insured alleges facts potentially within the scope of the policy coverage, an insurer taking the position that the complaint is not covered by its policy must defend the suit under a reservation of rights or seek a declaratory judgment." (Emphasis in original.) State Farm Fire & Casualty Co. v. Martin, 186 Ill.2d 367, 374, 238 Ill.Dec. 126, 710 N.E.2d 1228 (1999). "An insurer will not be estopped from denying coverage merely because the underlying case proceeds to judgment before the declaratory judgment action is resolved." Martin, 186 Ill.2d at 374, 238 Ill.Dec. 126, 710 N.E.2d 1228.
In the present case, the policy provided coverage for bodily injury caused by an "occurrence," and the policy defined "occurrence" as "an accident, including continuous or repeated exposure to substantially the same general harmful conditions." The policy further excluded coverage for bodily injury "expected or intended from the standpoint of the insured." To determine coverage, we construe the definition of "occurrence" together with the policy's specific exclusion for expected or intended injury. See Thornton v. Illinois Founders Insurance Co., 84 Ill.2d 365, 371, 49 Ill.Dec. 724, 418 N.E.2d 744 (1981) ("occurrence" definition and exclusion provisions are not conflicting merely because they tend to overlap).
"[A]n occurrence which is defined as an accident involves the consideration of whether the injury was expected or intended from the standpoint of the insured." State Farm Fire & Casualty Co. v. Watters, 268 Ill.App.3d 501, 506, 205 Ill.Dec. 936, 644 N.E.2d 492 (1994). In Aetna Casualty & Surety Co. v. Freyer, the reviewing court discussed the term "occurrence," which was defined as an accident in the policy issued in that case, as follows:
"An accident has been defined as an unforeseen occurrence, usually of an untoward *991 or disastrous character or an undesigned sudden or unexpected event of an inflictive or unfortunate character. The natural and ordinary consequences of an act do not constitute an accident. [Citation.] An injury caused by an assault and battery normally is not considered to be accidental [citation], even if the specific injury was not intended. [Citation.]" Aetna Casualty & Surety Co. v. Freyer, 89 Ill.App.3d 617, 619, 44 Ill.Dec. 791, 411 N.E.2d 1157 (1980).
When construing policy exclusions for bodily injury that is expected or intended by the insured, courts have held that the injury is "expected" where the damages are "`of such a nature that they should have been reasonably anticipated (expected) by the insured.'" Westfield National Insurance Co. v. Continental Community Bank & Trust Co., 346 Ill.App.3d 113, 122, 281 Ill.Dec. 636, 804 N.E.2d 601 (2003) (quoting Freyer, 89 Ill.App.3d at 620, 44 Ill.Dec. 791, 411 N.E.2d 1157). If the insured was consciously aware that the injuries were practically certain to be caused by his conduct, the injuries are considered "expected" from the standpoint of the insured and are excluded from coverage under the policy. Bay State Insurance Co. v. Wilson, 96 Ill.2d 487, 494, 71 Ill.Dec. 726, 451 N.E.2d 880 (1983).
An insurance company is under no duty to defend or indemnify an insured who sexually abuses a minor, because the nature of the conduct itself establishes as a matter of law that the insured expected or intended to injure the victim. Westfield National Insurance Co., 346 Ill.App.3d at 119-20, 281 Ill.Dec. 636, 804 N.E.2d 601. Coverage is not triggered because the insured's child sexual abuse does not fall within the definition of "occurrence" and because the abuse is excluded as an "expected or intended" act under the policy. Westfield National Insurance Co., 346 Ill.App.3d at 119-20, 281 Ill.Dec. 636, 804 N.E.2d 601; see also Watters, 268 Ill.App.3d at 507, 205 Ill.Dec. 936, 644 N.E.2d 492 (even though a sexual offender had diminished capacity and could not form the intent to harm the children, his intent to harm was inferred as a matter of law and coverage of his sexual misconduct was precluded under the homeowner's policy); Scudder v. Hanover Insurance Co., 201 Ill.App.3d 921, 929, 147 Ill.Dec. 386, 559 N.E.2d 559 (1990) (the insurer had no duty to defend or indemnify the insured for allegedly sexually assaulting four minors, because that activity was intentional as a matter of law and therefore excluded under the insurance policy).
In Vago, a country club waitress filed the underlying tort complaint, alleging that, while she was working, the insured grabbed her from behind, locked his arms around her waist, prevented her from escaping, and thrust his pelvis against her buttock several times while he had an erection. Vago, 197 Ill.App.3d at 133, 143 Ill.Dec. 195, 553 N.E.2d 1181. Two insurance policies issued to the insured excluded coverage for bodily or personal injury "`which is expected or intended by the insured.'" Vago, 197 Ill.App.3d at 134, 143 Ill.Dec. 195, 553 N.E.2d 1181. The court held that, even though the underlying complaint was couched in terms of negligence, the insurer had no duty to defend or indemnify the insured because the complaint alleged a course of conduct that was clearly intentional, and not merely negligent or accidental, because the insured would have been consciously aware that he was practically certain to cause emotional injuries to the waitress. Vago, 197 Ill.App.3d at 137, 143 Ill.Dec. 195, 553 N.E.2d 1181. The court concluded that the insured should have reasonably anticipated the waitress's injuries and that, *992 therefore, the injuries were "expected" and not covered because of the exclusionary clauses in the two policies. Vago, 197 Ill.App.3d at 137, 143 Ill.Dec. 195, 553 N.E.2d 1181; see also Hartford Insurance Co. of Illinois v. Kelly, 309 Ill.App.3d 800, 807, 243 Ill.Dec. 256, 723 N.E.2d 288 (1999) (in cases where adults have been charged with having sex with minors or sexually assaulting adults, specific intent to harm is inferred as a matter of law and insurance coverage is excluded under the policy).
In the present case, Cain alleged that Dial fondled and touched her and exposed himself to her with the misapprehension of her desires and wishes. Similar to Vago, even though count I of Cain's complaint was couched in terms of negligence, the complaint alleged a course of conduct that was clearly intentional and not merely negligent or accidental. See Vago, 197 Ill.App.3d at 137, 143 Ill.Dec. 195, 553 N.E.2d 1181. If Dial engaged in the conduct alleged in Cain's complaint, he would have been consciously aware that he was practically certain to cause emotional injuries to Cain. See Vago, 197 Ill.App.3d at 137, 143 Ill.Dec. 195, 553 N.E.2d 1181. Cain's injuries were a natural and probable result of Dial's alleged conduct, whether or not he anticipated the precise injury Cain would suffer. See Westfield National Insurance Co., 346 Ill.App.3d at 122, 281 Ill.Dec. 636, 804 N.E.2d 601 (the insurer had no duty to defend an aunt for her participatory conduct resulting in her husband's child sexual abuse because the aunt should have anticipated or "expected" the minor's injuries, which were a natural and probable result of her enabling acts, regardless of whether she could anticipate their precise injury). Similarly, Dial should have reasonably anticipated Cain's injuries, and therefore, Cain's injuries were "expected" and not covered under the policy. See Vago, 197 Ill.App.3d at 137, 143 Ill.Dec. 195, 553 N.E.2d 1181; see also Watters, 268 Ill.App.3d at 511, 205 Ill.Dec. 936, 644 N.E.2d 492 (the intent of the parties to the insurance contract was not to provide coverage for unintended bad consequences resulting from intentional sexual acts). Cain's allegations of negligence were a transparent attempt to trigger insurance coverage. See Watters, 268 Ill.App.3d at 510, 205 Ill.Dec. 936, 644 N.E.2d 492.
Cain failed to allege facts to bring her cause within or potentially within the coverage of the policy. See Chiczewski, 298 Ill.App.3d at 1094, 233 Ill.Dec. 249, 700 N.E.2d 777 (where the underlying complaint alleges facts that, if true, would not be covered under the policy, the insurer has no duty to defend). Because the allegations in Cain's tort complaint were clearly excluded from coverage under the policy, Pekin had no duty to defend Dial. We therefore reverse the trial court's decision and enter a declaratory judgment that Pekin had no duty to defend Dial with respect to Cain's tort litigation.
Based on our conclusion, we reject Cain's argument that Pekin had a duty to defend Dial because it failed to include a specific exclusion for sexual misconduct, and we need not address Cain's argument that Pekin is estopped from asserting contractual defenses because it breached its duty to defend.

CONCLUSION
For the foregoing reasons, the judgment of the circuit court of Marion County is reversed, and we enter a declaratory judgment for Pekin.
Reversed; judgment entered.
WELCH and CHAPMAN, JJ., concur.
