an exercise in jquery animation and logic