I have a page which the user can delete a booking etc and i need a confirmation to check that is what they wanted to do.

The problem is my script ignores the cancel and goes ahead anyway. Please can someone tell me what I ahve done wrong

Also I have several scripts to use on differnt pages . Is it ok to put all these scripts into 1 external .js file or should they have thier own.?


Code:
function checkrequiredemail() 
{
	var pass =confirm("Are you sure you want to send this group email? ");
	if (pass==true)
	{
	window.location="resendemailtogroup.php";
	}
	else
	{
		window.location="courselist.php";
	}
}



HTML Code:
<a href='resendemailtogroup.php?id=$courseid' class='web' onClick='checkrequiredemail()'>
Forever hopeful of creating something useful...................