You can't, unless you opened the window via script initially. Some older browsers had flaws that allowed this but it's becoming less and less common. In general users don't want you to be able to close windows.
Please don't post the same question across forums, it's very annoying when one spends time answering a question only to find an identical answer has already been given.
Joe (Microsoft MVP - XML