Just some useful Javascript functions I'd like to keep around