Here's something else, give this code a try:
No code in the HEAD tag this time, because we're not using any functions. Technically, you can put a function anywhere you want for the most part, but keeping it in the HEAD tag is the easiest way to go about it.
Now, what this script does, is it waits for the page to load, and when it is, it prompts you with one of those alert boxes - only this time, in addition to the "OK" button, there's also a "Cancel" button. If you press "OK" it will redirect you to Yahoo.com (or another URL - simply modify the url to do so). If you press "Cancel" you'll stay on that page.