Odd bits of javascript I've written