i have a form on my page and the submit button calls this function:
function confirmSubmit()
var agree=confirm("Are you sure your report is complete?");
if (agree)
	return true ;
	return false ;
I also have on the page an alert if the user tries to navigate away this alert is brought up:
function goodbye(e) {
	if(!e) e = window.event;
	//e.cancelBubble is supported by IE - this will kill the bubbling process.
	e.cancelBubble = true;
	e.returnValue = '***YOU HAVE NOT SAVED YOUR REPORT***'; //This is displayed on the dialog

	//e.stopPropagation works in Firefox.
	if (e.stopPropagation) {
The problem that has been brought to my attention is, if the user is submitting the form, both alert come up.

I would like to cancel out the 'function goodbye(e)' IF the user is hitting the submit button on the form and only have the first alert pop up.

Any help is much appreciated!