You really can't. Most browsers will not allow a page that is not opened by
another existing window to be closed programmatically without the permission
(and therefore interaction) of the user.
However, if you can accept that, here is basically what you want in a
nutshell:
<script type="text/javascript"><!--
setTimeout("window.close()", 5000);
// --></script>
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Abnormality is anything but average.