Javascript odds and ends. Not guaranteed to be of any use.