What you encountered is an example of a confirm box followed by an alert box. Below is the code for the confirm box:
Click here for the next example.