Javascript title checker