some simple js tools.