I've got a popup that launches when a person hits the page that has a link to have the person set the page as their home page. I want that link to:

1) Set the viewer's home page to the current page
2) Set a cookie (so they don't get the popup next visit)
3) Close the window

I tried making a single function to be called onClick but it didn't work. I then added into the link itself to get it going and everything (except the cookie setting) works.

HTML Code:
<a href="#" onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http://myron/'); document.cookie='name=myronHomePage expires=01/01/2007 00:00:00'; MyWindow=window.close();">Please click here to make this your default homepage!</a>
I'm pretty new to JavaScript so I'm just sitting here getting frustrated!

What the heck am I doing wrong here?