write by John Resig how javascript timer work