assorted js stuff