One observation: your code clicks on what I'm guessing is a form's submit button, and then immediately loads a new page. Depending on timing-related events, it's a little unpredictable what exactly will happen. I expect you want the form to be submitted before you open the next page, but it might not have been. You should at least call waitForPageToLoad() between the two.
FYI, the specific error is a unexpected JavaScript alert. Selenium catches those and waits to see if the next thing your script does is ask for it (via getAlert()). If not, you get the error. So the alert was produced by your application during the *previous* Selenium command.
Ross