title: How do I implement a loading indicator with a goog.net.XhrManager?
body: <p>I have a component with a private goog.net.XhrManager that it uses to make ajax requests to populate lists and tables with server data. </p>
  
  <p>I also have a div that has a loading indicator and the CSS all set up to show and hide it. </p>
  
  <p>Right now, I have the XhrManager executing a series of calls, and I use the event id passed into the XhrManager's send method to discern what to do in the COMPLETE callback. However, since the order of calls can potentially be arbitrary in the READY and [SUCCESS, ERROR] callbacks where I display and hide the loading indicator respectively, I'm having a hard time cleanly turning on and off the indicator. </p>
  
  <p>I am wondering if there is another set of callbacks or a different technique I should use. How does g-mail do this for example when you click the next arrow to page through mail if it is not only loading the next page of mail, but contextual sidebar info, ads, etc?</p>