How to control the timeline through HTML/Java

Hey.
I would very appreciate is someone can help me with my little problem.

I have a swf movie in my website. when the movie is finish to play, it stops,
and you can PLAY AGAIN, OR SEND TO A FRIEND.

I just want something very simple:
I want to the HTML to identify if the user already visit the page, (i guess using cookie),
and it will make the swf go to the last frame (the one with play again, and send to a friend).

I need this to happen because i don’t want the movie to play every time when register
user are signed in.