Closing the window from JavaScript should be easy. However if the window was not opened using script the user will be prompted for permission to close the window. This can be irritating for the user end so a request you frequently encounter is to close the window without prompting for permission. I came across two interesting articles today, one that provides a technique for IE 6 and the other for IE 7. So here are the two posts:
I've tested the IE 7 and it seems to work well.