Hi Mark!
I have written a similar script, you can see it on my website -
http://www.livescripts.co.uk. On the right hand side click Cut & Paste JavaScripts, then choose Mouse Cursor. Look for Mouse-Clock, click it and then click the link to see the example. Also see the Time Related section for more cool stuff to do with time

Jon
