Simplified by linking to ratemyprofessors' search by last name instead of doing database lookup. Made more robust by checking what term you are registering for.
Some cleanup to pass JSLint