<title>Chapter Two</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script type="text/javascript">

var guestsCost=0;
var limousinesCost=0;
var liveMusicCost=0;
var flowersCost=0;
var totalEstimate=0;

function calcGuests(){
totalEstimate -= guestsCost;
guestsCost = document.details.numGuests.value * 65;
totalEstimate += guestsCost;
document.estimate.cost.value = "$" + totalEstimate;

<form action="" name="details">
<table border="1">
<td>Guests<br />
($65 each)</td>
<input type="text" name="numGuests" size="5" onchange="calcGuests();" /></td>

<form action="" name="estimate">
<input type="text" name="cost" size="5"
style="border-style: none; border-color: inherit border-width: medium; background-color: yellow; text="0" /></p>


I didn't understand what the second statement (totalEstimate -= guestsCost in the "calcGuests" function is for?
Please someone explain to me as I'm a beginner.

Thanks in Advance!