Broswer manipulation with javascript?!?!

hi all

i have a main.html, what i want to know if its possible is when the user enters main.html can a javascript popup automatically come up?..and when that happens close main.html automatically??

thnx in advance :smiley: