Possible Duplicate:
Javascript countdown timer that stops when window is not in focus
I have been searching for a solution to this matter.
What I want to do is this : When a visitor clicks on a specific link on the website, he gets redirected to another page.
On this other page, he has to stay for 20 seconds. But I want to apply a countdown , so he sees the timer going down from 20 seconds to 0 seconds.
and when the timer hits 0 seconds, I will execute a php script. (it's in place)
Now , wt I also want is , that the timer will keep ticking as long as the visitor is on this page, (if this page is in focus) , else the timer stops, till he's back on the page
I have searched a lot to find a solution , but I don't even know if it's doable with php.
Any help to atleast let me know where to search will be very appreciated
thank you a lot in advance