Simplified clock javascript