Tidied up javascript spacing and comparison operators