Use hasClass() consistently for testing presence of a class.
Be more consistent in lowercasing the linking texts.